Ejemplo n.º 1
0
 void GotInput(Inputs element)
 {
     this.elements.Add(element);
     if (this.elements.Contains(Inputs.ATTACK))
     {
         AttackTypes type = this.GetAttackType();
         ComputerInput.SendToAll <AttackTypes>("DoAttack", type);
         this.elements = new HashSet <Inputs>();
     }
 }
Ejemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Q))
     {
         ComputerInput.SendToAll<Inputs>("GotInput", Inputs.FIRE);
     }
     else if (Input.GetKeyDown(KeyCode.W))
     {
         ComputerInput.SendToAll<Inputs>("GotInput", Inputs.EARTH);
     }
     else if(Input.GetKeyDown(KeyCode.E))
     {
         ComputerInput.SendToAll<Inputs>("GotInput", Inputs.LIGHTNING);
     }
     else if (Input.GetKeyDown(KeyCode.R))
     {
         ComputerInput.SendToAll<Inputs>("GotInput", Inputs.WATER);
     }
     else if(Input.GetKeyDown(KeyCode.Space))
     {
         ComputerInput.SendToAll<Inputs>("GotInput", Inputs.ATTACK);
     }
 }