예제 #1
0
        /// <summary>
        /// Enables movement. Called by animation.
        /// </summary>
        public void EnableMovement()
        {
            if (!movement)
            {
                movement = transform.parent.GetComponent <EnemyMovement> ();
            }

            if (movement)
            {
                movement.CanMove = true;
            }
            else
            {
                Debug.LogError("Parent transform should have 'EnemyMovement' script");
            }
        }
        void Awake()
        {
            if (!IceCaseAnimation)
            {
                Debug.Log("Ice case animation has not been set");
            }

            if (!LightningAnimation)
            {
                Debug.Log("Lightning animation has not been set");
            }

            damageMethodLookUp = new Dictionary <SPECIAL_DAMAGE_TYPE, ApplyAnimation> ();
            damageMethodLookUp.Add(SPECIAL_DAMAGE_TYPE.ICE_CASE, ApplyIceCase);
            damageMethodLookUp.Add(SPECIAL_DAMAGE_TYPE.CHAIN_LIGHTNING, ApplyLightningChain);

            movement = GetComponent <EnemyMovement> ();
            health   = GetComponent <Health> ();
        }