Advertisement
Guest User

aasada

a guest
Feb 20th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.18 KB | None | 0 0
  1. public class ControladorCañones : MonoBehaviour
  2. {
  3.     public GameObject CanionDer1;
  4.     public GameObject CanionDer2;
  5.     public GameObject CanionIzq1;
  6.     public GameObject CanionIzq2;
  7.  
  8.     //private ArrayList seleccionadas;
  9.     // Start is called before the first frame update
  10.     void Start()
  11.     {
  12.        
  13.     }
  14.  
  15.     // Update is called once per frame
  16.     void Update()
  17.     {
  18.  
  19.  
  20.         if (Input.GetKey(KeyCode.LeftArrow))
  21.         {
  22.             Seleccionar(CanionIzq1);
  23.             Seleccionar(CanionIzq2);
  24.  
  25.             if (Input.GetKey(KeyCode.Keypad2))
  26.             {
  27.                 Deseleccionar(CanionIzq2);
  28.             }
  29.         }
  30.  
  31.         if (Input.GetKey(KeyCode.RightArrow))
  32.         {
  33.             Seleccionar(CanionDer1);
  34.             Seleccionar(CanionDer2);
  35.  
  36.             if (Input.GetKey(KeyCode.Keypad2))
  37.             {
  38.                 Deseleccionar(CanionDer2);
  39.             }
  40.         }
  41.     }
  42.  
  43.     void Seleccionar(GameObject Canion)
  44.     {
  45.         //Canion = seleccionadas[];
  46.         //activate game object
  47.     }
  48.  
  49.     void Deseleccionar(GameObject Canion)
  50.     {
  51.         //seleccionadas[i] = null;
  52.  
  53.         //deactivate game object
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement