Ejemplo n.º 1
0
    private void UpdateValue()
    {
        if (reflection == null)
        {
            reflection = PSReflectionFactory.GetInstance().GetReflection();
        }

        if (reflection == null)
        {
            return;
        }

        GameObject newTarget = reflection.GetRootObject();

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

        if (newTarget != target)
        {
            target = newTarget;
            tabMuscle.SetTarget(target);
            muscleHandle.SetTarget(target);

            PSLogger.Log("New 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();
        }
    }
Ejemplo n.º 2
0
    /***********************************************
    *  GUI METHODS
    ***********************************************/

    void OnGUI()
    {
        //Debug.Log ("OnGUI:"+Event.current.type);

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

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

        this.InfoGUI();
        EditorGUILayout.Space();
        this.TabGUI();
    }
Ejemplo n.º 3
0
    /***********************************************
    *  GUI METHODS
    ***********************************************/

    void OnGUI()
    {
        //Debug.Log ("OnGUI:"+Event.current.type);

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

        if (target == null)
        {
            EditorGUILayout.HelpBox("No humanoid target found, please select humanoid gameobject from 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();
    }