Beispiel #1
0
        protected override void OnTriggerEnter(Collider col)
        {
            base.OnTriggerEnter(col);

            if (col.gameObject.tag == GameTags.WarriorsTags.SwordsMan.ToString())
            {
                SwordsMan.getInstance().transform.position = new Vector3(this.transform.position.x, 0.0f, transform.position.z);

                SwordsMan.getInstance().attackForce += this.forceAttack;
                SwordsMan.getInstance().RotateTowards(this.nextDestination);
                SpearManAnimationStates.getInstance().NoTranslation();

                Destroy(this.gameObject);
            }
        }
Beispiel #2
0
        public override void GotDamage(int attackForce)
        {
            base.GotDamage(attackForce);

            SpearMan.getInstance().energy -= attackForce;

            if (SpearMan.getInstance().energy <= 0)
            {
                SpearManAnimationStates.getInstance().NoEnergy();

                SpearMan.getInstance().status = WarriorStatus.Dead;

                Destroy(SpearMan.getInstance().GetComponent <BoxCollider>());

                GameplayManager.getInstance().Go();
            }
        }