Beispiel #1
0
        public static void OnObjectListsGUI(CustomTargetTool context)
        {
            if (context == null)
            {
                return;
            }

            RigidBodyTool.OnRigidBodyListGUI(context.CollectComponentsInChildred <RigidBody>().ToArray(), context);

            GUI.Separator();

            RigidBodyTool.OnConstraintListGUI(context.CollectComponentsInChildred <Constraint>().ToArray(), context);

            GUI.Separator();

            RigidBodyTool.OnShapeListGUI(context.CollectComponentsInChildred <Shape>().ToArray(), context);
        }
Beispiel #2
0
        public static void OnObjectListsGUI(ScriptComponent context, GUISkin skin)
        {
            if (context == null)
            {
                return;
            }

            RigidBodyTool.OnRigidBodyListGUI(context.GetComponentsInChildren <RigidBody>(), context, skin);

            GUI.Separator();

            RigidBodyTool.OnConstraintListGUI(context.GetComponentsInChildren <Constraint>(), context, skin);

            GUI.Separator();

            RigidBodyTool.OnShapeListGUI(context.GetComponentsInChildren <AGXUnity.Collide.Shape>(), context, skin);
        }
Beispiel #3
0
        public static void OnRigidBodyListGUI(RigidBody[] rigidBodies, UnityEngine.Object context, GUISkin skin)
        {
            if (!GUI.Foldout(EditorData.Instance.GetData(context, "Rigid Bodies"), GUI.MakeLabel("Rigid Bodies", true), skin))
            {
                return;
            }

            if (rigidBodies.Length == 0)
            {
                using (new GUI.Indent(12))
                    GUILayout.Label(GUI.MakeLabel("Empty", true), skin.label);
                return;
            }

            using (new GUI.Indent(12)) {
                foreach (var rb in rigidBodies)
                {
                    GUI.Separator();

                    if (!GUI.Foldout(EditorData.Instance.GetData(context, rb.GetInstanceID().ToString()),
                                     GUI.MakeLabel("[" + GUI.AddColorTag("RigidBody", Color.Lerp(Color.blue, Color.white, 0.35f)) + "] " + rb.name),
                                     skin))
                    {
                        continue;
                    }

                    GUI.Separator();
                    var rbTool = new RigidBodyTool(rb)
                    {
                        ToolsActive = false
                    };
                    using (new GUI.Indent(12)) {
                        rbTool.OnPreTargetMembersGUI(skin);
                        BaseEditor <RigidBody> .Update(rb, rb, skin);
                    }
                }
            }
        }