Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ControladorCañones : MonoBehaviour
- {
- public GameObject CanionDer1;
- public GameObject CanionDer2;
- public GameObject CanionIzq1;
- public GameObject CanionIzq2;
- //private ArrayList seleccionadas;
- // Start is called before the first frame update
- void Start()
- {
- }
- // Update is called once per frame
- void Update()
- {
- if (Input.GetKey(KeyCode.LeftArrow))
- {
- Seleccionar(CanionIzq1);
- Seleccionar(CanionIzq2);
- if (Input.GetKey(KeyCode.Keypad2))
- {
- Deseleccionar(CanionIzq2);
- }
- }
- if (Input.GetKey(KeyCode.RightArrow))
- {
- Seleccionar(CanionDer1);
- Seleccionar(CanionDer2);
- if (Input.GetKey(KeyCode.Keypad2))
- {
- Deseleccionar(CanionDer2);
- }
- }
- }
- void Seleccionar(GameObject Canion)
- {
- //Canion = seleccionadas[];
- //activate game object
- }
- void Deseleccionar(GameObject Canion)
- {
- //seleccionadas[i] = null;
- //deactivate game object
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement