protected override void Deactivate() { StopAllCoroutines(); base.Deactivate(); if (GameCamera.Instance) { GameCamera.ChangeMode(GameCamera.E_State.Spectator_Free); } if (OnDeactivated != null) { OnDeactivated(this); } }
protected override void Activate() { base.Activate(); Controls.SwitchToCombatMode(); Client.Instance.PlaySoundPlayerSpawn(); GameCamera.ChangeMode(GameCamera.E_State.Player); if (OnActivated != null) { OnActivated(this); } /* GuiHUD.Instance.ShowCombatText(Client.E_MessageType.Kill, "100Exp/50$"); * GuiHUD.Instance.ShowCombatText(Client.E_MessageType.HeadShot, "+50Exp/25$"); * GuiHUD.Instance.ShowCombatText(Client.E_MessageType.Rank, "100 Exp/5000$"); * GuiHUD.Instance.ShowCombatText(Client.E_MessageType.ExclusiveKill, string.Format(TextDatabase.instance[00502077], 1)); * * GuiHUD.Instance.ShowCombatText(Client.E_MessageType.KillAssist, "50 Exp"); * GuiHUD.Instance.ShowCombatText(Client.E_MessageType.Turret, "50 Exp"); * GuiHUD.Instance.ShowCombatText(Client.E_MessageType.ZoneDefended, "50 Exp"); * GuiHUD.Instance.ShowCombatText(Client.E_MessageType.ZoneAttacked, "50 Exp"); * GuiHUD.Instance.ShowCombatText(Client.E_MessageType.ZoneNeutral, "50 Exp"); * GuiHUD.Instance.ShowCombatText(Client.E_MessageType.ZoneControl, "50 Exp"); * * GuiHUD.Instance.ShowCombatText(Client.E_MessageType.Win, "50 Exp"); * GuiHUD.Instance.ShowCombatText(Client.E_MessageType.Lost, "50 Exp"); * * GuiHUD.Instance.ShowCombatText(Client.E_MessageType.Unlock, "50 Exp"); * * GuiHUD.Instance.ShowCombatText(Client.E_MessageType.Spider, "50 Exp");*/ StopAllCoroutines(); #if UNITY_STANDALONE StartCoroutine(ClientTimeCheck()); #endif }
void OnFollowPlayer(GUIBase_Widget inWidget) { GameCamera.ChangeMode(FollowingPlayer ? GameCamera.E_State.Spectator_Free : GameCamera.E_State.Spectator_FollowPlayer); UpdateControlsVisibility(); }
void UpdateCamera() { if (State == E_State.Spectator_Free) { // disable camera effects BloodManagerSetNormalizedHealth(); return; } if (State == E_State.Spectator_FollowPlayer) { if (SpectatorCamera.Spectator_CanFollowPlayer()) { if (null == CameraBehaviour) { AgentHuman Owner = SpectatorCamera.SelectNextAgentToFollow(); if (null != Owner) { CameraBehaviour = Owner.GetComponent <CameraBehaviour>(); IgnoredCollider = Owner.CharacterController; if (CameraBehaviour) { Transform desiredTransform = CameraBehaviour.GetDesiredCameraTransform(); if (desiredTransform) { PrevDist = (desiredTransform.position - CameraBehaviour.CameraOrigin.position).magnitude; } } } } else { // already watching one if (!SpectatorCamera.UpdateFollowPlayer()) { GameCamera.ChangeMode(GameCamera.E_State.Spectator_FollowPlayer); } } } else { ChangeStateInternal(E_State.Spectator_Free); } } if (DisabledTime >= Time.timeSinceLevelLoad) { return; } if (Time.deltaTime == 0 || !CameraBehaviour) { return; } //Collide camera // CollideCamera(); CollideCamera5(); }