Browse Source

worked on characters animation

Josh_Dev_branch
Joshua Reason 5 years ago
parent
commit
0e5b672e0a
11 changed files with 191 additions and 50 deletions
  1. +0
    -8
      Assets/Plugins/IngameDebugConsole/Android.meta
  2. +0
    -8
      Assets/Plugins/IngameDebugConsole/Prefabs.meta
  3. +0
    -8
      Assets/Plugins/IngameDebugConsole/Scripts.meta
  4. +0
    -8
      Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta
  5. +5
    -1
      Assets/Scripts/Character.cs
  6. +1
    -1
      Assets/Scripts/Components.meta
  7. +1
    -1
      Assets/Scripts/LevelBlocks/Block.cs
  8. +6
    -1
      Assets/Scripts/Logic/Blocks/Jump.cs
  9. +8
    -2
      Assets/Scripts/Logic/Blocks/Move.cs
  10. +0
    -8
      Assets/Scripts/LogicBlocks.meta
  11. +170
    -4
      Assets/Third Party Assets/KUBIKOS - Cube Mini Animals/Animals1_Mesh/Bear.fbx.meta

+ 0
- 8
Assets/Plugins/IngameDebugConsole/Android.meta View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 3d7d7a61a5341904eb3c65af025b1d86
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 0
- 8
Assets/Plugins/IngameDebugConsole/Prefabs.meta View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 7dbc36665bc0d684db9a4447e27a7a4b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 0
- 8
Assets/Plugins/IngameDebugConsole/Scripts.meta View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 860c08388401a6d4e858fe4910ea9337
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 0
- 8
Assets/Plugins/IngameDebugConsole/Sprites/Unused.meta View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: f6caae32d463529478f2186f47c2e3fe
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 5
- 1
Assets/Scripts/Character.cs View File

@ -129,6 +129,8 @@ public class Character : MonoBehaviour
} }
yield return StartCoroutine(LerpToBlock(target, time, yFunction)); yield return StartCoroutine(LerpToBlock(target, time, yFunction));
_currentBlock= target;
switch (animation) switch (animation)
{ {
@ -158,7 +160,9 @@ public class Character : MonoBehaviour
{ {
_newPos = Vector3.Lerp(_startPos, _endPos, (elapsedTime / time)); _newPos = Vector3.Lerp(_startPos, _endPos, (elapsedTime / time));
_newPos.y += heightOffset(elapsedTime / time);
if (heightOffset != null)
_newPos.y += heightOffset(elapsedTime / time);
transform.position = _newPos; transform.position = _newPos;

Assets/Models.meta → Assets/Scripts/Components.meta View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 296bd90e667df1f4697823a0aa45acf0
guid: 8d7394d70ec233849a60a26da5f23b75
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

+ 1
- 1
Assets/Scripts/LevelBlocks/Block.cs View File

@ -113,7 +113,7 @@ public class Block : MonoBehaviour
Block[] blocks = cols.Where(p => p.GetComponent<Block>() != null).Select(p => p.GetComponent<Block>()).ToArray(); Block[] blocks = cols.Where(p => p.GetComponent<Block>() != null).Select(p => p.GetComponent<Block>()).ToArray();
//Draw cube, for visuals //Draw cube, for visuals
//DebugExtensions.DrawCube(position, halfExtent, Color.cyan, 1, false);
DebugExtensions.DrawCube(position, halfExtent, Color.cyan, 1, false);
//if didn't hit anyblocks return false //if didn't hit anyblocks return false
if (blocks.Length == 0) if (blocks.Length == 0)

+ 6
- 1
Assets/Scripts/Logic/Blocks/Jump.cs View File

@ -30,7 +30,12 @@ public class Jump : LogicBlock
/// <param name="player">Player to move</param> /// <param name="player">Player to move</param>
protected override void BlockLogic(Character player, float animationTime) protected override void BlockLogic(Character player, float animationTime)
{ {
player.Jump(direction, animationTime);
//player.Jump(direction, animationTime);
player.justMoved = true;
Block endBlock = GetEndBlock(player.CurrentBlock, player.transform, ~player.Ignore);
player.StartCoroutine(player.MoveToBlock(endBlock, Character.Animation.Jump, animationTime));
} }
/// <summary> /// <summary>

+ 8
- 2
Assets/Scripts/Logic/Blocks/Move.cs View File

@ -23,8 +23,11 @@ public class Move : LogicBlock
{ {
player.justMoved = true; player.justMoved = true;
//player.Move(direction, animationTime); //player.Move(direction, animationTime);
Block endBlock = GetEndBlock(player.CurrentBlock, player.transform, player.Ignore);
player.MoveToBlock(endBlock, Character.Animation.Walk, animationTime);
Block endBlock = GetEndBlock(player.CurrentBlock, player.transform, ~player.Ignore);
Debug.Log("CurrentBlock: " + player.CurrentBlock.position + "\nEndBlock: " + endBlock.position);
player.StartCoroutine(player.MoveToBlock(endBlock, Character.Animation.Walk, animationTime));
} }
/// <summary> /// <summary>
@ -35,6 +38,9 @@ public class Move : LogicBlock
/// <returns></returns> /// <returns></returns>
public override Block GetEndBlock(Block startBlock,Transform tranform, LayerMask layerMask) public override Block GetEndBlock(Block startBlock,Transform tranform, LayerMask layerMask)
{ {
DebugExtensions.DrawCube(startBlock.position, Vector3.one / 2, Color.red, 3, false);
Vector3 wantedPosition = startBlock.position + direction.ToVector(tranform); // position wanted Vector3 wantedPosition = startBlock.position + direction.ToVector(tranform); // position wanted
Block hit; //output of block detection Block hit; //output of block detection
Block retVal = startBlock; //Block we'll move to Block retVal = startBlock; //Block we'll move to

+ 0
- 8
Assets/Scripts/LogicBlocks.meta View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 8936b441d7647f74884c94f97bfb8931
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

+ 170
- 4
Assets/Third Party Assets/KUBIKOS - Cube Mini Animals/Animals1_Mesh/Bear.fbx.meta View File

@ -1,9 +1,7 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: ecb900ca4b414eae9053afe2b45f3656 guid: ecb900ca4b414eae9053afe2b45f3656
timeCreated: 1505749502
licenseType: Store
ModelImporter: ModelImporter:
serializedVersion: 19
serializedVersion: 23
fileIDToRecycleName: fileIDToRecycleName:
100000: //RootNode 100000: //RootNode
100002: Bear 100002: Bear
@ -34,12 +32,22 @@ ModelImporter:
7400010: Attack 7400010: Attack
7400012: Hit 7400012: Hit
7400014: JumpInplace 7400014: JumpInplace
7400016: Sit
7400018: Stand
7400020: SitIdle
9500000: //RootNode 9500000: //RootNode
13700000: Bear 13700000: Bear
externalObjects:
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Material_CubeAnimals_SHDR
second: {fileID: 2100000, guid: 6e494e65902c4d058104285116e11f82, type: 2}
materials: materials:
importMaterials: 1 importMaterials: 1
materialName: 0 materialName: 0
materialSearch: 1 materialSearch: 1
materialLocation: 0
animations: animations:
legacyGenerateAnimations: 4 legacyGenerateAnimations: 4
bakeSimulation: 0 bakeSimulation: 0
@ -52,12 +60,15 @@ ModelImporter:
animationImportWarnings: animationImportWarnings:
animationRetargetingWarnings: animationRetargetingWarnings:
animationDoRetargetingWarnings: 0 animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1 animationCompression: 1
animationRotationError: 0.5 animationRotationError: 0.5
animationPositionError: 0.5 animationPositionError: 0.5
animationScaleError: 0.5 animationScaleError: 0.5
animationWrapMode: 0 animationWrapMode: 0
extraExposedTransformPaths: [] extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: clipAnimations:
- serializedVersion: 16 - serializedVersion: 16
name: Idle name: Idle
@ -443,28 +454,184 @@ ModelImporter:
maskType: 3 maskType: 3
maskSource: {instanceID: 0} maskSource: {instanceID: 0}
additiveReferencePoseFrame: 0 additiveReferencePoseFrame: 0
- serializedVersion: 16
name: Sit
takeName: Take 001
firstFrame: 40
lastFrame: 60
wrapMode: 0
orientationOffsetY: 0
level: 0
cycleOffset: 0
loop: 0
hasAdditiveReferencePose: 0
loopTime: 0
loopBlend: 0
loopBlendOrientation: 0
loopBlendPositionY: 0
loopBlendPositionXZ: 0
keepOriginalOrientation: 0
keepOriginalPositionY: 1
keepOriginalPositionXZ: 0
heightFromFeet: 0
mirror: 0
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
curves: []
events: []
transformMask:
- path:
weight: 1
- path: Bear
weight: 1
- path: Bear_Root
weight: 1
- path: Bear_Root/Body
weight: 1
- path: Bear_Root/Body/Eye_L
weight: 1
- path: Bear_Root/Body/Eye_R
weight: 1
- path: Bear_Root/Body/LegBack_L
weight: 1
- path: Bear_Root/Body/LegBack_R
weight: 1
- path: Bear_Root/Body/LegFront_L
weight: 1
- path: Bear_Root/Body/LegFront_R
weight: 1
maskType: 3
maskSource: {instanceID: 0}
additiveReferencePoseFrame: 0
- serializedVersion: 16
name: Stand
takeName: Take 001
firstFrame: 110
lastFrame: 140
wrapMode: 0
orientationOffsetY: 0
level: 0
cycleOffset: 0
loop: 0
hasAdditiveReferencePose: 0
loopTime: 0
loopBlend: 0
loopBlendOrientation: 0
loopBlendPositionY: 0
loopBlendPositionXZ: 0
keepOriginalOrientation: 0
keepOriginalPositionY: 1
keepOriginalPositionXZ: 0
heightFromFeet: 0
mirror: 0
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
curves: []
events: []
transformMask:
- path:
weight: 1
- path: Bear
weight: 1
- path: Bear_Root
weight: 1
- path: Bear_Root/Body
weight: 1
- path: Bear_Root/Body/Eye_L
weight: 1
- path: Bear_Root/Body/Eye_R
weight: 1
- path: Bear_Root/Body/LegBack_L
weight: 1
- path: Bear_Root/Body/LegBack_R
weight: 1
- path: Bear_Root/Body/LegFront_L
weight: 1
- path: Bear_Root/Body/LegFront_R
weight: 1
maskType: 3
maskSource: {instanceID: 0}
additiveReferencePoseFrame: 0
- serializedVersion: 16
name: SitIdle
takeName: Take 001
firstFrame: 60
lastFrame: 110
wrapMode: 0
orientationOffsetY: 0
level: 0
cycleOffset: 0
loop: 0
hasAdditiveReferencePose: 0
loopTime: 1
loopBlend: 0
loopBlendOrientation: 0
loopBlendPositionY: 0
loopBlendPositionXZ: 0
keepOriginalOrientation: 0
keepOriginalPositionY: 1
keepOriginalPositionXZ: 0
heightFromFeet: 0
mirror: 0
bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000
curves: []
events: []
transformMask:
- path:
weight: 1
- path: Bear
weight: 1
- path: Bear_Root
weight: 1
- path: Bear_Root/Body
weight: 1
- path: Bear_Root/Body/Eye_L
weight: 1
- path: Bear_Root/Body/Eye_R
weight: 1
- path: Bear_Root/Body/LegBack_L
weight: 1
- path: Bear_Root/Body/LegBack_R
weight: 1
- path: Bear_Root/Body/LegFront_L
weight: 1
- path: Bear_Root/Body/LegFront_R
weight: 1
maskType: 3
maskSource: {instanceID: 0}
additiveReferencePoseFrame: 0
isReadable: 1 isReadable: 1
meshes: meshes:
lODScreenPercentages: [] lODScreenPercentages: []
globalScale: 1 globalScale: 1
meshCompression: 0 meshCompression: 0
addColliders: 0 addColliders: 0
useSRGBMaterialColor: 1
importVisibility: 0
importBlendShapes: 1 importBlendShapes: 1
importCameras: 0
importLights: 0
swapUVChannels: 0 swapUVChannels: 0
generateSecondaryUV: 0 generateSecondaryUV: 0
useFileUnits: 1 useFileUnits: 1
optimizeMeshForGPU: 1 optimizeMeshForGPU: 1
keepQuads: 0 keepQuads: 0
weldVertices: 1 weldVertices: 1
preserveHierarchy: 0
indexFormat: 1
secondaryUVAngleDistortion: 8 secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001 secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88 secondaryUVHardAngle: 88
secondaryUVPackMargin: 4 secondaryUVPackMargin: 4
useFileScale: 1 useFileScale: 1
previousCalculatedGlobalScale: 0.01
hasPreviousCalculatedGlobalScale: 1
tangentSpace: tangentSpace:
normalSmoothAngle: 60 normalSmoothAngle: 60
normalImportMode: 0 normalImportMode: 0
tangentImportMode: 3 tangentImportMode: 3
normalCalculationMode: 0
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
importAnimation: 1 importAnimation: 1
copyAvatar: 0 copyAvatar: 0
humanDescription: humanDescription:
@ -479,7 +646,6 @@ ModelImporter:
legStretch: 0.05 legStretch: 0.05
feetSpacing: 0 feetSpacing: 0
rootMotionBoneName: rootMotionBoneName:
rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1}
hasTranslationDoF: 0 hasTranslationDoF: 0
hasExtraRoot: 0 hasExtraRoot: 0
skeletonHasParents: 1 skeletonHasParents: 1

Loading…
Cancel
Save