Esempio n. 1
0
        private void makeBomb(ePlayer owner)
        {
            //recursion
            GameObject  e  = GameObject.Instantiate(bombManagerPrefab, this.transform.position, Quaternion.LookRotation(Vector3.forward, Vector3.forward)) as GameObject;
            BombManager BM = e.GetComponent <BombManager>();

            if (BM != null)
            {
                BM.changeOwner(owner);
            }
        }
 // does ability
 public void ability1()
 {
     // reset the abiltyManabger if the user right clicks
     if (Input.GetMouseButton(1))
     {
         currentAbility = ability.none;
         return;
     }
     if (Input.GetMouseButton(0))
     {
         Vector3     mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
         GameObject  e        = Instantiate(bombManagerPrefab, new Vector3(mousePos.x, mousePos.y, 0), Quaternion.LookRotation(Vector3.forward, Vector3.forward)) as GameObject;
         BombManager BM       = e.GetComponent <BombManager> ();
         if (BM != null)
         {
             BM.changeOwner(bombOwner);
         }
         currentAbility = ability.none;
         gameManager.resetScore();
     }
 }