예제 #1
0
        public void ResetPropertiesWithPropertyCalculator(AgentPropertyCalculator cal)
        {
            maxHealth          = cal.maxHealth;
            health             = cal.health;
            mana               = cal.mana;
            attack             = cal.attack;
            attackSpeed        = cal.attackSpeed;
            hit                = cal.hit;
            armor              = cal.armor;
            magicResist        = cal.magicResist;
            dodge              = cal.dodge;
            crit               = cal.crit;
            physicalHurtScaler = cal.physicalHurtScaler;
            magicalHurtScaler  = cal.magicalHurtScaler;
            critHurtScaler     = cal.critHurtScaler;

//			Debug.Log (dodge.ToString()+"--------");

//			allStatus.Clear ();
//
//			for (int i = 0; i < cal.triggeredSkills.Count; i++) {
//				string status = cal.triggeredSkills [i].statusName;
//				if (!allStatus.Contains (status)) {
//					allStatus.Add (status);
//				}
//			}
//
//			for (int i = 0; i < cal.consumablesSkills.Count; i++) {
//				string status = cal.consumablesSkills [i].statusName;
//				if (!allStatus.Contains (status)) {
//					allStatus.Add (status);
//				}
//			}
        }
        protected virtual void Awake()
        {
            boxCollider = GetComponent <BoxCollider2D> ();

            ListenerDelegate <EventObject> keyFrameListener = KeyFrameMessage;

            if (gameObject.tag == "monster")
            {
                armatureCom.AddEventListener(DragonBones.EventObject.FRAME_EVENT, keyFrameListener);
            }
            else if (gameObject.tag == "Player")
            {
                UnityArmatureComponent playerArmature = transform.Find("PlayerSide").GetComponent <UnityArmatureComponent> ();
                playerArmature.AddEventListener(DragonBones.EventObject.FRAME_EVENT, keyFrameListener);
            }

            isIdle = true;

            propertyCalculator = new AgentPropertyCalculator();
        }