Exemplo n.º 1
0
 private void InitCameraLocation()
 {
     _prevColor = GameManager.Instance.WhosTurn;
     _prevTurn  = GameManager.Instance.WhosTurn == GameManager.Instance.PlayerOneColor ? false : true;
     if (GameManager.Instance.IsSingleplayer)
     {
         _z  = _prevTurn ? _z : -_z;
         _zz = _prevTurn ? _zz : -_zz;
     }
     else
     {
         _multiplayer = true;
     }
 }
Exemplo n.º 2
0
    protected void Update()
    {
        if (GameManager.Instance.IsSingleplayer)
        {
            if (_prevColor != GameManager.Instance.WhosTurn)
            {
                _prevTurn  = !_prevTurn;
                _prevColor = GameManager.Instance.WhosTurn;
                _z         = -_z;
                _zz        = -_zz;
            }
        }
        else
        {
            if (_multiplayer)
            {
                if (GameManager.Instance.GameStarted)
                {
                    foreach (var player in GameManager.Instance._playersDictionary)
                    {
                        if (player.Key == GameManager.Instance.UserId && player.Value == GameManager.Instance.PlayerTwoColor)
                        {
                            _z  = -_z;
                            _zz = -_zz;
                        }
                    }
                }
                _multiplayer = false;
            }
        }

        if (GUI.menuInstance.attackRoutine)
        {
            transform.LookAt(target.position);
        }

        else
        {
            transform.position = target.position + new Vector3(_x, _y, _z);
            //transform.position = Vector3.Lerp(prevPos, target.position + new Vector3(_x, _y, _z), _lerp);
            transform.LookAt(LookHere());
            _prevPos = transform.position;
        }
    }