Beispiel #1
0
    /// <summary>
    /// unfreezes and restores a frozen player to the position
    /// it had before getting frozen
    /// </summary>
    public void UnFreezePlayer()
    {
        Controller.transform.position = m_UnFreezePosition;
        m_UnFreezePosition            = Vector3.zero;

        Controller.SetState("Freeze", false);
        Camera.SetState("Freeze", false);
        Input.SetState("Freeze", false);
        Input.Refresh();
    }
Beispiel #2
0
    /// <summary>
    ///
    /// </summary>
    public override void OnInspectorGUI()
    {
        if (Application.isPlaying || m_Component.DefaultState.TextAsset == null)
        {
            DoMouseLookFoldout();
            DoMouseCursorFoldout();
        }
        else
        {
            vp_PresetEditorGUIUtility.DefaultStateOverrideMessage();
        }

        // state foldout
        m_StateFoldout = vp_PresetEditorGUIUtility.StateFoldout(m_StateFoldout, m_Component, m_Component.States, m_Persister);

        // preset foldout
        m_PresetFoldout = vp_PresetEditorGUIUtility.PresetFoldout(m_PresetFoldout, m_Component);

        // update default state and persist in order not to loose inspector tweaks
        // due to state switches during runtime - UNLESS a runtime state button has
        // been pressed (in which case user wants to toggle states as opposed to
        // reset / alter them)
        if (GUI.changed &&
            (!vp_PresetEditorGUIUtility.RunTimeStateButtonTarget == m_Component))
        {
            EditorUtility.SetDirty(target);

            if (Application.isPlaying)
            {
                m_Component.RefreshDefaultState();
            }

            if (m_Component.Persist)
            {
                m_Persister.Persist();
            }

            m_Component.Refresh();
        }
    }