Esempio n. 1
0
    /// <summary>
    /// 同期可能なplayerを作るメソッド
    /// </summary>
    public void CreatePlayerObject()
    {
        int     distance = nowPlayerType == PlayerType.Cat ? 29 : 5;
        Vector3 tempPos  = distance * ArgUtility.GetVector3ByPlayerId(playerId);

        tempPos.y += 4f;
        Vector3 playerPos = tempPos;

        playerObj = PhotonNetwork.Instantiate(PathMaster.PLAYER_PREFAB_ROOT + nowPlayerType.ToString(), playerPos, Quaternion.Euler(Vector3.zero), 0) as GameObject;
        Camera.main.transform.position = nowPlayerType == PlayerType.Cat ? playerPos + new Vector3(0f, 2f, -5f) : playerPos + new Vector3(0f, 1.5f, -4f);
        Camera.main.fieldOfView        = nowPlayerType == PlayerType.Cat ? 60f : 40f;;
    }
Esempio n. 2
0
 private void createPlayerObject()
 {
     countDownText.InitTimer();
     readyScreen.SetActive(false);
     if (PhotonManager.Instance.IsConnect)
     {
         PhotonManager.Instance.CreatePlayerObject();
     }
     else
     {
         playerPrefab = (GameObject)Resources.Load(PathMaster.PLAYER_PREFAB_ROOT + playerType.ToString());
         int     distance = playerType == PlayerType.Cat ? 29 : 5;
         Vector3 tempPos  = distance * ArgUtility.GetVector3ByPlayerId(0);
         tempPos.y += 4f;
         Vector3 playerPos = tempPos;
         //TODO: 生成位置変更
         GameObject.Instantiate(playerPrefab, playerPos, Quaternion.Euler(Vector3.zero));
         Camera.main.transform.position = playerType == PlayerType.Cat ? playerPos + new Vector3(0f, 2f, -5f) : playerPos + new Vector3(0f, 1.5f, -4f);
         Camera.main.fieldOfView        = playerType == PlayerType.Cat ? 60f : 40f;;
     }
 }