Exemplo n.º 1
0
    private void Start()
    {
        if (GameObject.FindWithTag("Enemy"))
        {
            GameObject enemy = GameObject.FindWithTag("Enemy");
            Debug.Log(enemy.name);
            //find out which enemy it is...set methods according to spefic model
            if (enemy.name == "Skeleton")
            {
                attackMethod = SkeletonAttackButtonAction; //test in Button Handler by calling the variable
                strikeMethod = SkeletonStrikeButtonAction;
                chargeMethod = SkeletonChargeButtonAction;
                atkMagMethod = SkeletonAtkMagicButtonAction;

                //Defense
                defenseMethod = SkeletonDefendButtonAction;
                counterMethod = SkeletonCounterButtonAction;
                giveUpMethod  = SkeletonGiveUpButtonAction;
                defMagMethod  = SkeletonDefMagicButtonAction;
            }
        }
    }
Exemplo n.º 2
0
 private void Start()
 {
     if (GameObject.FindWithTag("Player"))
     {
         GameObject enemy = GameObject.FindWithTag("Player");
         Debug.Log(enemy.name);
         //find out which enemy it is...set methods according to spefic model
         if (enemy.name == "ToonKnight")
         {
             //Offsense
             attackMethod = ToonAttackButtonAction; //test in Button Handler by calling the variable
             strikeMethod = ToonStrikeButtonAction;
             chargeMethod = ToonChargeButtonAction;
             atkMagMethod = ToonAtkMagicButtonAction;
             //Defense
             defenseMethod = ToonDefendButtonAction;
             counterMethod = ToonCounterButtonAction;
             giveUpMethod  = ToonGiveUpButtonAction;
             defMagMethod  = ToonDefMagicButtonAction;
         }
         //else if(enemy.name  == "other"){   set different/ same methods depending on class}
     }
 }