コード例 #1
0
    // Token: 0x06003E5F RID: 15967 RVA: 0x00139E90 File Offset: 0x00138290
    public void SetLayerSynchronized(int layerIndex, PhotonAnimatorView.SynchronizeType synchronizeType)
    {
        if (Application.isPlaying)
        {
            this.m_WasSynchronizeTypeChanged = true;
        }
        int num = this.m_SynchronizeLayers.FindIndex((PhotonAnimatorView.SynchronizedLayer item) => item.LayerIndex == layerIndex);

        if (num == -1)
        {
            this.m_SynchronizeLayers.Add(new PhotonAnimatorView.SynchronizedLayer
            {
                LayerIndex      = layerIndex,
                SynchronizeType = synchronizeType
            });
        }
        else
        {
            this.m_SynchronizeLayers[num].SynchronizeType = synchronizeType;
        }
    }
コード例 #2
0
    public void SetLayerSynchronized(int layerIndex, PhotonAnimatorView.SynchronizeType synchronizeType)
    {
        if (Application.get_isPlaying())
        {
            this.m_WasSynchronizeTypeChanged = true;
        }
        int index = this.m_SynchronizeLayers.FindIndex((Predicate <PhotonAnimatorView.SynchronizedLayer>)(item => item.LayerIndex == layerIndex));

        if (index == -1)
        {
            this.m_SynchronizeLayers.Add(new PhotonAnimatorView.SynchronizedLayer()
            {
                LayerIndex      = layerIndex,
                SynchronizeType = synchronizeType
            });
        }
        else
        {
            this.m_SynchronizeLayers[index].SynchronizeType = synchronizeType;
        }
    }
コード例 #3
0
    private void DrawParameterInspector()
    {
        // flag to expose a note in Interface if one or more trigger(s) are synchronized
        bool isUsingTriggers = false;

        SerializedProperty foldoutProperty = serializedObject.FindProperty("ShowParameterInspector");

        foldoutProperty.boolValue = PhotonGUI.ContainerHeaderFoldout("Synchronize Parameters", foldoutProperty.boolValue);

        if (foldoutProperty.boolValue == false)
        {
            return;
        }

        float lineHeight    = 20;
        Rect  containerRect = PhotonGUI.ContainerBody(GetParameterCount() * lineHeight);

        for (int i = 0; i < GetParameterCount(); i++)
        {
            AnimatorControllerParameter parameter = null;
            parameter = GetAnimatorControllerParameter(i);

            string defaultValue = "";

            if (parameter.type == AnimatorControllerParameterType.Bool)
            {
                if (Application.isPlaying && m_Animator.gameObject.activeInHierarchy)
                {
                    defaultValue += m_Animator.GetBool(parameter.name);
                }
                else
                {
                    defaultValue += parameter.defaultBool.ToString();
                }
            }
            else if (parameter.type == AnimatorControllerParameterType.Float)
            {
                if (Application.isPlaying && m_Animator.gameObject.activeInHierarchy)
                {
                    defaultValue += m_Animator.GetFloat(parameter.name).ToString("0.00");
                }
                else
                {
                    defaultValue += parameter.defaultFloat.ToString();
                }
            }
            else if (parameter.type == AnimatorControllerParameterType.Int)
            {
                if (Application.isPlaying && m_Animator.gameObject.activeInHierarchy)
                {
                    defaultValue += m_Animator.GetInteger(parameter.name);
                }
                else
                {
                    defaultValue += parameter.defaultInt.ToString();
                }
            }
            else if (parameter.type == AnimatorControllerParameterType.Trigger)
            {
                if (Application.isPlaying && m_Animator.gameObject.activeInHierarchy)
                {
                    defaultValue += m_Animator.GetBool(parameter.name);
                }
                else
                {
                    defaultValue += parameter.defaultBool.ToString();
                }
            }

            if (this.m_Target.DoesParameterSynchronizeTypeExist(parameter.name) == false)
            {
                this.m_Target.SetParameterSynchronized(parameter.name, (PhotonAnimatorView.ParameterType)parameter.type, PhotonAnimatorView.SynchronizeType.Disabled);

                                #if !UNITY_MIN_5_3
                EditorUtility.SetDirty(this.m_Target);
                                #endif
            }

            PhotonAnimatorView.SynchronizeType value = this.m_Target.GetParameterSynchronizeType(parameter.name);

            // check if using trigger and actually synchronizing it
            if (value != PhotonAnimatorView.SynchronizeType.Disabled && parameter.type == AnimatorControllerParameterType.Trigger)
            {
                isUsingTriggers = true;
            }

            Rect elementRect = new Rect(containerRect.xMin, containerRect.yMin + i * lineHeight, containerRect.width, lineHeight);

            Rect labelRect = new Rect(elementRect.xMin + 5, elementRect.yMin + 2, EditorGUIUtility.labelWidth - 5, elementRect.height);
            GUI.Label(labelRect, parameter.name + " (" + defaultValue + ")");

            Rect popupRect = new Rect(elementRect.xMin + EditorGUIUtility.labelWidth, elementRect.yMin + 2, elementRect.width - EditorGUIUtility.labelWidth - 5, EditorGUIUtility.singleLineHeight);
            value = (PhotonAnimatorView.SynchronizeType)EditorGUI.EnumPopup(popupRect, value);

            if (i < GetParameterCount() - 1)
            {
                Rect splitterRect = new Rect(elementRect.xMin + 2, elementRect.yMax, elementRect.width - 4, 1);
                PhotonGUI.DrawSplitter(splitterRect);
            }



            if (value != this.m_Target.GetParameterSynchronizeType(parameter.name))
            {
                Undo.RecordObject(target, "Modify Synchronize Parameter " + parameter.name);
                this.m_Target.SetParameterSynchronized(parameter.name, (PhotonAnimatorView.ParameterType)parameter.type, value);

                                #if !UNITY_MIN_5_3
                EditorUtility.SetDirty(this.m_Target);
                                #endif
            }
        }

        // display note when synchronized triggers are detected.
        if (isUsingTriggers)
        {
            GUILayout.BeginHorizontal(GUI.skin.box);
            GUILayout.Label("When using triggers, make sure this component is last in the stack");
            if (GUILayout.Button(PhotonGUI.HelpIcon, GUIStyle.none, GUILayout.Width(16)))
            {
                Application.OpenURL(TRIGGER_HELP_URL);
            }
            GUILayout.EndHorizontal();
        }
    }
コード例 #4
0
    public void SetParameterSynchronized(string name, PhotonAnimatorView.ParameterType type, PhotonAnimatorView.SynchronizeType synchronizeType)
    {
        if (Application.isPlaying)
        {
            this.m_WasSynchronizeTypeChanged = true;
        }
        int num = this.m_SynchronizeParameters.FindIndex((PhotonAnimatorView.SynchronizedParameter item) => item.Name == name);

        if (num == -1)
        {
            this.m_SynchronizeParameters.Add(new PhotonAnimatorView.SynchronizedParameter
            {
                Name            = name,
                Type            = type,
                SynchronizeType = synchronizeType
            });
        }
        else
        {
            this.m_SynchronizeParameters.get_Item(num).SynchronizeType = synchronizeType;
        }
    }
コード例 #5
0
    private void DrawParameterInspector()
    {
        SerializedProperty foldoutProperty = serializedObject.FindProperty("ShowParameterInspector");

        foldoutProperty.boolValue = PhotonGUI.ContainerHeaderFoldout("Synchronize Parameters", foldoutProperty.boolValue);

        if (foldoutProperty.boolValue == false)
        {
            return;
        }

        float lineHeight    = 20;
        Rect  containerRect = PhotonGUI.ContainerBody(GetParameterCount() * lineHeight);

        for (int i = 0; i < GetParameterCount(); i++)
        {
            AnimatorControllerParameter parameter = null;
            parameter = GetAnimatorControllerParameter(i);

            string defaultValue = "";

            if (parameter.type == AnimatorControllerParameterType.Bool)
            {
                defaultValue += parameter.defaultBool.ToString();
            }
            else if (parameter.type == AnimatorControllerParameterType.Float)
            {
                defaultValue += parameter.defaultFloat.ToString();
            }
            else if (parameter.type == AnimatorControllerParameterType.Int)
            {
                defaultValue += parameter.defaultInt.ToString();
            }

            if (this.m_Target.DoesParameterSynchronizeTypeExist(parameter.name) == false)
            {
                this.m_Target.SetParameterSynchronized(parameter.name, (PhotonAnimatorView.ParameterType)parameter.type, PhotonAnimatorView.SynchronizeType.Disabled);
                EditorUtility.SetDirty(this.m_Target);
            }

            PhotonAnimatorView.SynchronizeType value = this.m_Target.GetParameterSynchronizeType(parameter.name);

            Rect elementRect = new Rect(containerRect.xMin, containerRect.yMin + i * lineHeight, containerRect.width, lineHeight);

            Rect labelRect = new Rect(elementRect.xMin + 5, elementRect.yMin + 2, EditorGUIUtility.labelWidth - 5, elementRect.height);
            GUI.Label(labelRect, parameter.name + " (" + defaultValue + ")");

            Rect popupRect = new Rect(elementRect.xMin + EditorGUIUtility.labelWidth, elementRect.yMin + 2, elementRect.width - EditorGUIUtility.labelWidth - 5, EditorGUIUtility.singleLineHeight);
            value = (PhotonAnimatorView.SynchronizeType)EditorGUI.EnumPopup(popupRect, value);

            if (i < GetParameterCount() - 1)
            {
                Rect splitterRect = new Rect(elementRect.xMin + 2, elementRect.yMax, elementRect.width - 4, 1);
                PhotonGUI.DrawSplitter(splitterRect);
            }

            if (value != this.m_Target.GetParameterSynchronizeType(parameter.name))
            {
                Undo.RecordObject(target, "Modify Synchronize Parameter " + parameter.name);
                this.m_Target.SetParameterSynchronized(parameter.name, (PhotonAnimatorView.ParameterType)parameter.type, value);

                EditorUtility.SetDirty(this.m_Target);
            }
        }
    }
コード例 #6
0
        private void DrawParameterInspector()
        {
            // flag to expose a note in Interface if one or more trigger(s) are synchronized
            bool isUsingTriggers = false;

            SerializedProperty foldoutProperty = this.serializedObject.FindProperty("ShowParameterInspector");

            foldoutProperty.boolValue = PhotonGUI.ContainerHeaderFoldout("Synchronize Parameters", foldoutProperty.boolValue);

            if (foldoutProperty.boolValue == false)
            {
                return;
            }

            float lineHeight    = 20;
            Rect  containerRect = PhotonGUI.ContainerBody(this.GetParameterCount() * lineHeight);

            for (int i = 0; i < this.GetParameterCount(); i++)
            {
                AnimatorControllerParameter parameter = null;
                parameter = this.GetAnimatorControllerParameter(i);

                string defaultValue = "";

                if (parameter.type == AnimatorControllerParameterType.Bool)
                {
                    if (Application.isPlaying && this.m_Animator.gameObject.activeInHierarchy)
                    {
                        defaultValue += this.m_Animator.GetBool(parameter.name);
                    }
                    else
                    {
                        defaultValue += parameter.defaultBool.ToString();
                    }
                }
                else if (parameter.type == AnimatorControllerParameterType.Float)
                {
                    if (Application.isPlaying && this.m_Animator.gameObject.activeInHierarchy)
                    {
                        defaultValue += this.m_Animator.GetFloat(parameter.name).ToString("0.00");
                    }
                    else
                    {
                        defaultValue += parameter.defaultFloat.ToString();
                    }
                }
                else if (parameter.type == AnimatorControllerParameterType.Int)
                {
                    if (Application.isPlaying && this.m_Animator.gameObject.activeInHierarchy)
                    {
                        defaultValue += this.m_Animator.GetInteger(parameter.name);
                    }
                    else
                    {
                        defaultValue += parameter.defaultInt.ToString();
                    }
                }
                else if (parameter.type == AnimatorControllerParameterType.Trigger)
                {
                    if (Application.isPlaying && this.m_Animator.gameObject.activeInHierarchy)
                    {
                        defaultValue += this.m_Animator.GetBool(parameter.name);
                    }
                    else
                    {
                        defaultValue += parameter.defaultBool.ToString();
                    }
                }

                if (this.m_Target.DoesParameterSynchronizeTypeExist(parameter.name) == false)
                {
                    this.m_Target.SetParameterSynchronized(parameter.name, (PhotonAnimatorView.ParameterType)parameter.type, PhotonAnimatorView.SynchronizeType.Disabled);
                }

                PhotonAnimatorView.SynchronizeType value = this.m_Target.GetParameterSynchronizeType(parameter.name);

                // check if using trigger and actually synchronizing it
                if (value != PhotonAnimatorView.SynchronizeType.Disabled && parameter.type == AnimatorControllerParameterType.Trigger)
                {
                    isUsingTriggers = true;
                }

                Rect elementRect = new Rect(containerRect.xMin, containerRect.yMin + i * lineHeight, containerRect.width, lineHeight);

                Rect labelRect = new Rect(elementRect.xMin + 5, elementRect.yMin + 2, EditorGUIUtility.labelWidth - 5, elementRect.height);
                GUI.Label(labelRect, parameter.name + " (" + defaultValue + ")");

                Rect popupRect = new Rect(elementRect.xMin + EditorGUIUtility.labelWidth, elementRect.yMin + 2, elementRect.width - EditorGUIUtility.labelWidth - 5, EditorGUIUtility.singleLineHeight);
                value = (PhotonAnimatorView.SynchronizeType)EditorGUI.EnumPopup(popupRect, value);

                if (i < this.GetParameterCount() - 1)
                {
                    Rect splitterRect = new Rect(elementRect.xMin + 2, elementRect.yMax, elementRect.width - 4, 1);
                    PhotonGUI.DrawSplitter(splitterRect);
                }

                if (value != this.m_Target.GetParameterSynchronizeType(parameter.name))
                {
                    Undo.RecordObject(this.target, "Modify Synchronize Parameter " + parameter.name);
                    this.m_Target.SetParameterSynchronized(parameter.name, (PhotonAnimatorView.ParameterType)parameter.type, value);
                }
            }

            // display note when synchronized triggers are detected.
            if (isUsingTriggers)
            {
                EditorGUILayout.HelpBox("When using triggers, make sure this component is last in the stack. " +
                                        "If you still experience issues, implement triggers as a regular RPC " +
                                        "or in custom IPunObservable component instead.", MessageType.Warning);
            }
        }
コード例 #7
0
 public void SetParameterSynchronized(string name, PhotonAnimatorView.ParameterType type, PhotonAnimatorView.SynchronizeType synchronizeType)
 {
 }
コード例 #8
0
 public void SetLayerSynchronized(int layerIndex, PhotonAnimatorView.SynchronizeType synchronizeType)
 {
 }
コード例 #9
0
    public void SetParameterSynchronized(string name, PhotonAnimatorView.ParameterType type, PhotonAnimatorView.SynchronizeType synchronizeType)
    {
        if (Application.get_isPlaying())
        {
            this.m_WasSynchronizeTypeChanged = true;
        }
        int index = this.m_SynchronizeParameters.FindIndex((Predicate <PhotonAnimatorView.SynchronizedParameter>)(item => item.Name == name));

        if (index == -1)
        {
            this.m_SynchronizeParameters.Add(new PhotonAnimatorView.SynchronizedParameter()
            {
                Name            = name,
                Type            = type,
                SynchronizeType = synchronizeType
            });
        }
        else
        {
            this.m_SynchronizeParameters[index].SynchronizeType = synchronizeType;
        }
    }