Ejemplo n.º 1
0
 /// <summary>
 /// Spawns the minion in the provided position
 /// </summary>
 /// <param name="_pTransform"></param>
 public void Spawn(Transform _pTransform, GameManager.Lane _pLane)
 {
     transform.position = _pTransform.position;
     transform.rotation = _pTransform.rotation;
     lane    = _pLane;
     health  = _maxHealth - ((tag == "PlayerTeam")? 1f : 0f);
     isAlive = true;
     gameObject.SetActive(true);
     _renderer.sharedMaterial = (tag == "PlayerTeam") ? _friendly : _enemy;
     //  TODO:   Play some animation
     _agent.enabled    = true;
     _body.isKinematic = true;
     Direct(GameManager.instance.NextTower(tag, lane).GetGameObject().transform.position);
 }
Ejemplo n.º 2
0
    private void MoveRight()
    {
        switch (targetLane)
        {
        case GameManager.Lane.LEFT:
            targetLane = GameManager.Lane.MIDDLE;
            break;

        case GameManager.Lane.MIDDLE:
            targetLane = GameManager.Lane.RIGHT;
            break;

        case GameManager.Lane.RIGHT:                 //Player is already on the right lane
            break;
        }
    }
Ejemplo n.º 3
0
 /// <summary>
 /// Spawns the player bot in the provided position
 /// </summary>
 /// <param name="_pTransform"></param>
 public void Spawn(Transform _pTransform, GameManager.Lane _pLane)
 {
     _agent.enabled     = false;
     transform.position = _pTransform.position;
     transform.rotation = _pTransform.rotation;
     health             = _maxHealth;
     isAlive            = true;
     gameObject.SetActive(true);
     //  TODO:   Play some animation
     _agent.enabled = true;
     _leftTrack     = KeyCode.Q;
     _rightTrack    = KeyCode.P;
     _reverse       = KeyCode.W;
     _shoot         = KeyCode.O;
     _leftTrackImage.rectTransform.anchoredPosition  = _keyImagePos[_leftTrack];
     _reverseImage.rectTransform.anchoredPosition    = _keyImagePos[_reverse];
     _shootImage.rectTransform.anchoredPosition      = _keyImagePos[_shoot];
     _rightTrackImage.rectTransform.anchoredPosition = _keyImagePos[_rightTrack];
 }
Ejemplo n.º 4
0
 private void Awake()
 {
     _anim      = GetComponent <Animator>();
     targetLane = GameManager.Lane.MIDDLE;
 }