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; }
public void joinPlayerEvent(JoinPlayerInfo joinPlayerInfo) { if (joinPlayer != null) { joinPlayer(joinPlayerInfo); } }
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); }
public void joinPlayer(JoinPlayerInfo joinPlayerInfo) { inputIndex = joinPlayerInfo.inputIndex; print("joining player input entity. index: " + inputIndex); playerNumber = joinPlayerInfo.playerNumber; wizardInstance = joinPlayerInfo.wizardPrefab; isOccupied = true; }
public void joinPlayer(JoinPlayerInfo joinPlayerInfo) { int inputIndex = joinPlayerInfo.inputIndex; currentPlayerCount += 1; inputEntities[joinPlayerInfo.inputIndex].joinPlayer(joinPlayerInfo); print("current player count: " + currentPlayerCount); }
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(); }
public void joinPlayer(JoinPlayerInfo joinPlayerInfo) { }