/// <summary> /// Starts the boss animation for the local player. /// </summary> public void StartBossAnimation(BossSpawnMessage bossSpawnMessage) { if (!Player.LocalPlayer || Player.LocalPlayer.isServer) { return; } BossEnterAnimation bea = BossEnterAnimation.AddAnimationType(gameObject, bossSpawnMessage.animationType); enterAnimationCoroutine = new ExtendedCoroutine(this, bea.PlayAnimation(bossSpawnMessage.bossGameObjects[0], this), Player.LocalPlayer.StateCommunicator.CmdBossAnimationFinished, true); }
public void OnAllPlayersReadyToEnter(BossReadyZone bossReadyZone) { CurrentState = State.InProgress; GameObject[] objs = SpawnBoss(); CloseDoors(); PlayersStartPos = (bossReadyZone.OnDoor.transform.position - bossReadyZone.transform.position) * 2 + bossReadyZone.transform.position; BossSpawnMessage bossSpawnMessage = new BossSpawnMessage { bossGameObjects = objs, id = id, animationType = bossObjects[0].AnimationType }; SpawnedEnemies = new Enemy[objs.Length]; for (int i = 0; i < objs.Length; i++) { SpawnedEnemies[i] = objs[i].GetComponent <Enemy>(); } NetworkServer.SendToAll(bossSpawnMessage); // Make all players not being able to move. List <Player> players = PlayersDict.Instance.Players; for (int i = 0; i < players.Count; i++) { players[i].RpcChangeCanMove(false); } // Start the boss animations. enterAnimation = BossEnterAnimation.AddAnimationType(gameObject, bossObjects[0].AnimationType); enterAnimationCoroutine = new ExtendedCoroutine(this, enterAnimation.PlayAnimation(objs[0], this), StartCheckingForAllPlayersWatchedEnterAnimation, true); GameManager.OnRoomEventStarted(); }