コード例 #1
0
ファイル: CameraManager.cs プロジェクト: skiddmcmarx/4TONS
 public void joinPlayer(JoinPlayerInfo joinPlayerInfo)
 {
     print("cameraManager adding target");
     targets.Add(joinPlayerInfo.trans);
     targets.Add(joinPlayerInfo.trans.Find("cursorAnchor").GetChild(0).GetComponent <Transform>());
     active = true;
 }
コード例 #2
0
ファイル: GameEventManager.cs プロジェクト: skiddmcmarx/4TONS
 public void joinPlayerEvent(JoinPlayerInfo joinPlayerInfo)
 {
     if (joinPlayer != null)
     {
         joinPlayer(joinPlayerInfo);
     }
 }
コード例 #3
0
    public void createPlayer(int inputIndex)
    {
        print("create player.");
        JoinPlayerInfo joinPlayerInfo = new JoinPlayerInfo();

        joinPlayerInfo.inputIndex   = inputIndex;
        joinPlayerInfo.playerNumber = currentPlayerCount + 1;
        joinPlayerInfo.wizardPrefab = defaultWizard;
        GameObject wizardInstance;
        Vector3    spawnPoint = GameObject.Find("Player " + joinPlayerInfo.playerNumber + " spawnPoint").transform.position;

        if (inputEntities[inputIndex].wizardInstance == null)
        {
            wizardInstance = Instantiate(defaultWizard, spawnPoint, Quaternion.identity);
        }
        else
        {
            wizardInstance = inputEntities[inputIndex].wizardInstance;
        }

        if (joinPlayerInfo.playerNumber == 1)
        {
            leaderInputIndex = inputIndex;
            GameObject go = Instantiate(playerOneCrown, wizardInstance.transform.position, Quaternion.identity);
            go.transform.parent = wizardInstance.transform;
        }

        joinPlayerInfo.wizardPrefab = wizardInstance;
        joinPlayerInfo.trans        = wizardInstance.transform;
        //initializes player
        PlayerBehaviours playerBehaviours = wizardInstance.GetComponent <PlayerBehaviours>();

        playerBehaviours.joinPlayer(joinPlayerInfo);
        GameEventManager.instance.joinPlayerEvent(joinPlayerInfo);
    }
コード例 #4
0
ファイル: InputEntity.cs プロジェクト: skiddmcmarx/4TONS
 public void joinPlayer(JoinPlayerInfo joinPlayerInfo)
 {
     inputIndex = joinPlayerInfo.inputIndex;
     print("joining player input entity. index: " + inputIndex);
     playerNumber   = joinPlayerInfo.playerNumber;
     wizardInstance = joinPlayerInfo.wizardPrefab;
     isOccupied     = true;
 }
コード例 #5
0
    public void joinPlayer(JoinPlayerInfo joinPlayerInfo)
    {
        int inputIndex = joinPlayerInfo.inputIndex;

        currentPlayerCount += 1;
        inputEntities[joinPlayerInfo.inputIndex].joinPlayer(joinPlayerInfo);
        print("current player count: " + currentPlayerCount);
    }
コード例 #6
0
ファイル: PlayerBehaviours.cs プロジェクト: skiddmcmarx/4TONS
 public void joinPlayer(JoinPlayerInfo joinPlayerInfo)
 {
     this.inputIndex       = joinPlayerInfo.inputIndex;
     this.playerNumber     = joinPlayerInfo.playerNumber;
     this.tag              = "Player" + (playerNumber);
     this.gameObject.layer = playerNumber + 7;
     for (int i = 1; i < transform.childCount; i++)
     {
         transform.GetChild(i).gameObject.layer = 7 + playerNumber;
         transform.GetChild(i).gameObject.tag   = "Player" + (playerNumber);
     }
     playerEventController = GetComponent <PlayerEventController>();
     playerController      = GetComponent <PlayerController>();
     playerAnimations      = GetComponent <PlayerAnimations>();
     initializePlayerBehaviours();
 }
コード例 #7
0
ファイル: LevelManager.cs プロジェクト: skiddmcmarx/4TONS
 public void joinPlayer(JoinPlayerInfo joinPlayerInfo)
 {
 }