Example #1
0
        public static void OnPlayerSpawned(FPSCamera fpsCamera, PlayerAgent playerAgent)
        {
            if (!playerAgent.IsLocallyOwned)
            {
                Log.Error("Got playerAgent spawn but we aren't the owner!?");
            }
            Log.Info("Player and fpscamera have been spawned, references have been set...");
            m_currentFPSCameraRef   = fpsCamera;
            m_currentPlayerAgentRef = playerAgent;

            // Normally we add VR components after the player has been spawned
            // If a player rejoins he is destroyed in the elevator and respawned, so we need to check if this happens and add VR components if needed
            if (FocusStateEvents.IsInGame())
            {
                Log.Debug("Player spawned while an in-game state was active");
                Current.HandleIngameFocus();
            }
        }
 static void Prefix(eFocusState state)
 {
     FocusStateEvents.FocusChanged(state);
 }