Exemplo n.º 1
0
        private void _UpdateTarget()
        {
            if (reflection == null)
            {
                reflection = PSReflectionFactory.GetReflection();
            }

            if (reflection == null)
            {
                return;
            }

            GameObject newTarget = reflection.GetRootObject();

            if (newTarget == null)
            {
                target = null;
                return;
            }

            if (newTarget != target)
            {
                if (!IsValidTarget(newTarget))
                {
                    target = null;
                    return;
                }
                target = newTarget;
                tabMuscle.SetTarget(target);
                tabOption.SetTarget(target);
                muscleHandle.SetTarget(target);
            }

            clip  = reflection.GetClip();
            time  = reflection.GetTime();
            frame = reflection.GetFrame();

            tabMuscle.SetClip(clip);
            tabMuscle.SetTimeFrame(time, frame);

            if (AnimationMode.InAnimationMode() && !onFocus)
            {
                tabMuscle.OnUpdateValue();
                //tabMuscle.ResampleAnimation();
            }
        }
Exemplo n.º 2
0
        /***********************************************
        *  GUI METHODS
        ***********************************************/

        void OnGUI()
        {
            if (reflection == null)
            {
                reflection = PSReflectionFactory.GetReflection();
            }

            if (target == null)
            {
                EditorGUILayout.HelpBox("No humanoid target found, please select humanoid gameobject in the hierarchy.", MessageType.None);
                if (GUILayout.Button("Refresh", EditorStyles.miniButton, GUILayout.Width(100)))
                {
                    reflection.Init();
                }
                return;
            }

            this.InfoGUI();

            EditorGUILayout.Space();
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Toggle(curTab == tabMuscle, "MUSCLE", EditorStyles.toolbarButton))
            {
                curTab = tabMuscle;
            }

            if (GUILayout.Toggle(curTab == tabOption, "OPTIONS", EditorStyles.toolbarButton))
            {
                curTab = tabOption;
            }
            EditorGUILayout.EndHorizontal();

            this.TabGUI();

            EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
            EditorGUILayout.LabelField(Version);
            EditorGUILayout.LabelField("Email: [email protected]", GUILayout.Width(190));
            EditorGUILayout.EndHorizontal();
        }