void Start() { _tankControls = GetComponent <TankControls>(); _defaultSpeed = _tankControls.Speed; _currentSpeed = _defaultSpeed; }
void EndTurn() { TankEntity currPlayer = playerTanks[currentPlayerIndex]; TankControls controls = currPlayer.GetComponent <TankControls>(); controls.EnableInput(false); IncreasePlayerIndex(); }
void BeginTurn() { TankEntity currPlayer = playerTanks[currentPlayerIndex]; TankControls controls = currPlayer.GetComponent <TankControls>(); controls.EnableInput(true); currPlayer.Select(); }
private void OnCollisionEnter2D(Collision2D collision) { TankControls other = collision.gameObject.GetComponent <TankControls>(); if (other) { Destroy(other.gameObject); } }
// Awake is called when the script instance is being loaded void Awake() { //setup controls controls = new TankControls(); controls.Gameplay.Move.performed += ctx => movementInput = ctx.ReadValue <Vector2>(); controls.Gameplay.Move.canceled += ctx => movementInput = Vector2.zero; controls.Gameplay.Aim.performed += ctx => aimInput = ctx.ReadValue <Vector2>(); controls.Gameplay.Aim.canceled += ctx => aimInput = Vector2.zero; //setup turret reference turret = transform.GetChild(1); }
public static void KillPlayer (TankControls player) { Destroy (player.gameObject); gm.StartCoroutine(gm.RespawnPlayer()); }
// Start is called before the first frame update void Start() { p1 = GameObject.FindGameObjectWithTag("P1").GetComponent <TankControls>(); p2 = GameObject.FindGameObjectWithTag("P2").GetComponent <TankControls>(); scoreBoard = GetComponent <Text>(); }
public static void KillPlayer (TankControls player) { }
public static void KillPlayer(TankControls player) { Destroy(player.gameObject); gm.StartCoroutine(gm.RespawnPlayer()); }
public static void KillPlayer(TankControls player) { }