diff --git a/Assets/Resources/Scripts/AIScripts/Enemy.cs b/Assets/Resources/Scripts/AIScripts/Enemy.cs index bed31ff..f3b0402 100644 --- a/Assets/Resources/Scripts/AIScripts/Enemy.cs +++ b/Assets/Resources/Scripts/AIScripts/Enemy.cs @@ -6,6 +6,7 @@ using System; public class Enemy : Controller{ public bool isAir; private state currentState; + private Animator mAnimator; public LayerMask enemyMask; public bool rightdirection; public float[] time = new float[10]; @@ -14,11 +15,14 @@ public class Enemy : Controller{ void Start () { print("start"); + mAnimator = GetComponent (); changestate(new idle()); } // Update is called once per frame void Update () { + mAnimator.SetFloat ("Speed", GetComponent ().velocity.magnitude); + //mAnimator.SetFloat ("Player Health", GameObject.FindWithTag ("Scene_Object").GetComponent()); currentState.Execute(); } public void changestate(state newstate) diff --git a/Assets/Sprites/SpriteAnimations/SpiderController.controller b/Assets/Sprites/SpriteAnimations/SpiderController.controller new file mode 100644 index 0000000..1417794 Binary files /dev/null and b/Assets/Sprites/SpriteAnimations/SpiderController.controller differ diff --git a/Assets/Sprites/SpriteAnimations/SpiderController.controller.meta b/Assets/Sprites/SpriteAnimations/SpiderController.controller.meta new file mode 100644 index 0000000..83b3e59 --- /dev/null +++ b/Assets/Sprites/SpriteAnimations/SpiderController.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a85a73eb6330eaa4fb472f22a8a78955 +timeCreated: 1454227347 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sprites/SpriteAnimations/SpiderFab.prefab b/Assets/Sprites/SpriteAnimations/SpiderFab.prefab new file mode 100644 index 0000000..d09a27c Binary files /dev/null and b/Assets/Sprites/SpriteAnimations/SpiderFab.prefab differ diff --git a/Assets/Sprites/SpriteAnimations/SpiderFab.prefab.meta b/Assets/Sprites/SpriteAnimations/SpiderFab.prefab.meta new file mode 100644 index 0000000..562e1e2 --- /dev/null +++ b/Assets/Sprites/SpriteAnimations/SpiderFab.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bdb824d553c6df645b8240a915ac7828 +timeCreated: 1454258941 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: