示例#1
0
    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();
        }
示例#4
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        TankControls other = collision.gameObject.GetComponent <TankControls>();

        if (other)
        {
            Destroy(other.gameObject);
        }
    }
示例#5
0
    // 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);
    }
示例#6
0
	public static void KillPlayer (TankControls player) {
		Destroy (player.gameObject);
        
		gm.StartCoroutine(gm.RespawnPlayer());
	}
示例#7
0
 // 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>();
 }
示例#8
0
	public static void KillPlayer (TankControls player) {
		
	}
示例#9
0
    public static void KillPlayer(TankControls player)
    {
        Destroy(player.gameObject);

        gm.StartCoroutine(gm.RespawnPlayer());
    }
示例#10
0
 public static void KillPlayer(TankControls player)
 {
 }