Exemple #1
0
 public static void BrainInHierarchy(Transform transform, ref KinectBrain brain)
 {
     if (brain == null || brain.transform.hasChanged)
     {
         brain = transform.GetComponentInParent <KinectBrain>();
     }
 }
Exemple #2
0
        public static void BrainField(KinectBrain brain)
        {
            using (new EditorGUI.DisabledScope(true))
                EditorGUILayout.ObjectField("Brain", brain, typeof(KinectBrain), true);

            if (brain == null)
            {
                EditorGUILayout.HelpBox("No brain in parent hierarchy found. Perhaps this component will be ignored.", MessageType.Error);
            }
        }
Exemple #3
0
        public static void DrawAreaGizmos(KinectBrain brain, GizmoType type)
        {
            Rect rect = brain.Settings.TrackingAreaCentered();

            Vector3 a = brain.transform.TransformPoint(new Vector3(rect.min.x, 0f, rect.min.y));
            Vector3 b = brain.transform.TransformPoint(new Vector3(rect.max.x, 0f, rect.min.y));
            Vector3 c = brain.transform.TransformPoint(new Vector3(rect.min.x, 0f, rect.max.y));
            Vector3 d = brain.transform.TransformPoint(new Vector3(rect.max.x, 0f, rect.max.y));

            Gizmos.color = Color.green;
            Gizmos.DrawLine(a, b);
            Gizmos.DrawLine(a, c);
            Gizmos.DrawLine(c, d);
            Gizmos.DrawLine(d, b);
        }
 public void OnEnable()
 {
     this.me               = (KinectBrain)base.target;
     this.editor           = null;
     this.settingsProperty = serializedObject.FindProperty("settings");
 }
 public void OnEnable()
 {
     this.me    = (KinectActor)base.target;
     this.brain = null;
 }