Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            if (headTarget == null || humanoid == null)
            {
                return;
            }

            serializedObject.Update();

            SensorInspectors(headTarget);
            if (headTarget.humanoid != null)
            {
#if hFACE
                FaceTarget_Editor.OnInspectorGUI(headTarget);
#endif
                ConfigurationInspector(headTarget);

#if hFACE
                FaceTarget_Editor.ExpressionsInspector(headTarget.face);
#endif
            }

            PoseInspector();
            SettingsInspector(headTarget);
#if hFACE
            FaceTarget_Editor.FocusObjectInspector(headTarget.face);
#endif

            GazeInteractionButton(headTarget);

            //serializedObject.Update();
            serializedObject.ApplyModifiedProperties();
        }
Ejemplo n.º 2
0
        public void OnDisable()
        {
            if (humanoid == null)
            {
                // This target is not connected to a humanoid, so we delete it
                DestroyImmediate(headTarget, true);
                return;
            }

            if (!Application.isPlaying)
            {
                SetSensor2Target();
            }

#if hFACE
            FaceTarget_Editor.OnDisable(serializedObject, headTarget);
#endif
        }
Ejemplo n.º 3
0
        public void OnEnable()
        {
            headTarget = (HeadTarget)target;

            if (headTarget.humanoid == null)
            {
                headTarget.humanoid = GetHumanoid(headTarget);
            }
            humanoid = headTarget.humanoid;

            InitEditors();

            headTarget.InitSensors();
            InitSensors();
#if hFACE
            FaceTarget_Editor.OnEnable(serializedObject, headTarget);
#endif
        }
Ejemplo n.º 4
0
        public void OnSceneGUI()
        {
            if (Application.isPlaying)
            {
                return;
            }
            if (headTarget == null || headTarget.humanoid == null)
            {
                return;
            }

#if hFACE
            FaceTarget_Editor.UpdateScene(headTarget.face);
#endif
            if (humanoid.pose != null)
            {
                if (humanoid.editPose)
                {
                    humanoid.pose.UpdatePose(humanoid);
                }
                else
                {
                    humanoid.pose.Show(humanoid);
                    headTarget.CopyRigToTarget();
                }
            }

            // update the target rig from the current head target
            headTarget.CopyTargetToRig();
            // update the avatar bones from the target rig
            humanoid.UpdateMovements();

            // match the target rig with the new avatar pose
            humanoid.MatchTargetsToAvatar();
            // and update all targets to match the target rig
            humanoid.CopyRigToTargets();

            // Update the sensors to match the updated targets
            humanoid.UpdateSensorsFromTargets();

            //if (headTarget.virtual3dTracking && headTarget.humanoid.showRealObjects)
            //    DrawScreen(headTarget);
        }
Ejemplo n.º 5
0
        private void ConfigurationInspector(HeadTarget headTarget)
        {
            if (headTarget.humanoid == null)
            {
                return;
            }

            showConfiguration = EditorGUILayout.Foldout(showConfiguration, "Configuration", true);
            if (showConfiguration)
            {
                EditorGUI.indentLevel++;
#if hFACE
                FaceTarget_Editor.ConfigurationInspector(headTarget.face);
#endif
                HeadConfigurationInspector(ref headTarget.head);
                NeckConfigurationInspector(ref headTarget.neck);

                EditorGUI.indentLevel--;
            }
        }