예제 #1
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 2))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Action");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
                T23_EditorUtility.ShowSwapButton(master, body.title);
                body.priority = master.actionTitles.IndexOf(body.title);
            }
            else
            {
                body.groupID  = EditorGUILayout.IntField("Group ID", body.groupID);
                body.priority = EditorGUILayout.IntField("Priority", body.priority);
            }

            T23_EditorUtility.PropertyBoxField(serializedObject, "gravityStrength", "propertyBox", "usePropertyBox");
            if (!master || master.randomize)
            {
                prop = serializedObject.FindProperty("randomAvg");
                EditorGUILayout.PropertyField(prop);
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #2
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 1))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Trigger");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
            }
            else
            {
                body.groupID = EditorGUILayout.IntField("Group ID", body.groupID);
            }

            prop = serializedObject.FindProperty("key");
            EditorGUILayout.PropertyField(prop);
            prop = serializedObject.FindProperty("keyFree");
            EditorGUILayout.PropertyField(prop);

            serializedObject.ApplyModifiedProperties();
        }
예제 #3
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 1))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Trigger");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
            }
            else
            {
                body.groupID = EditorGUILayout.IntField("Group ID", body.groupID);
            }

            prop          = serializedObject.FindProperty("channel");
            prop.intValue = System.Convert.ToInt32(EditorGUILayout.EnumPopup("Channel", (VRC_MidiNoteIn.Channel)body.channel));
            prop          = serializedObject.FindProperty("note");
            prop.intValue = System.Convert.ToInt32(EditorGUILayout.EnumPopup("Note", (VRC_MidiNoteIn.Note)body.note));

            serializedObject.ApplyModifiedProperties();
        }
예제 #4
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 1))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Trigger");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
            }
            else
            {
                body.groupID = EditorGUILayout.IntField("Group ID", body.groupID);
            }

            prop           = serializedObject.FindProperty("inputValue");
            prop.boolValue = (InputValue)EditorGUILayout.EnumPopup("Value", (InputValue)System.Convert.ToInt32(body.inputValue)) == InputValue.Down;
            prop.intValue  = (int)(HandType)EditorGUILayout.EnumPopup("Hand", (HandType)System.Convert.ToInt32(body.hand));

            serializedObject.ApplyModifiedProperties();
        }
예제 #5
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 1))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Trigger");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
            }
            else
            {
                body.groupID = EditorGUILayout.IntField("Group ID", body.groupID);
            }

            var station = body.GetComponent <VRCStation>();

            if (!station)
            {
                EditorGUILayout.HelpBox("VRC Station が必要です。", MessageType.Warning);
            }

            prop = serializedObject.FindProperty("localOnly");
            EditorGUILayout.PropertyField(prop);

            serializedObject.ApplyModifiedProperties();
        }
예제 #6
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 2))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Action");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
                T23_EditorUtility.ShowSwapButton(master, body.title);
                body.priority = master.actionTitles.IndexOf(body.title);
            }
            else
            {
                body.groupID  = EditorGUILayout.IntField("Group ID", body.groupID);
                body.priority = EditorGUILayout.IntField("Priority", body.priority);
            }

            SerializedProperty recieverProp = serializedObject.FindProperty("recievers");

            if (recieverReorderableList == null)
            {
                recieverReorderableList                     = new ReorderableList(serializedObject, recieverProp);
                recieverReorderableList.draggable           = true;
                recieverReorderableList.displayAdd          = true;
                recieverReorderableList.drawHeaderCallback  = rect => EditorGUI.LabelField(rect, "Recievers");
                recieverReorderableList.drawElementCallback = (rect, index, isActive, isFocused) =>
                {
                    rect.height           = EditorGUIUtility.singleLineHeight;
                    body.recievers[index] = (GameObject)EditorGUI.ObjectField(rect, body.recievers[index], typeof(GameObject), true);
                };
            }
            recieverReorderableList.DoLayoutList();

            EditorGUI.BeginChangeCheck();
            T23_EditorUtility.PropertyBoxField(serializedObject, "operation", "propertyBox", "usePropertyBox", () => operation = (ToggleOperation)EditorGUILayout.EnumPopup("Operation", GetOperation()));
            if (body.usePropertyBox && body.toggle)
            {
                serializedObject.FindProperty("toggle").boolValue = false;
            }
            if (EditorGUI.EndChangeCheck())
            {
                SelectOperation();
            }

            if (!master || master.randomize)
            {
                prop = serializedObject.FindProperty("randomAvg");
                EditorGUILayout.PropertyField(prop);
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #7
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 2))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Action");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
                T23_EditorUtility.ShowSwapButton(master, body.title);
                body.priority = master.actionTitles.IndexOf(body.title);
            }
            else
            {
                body.groupID  = EditorGUILayout.IntField("Group ID", body.groupID);
                body.priority = EditorGUILayout.IntField("Priority", body.priority);
            }

            EditorGUILayout.HelpBox("SpawnObject は推奨されません。 VRC_ObjectPool の利用を検討してください。SpawnObjectPool で使用できます。", MessageType.Warning);

            prop = serializedObject.FindProperty("prefab");
            EditorGUILayout.PropertyField(prop);

            SerializedProperty recieverProp = serializedObject.FindProperty("locations");

            if (recieverReorderableList == null)
            {
                recieverReorderableList                     = new ReorderableList(serializedObject, recieverProp);
                recieverReorderableList.draggable           = true;
                recieverReorderableList.displayAdd          = true;
                recieverReorderableList.drawHeaderCallback  = rect => EditorGUI.LabelField(rect, "Locations");
                recieverReorderableList.drawElementCallback = (rect, index, isActive, isFocused) =>
                {
                    rect.height           = EditorGUIUtility.singleLineHeight;
                    body.locations[index] = (Transform)EditorGUI.ObjectField(rect, body.locations[index], typeof(Transform), true);
                };
            }
            recieverReorderableList.DoLayoutList();

            if (!master || master.randomize)
            {
                prop = serializedObject.FindProperty("randomAvg");
                EditorGUILayout.PropertyField(prop);
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #8
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 2))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Action");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
                T23_EditorUtility.ShowSwapButton(master, body.title);
                body.priority = master.actionTitles.IndexOf(body.title);
            }
            else
            {
                body.groupID  = EditorGUILayout.IntField("Group ID", body.groupID);
                body.priority = EditorGUILayout.IntField("Priority", body.priority);
            }

            SerializedProperty recieverProp = serializedObject.FindProperty("recievers");

            if (recieverReorderableList == null)
            {
                recieverReorderableList                     = new ReorderableList(serializedObject, recieverProp);
                recieverReorderableList.draggable           = true;
                recieverReorderableList.displayAdd          = true;
                recieverReorderableList.drawHeaderCallback  = rect => EditorGUI.LabelField(rect, "Recievers");
                recieverReorderableList.drawElementCallback = (rect, index, isActive, isFocused) =>
                {
                    rect.height           = EditorGUIUtility.singleLineHeight;
                    body.recievers[index] = (Rigidbody)EditorGUI.ObjectField(rect, body.recievers[index], typeof(Rigidbody), true);
                };
            }
            recieverReorderableList.DoLayoutList();

            T23_EditorUtility.PropertyBoxField(serializedObject, "force", "propertyBox", "usePropertyBox");
            prop = serializedObject.FindProperty("useWorldSpace");
            EditorGUILayout.PropertyField(prop);
            prop = serializedObject.FindProperty("takeOwnership");
            EditorGUILayout.PropertyField(prop);
            if (!master || master.randomize)
            {
                prop = serializedObject.FindProperty("randomAvg");
                EditorGUILayout.PropertyField(prop);
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #9
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 2))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Action");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
                T23_EditorUtility.ShowSwapButton(master, body.title);
                body.priority = master.actionTitles.IndexOf(body.title);
            }
            else
            {
                body.groupID  = EditorGUILayout.IntField("Group ID", body.groupID);
                body.priority = EditorGUILayout.IntField("Priority", body.priority);
            }

            SerializedProperty recieverProp = serializedObject.FindProperty("recievers");

            if (recieverReorderableList == null)
            {
                recieverReorderableList                     = new ReorderableList(serializedObject, recieverProp);
                recieverReorderableList.draggable           = true;
                recieverReorderableList.displayAdd          = true;
                recieverReorderableList.drawHeaderCallback  = rect => EditorGUI.LabelField(rect, "Recievers");
                recieverReorderableList.drawElementCallback = (rect, index, isActive, isFocused) =>
                {
                    rect.height           = EditorGUIUtility.singleLineHeight;
                    body.recievers[index] = (AudioSource)EditorGUI.ObjectField(rect, body.recievers[index], typeof(AudioSource), true);
                };
            }
            recieverReorderableList.DoLayoutList();

            prop           = serializedObject.FindProperty("operation");
            prop.boolValue = (PauseOperation)EditorGUILayout.EnumPopup("Operation", (PauseOperation)System.Convert.ToInt32(body.operation)) == PauseOperation.Pause;
            if (!master || master.randomize)
            {
                prop = serializedObject.FindProperty("randomAvg");
                EditorGUILayout.PropertyField(prop);
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #10
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 2))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Action");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
                T23_EditorUtility.ShowSwapButton(master, body.title);
                body.priority = master.actionTitles.IndexOf(body.title);
            }
            else
            {
                body.groupID  = EditorGUILayout.IntField("Group ID", body.groupID);
                body.priority = EditorGUILayout.IntField("Priority", body.priority);
            }

            prop = serializedObject.FindProperty("byValue");
            EditorGUILayout.PropertyField(prop);
            if (body.byValue)
            {
                T23_EditorUtility.PropertyBoxField(serializedObject, "teleportPosition", "positionPropertyBox", "positionUsePropertyBox");
                T23_EditorUtility.PropertyBoxField(serializedObject, "teleportRotation", "rotationPropertyBox", "rotationUsePropertyBox");
            }
            else
            {
                prop = serializedObject.FindProperty("teleportLocation");
                EditorGUILayout.PropertyField(prop);
            }
            prop = serializedObject.FindProperty("teleportOrientation");
            EditorGUILayout.PropertyField(prop);
            prop = serializedObject.FindProperty("lerpOnRemote");
            EditorGUILayout.PropertyField(prop);
            if (!master || master.randomize)
            {
                prop = serializedObject.FindProperty("randomAvg");
                EditorGUILayout.PropertyField(prop);
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #11
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 2))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Action");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
                T23_EditorUtility.ShowSwapButton(master, body.title);
                body.priority = master.actionTitles.IndexOf(body.title);
            }
            else
            {
                body.groupID  = EditorGUILayout.IntField("Group ID", body.groupID);
                body.priority = EditorGUILayout.IntField("Priority", body.priority);
            }

            prop           = serializedObject.FindProperty("triggeredPlayer");
            prop.boolValue = (TargetPlayer)EditorGUILayout.EnumPopup("Target Player", (TargetPlayer)System.Convert.ToInt32(body.triggeredPlayer)) == TargetPlayer.TriggeredPlayer;
            if (body.triggeredPlayer)
            {
                EditorGUILayout.HelpBox("TriggeredPlayer は、BroadcastLocalでのみ有効です", MessageType.Info);
            }
            prop = serializedObject.FindProperty("distanceFar");
            EditorGUILayout.PropertyField(prop);
            prop = serializedObject.FindProperty("distanceNear");
            EditorGUILayout.PropertyField(prop);
            prop = serializedObject.FindProperty("gain");
            EditorGUILayout.PropertyField(prop);
            prop = serializedObject.FindProperty("lowpass");
            EditorGUILayout.PropertyField(prop);
            prop = serializedObject.FindProperty("volumetricRadius");
            EditorGUILayout.PropertyField(prop);
            if (!master || master.randomize)
            {
                prop = serializedObject.FindProperty("randomAvg");
                EditorGUILayout.PropertyField(prop);
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #12
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 2))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Action");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
                T23_EditorUtility.ShowSwapButton(master, body.title);
                body.priority = master.actionTitles.IndexOf(body.title);
            }
            else
            {
                body.groupID  = EditorGUILayout.IntField("Group ID", body.groupID);
                body.priority = EditorGUILayout.IntField("Priority", body.priority);
            }

            prop = serializedObject.FindProperty("audioBank");
            EditorGUILayout.PropertyField(prop);
            serializedObject.FindProperty("command").intValue = (int)(Command)EditorGUILayout.EnumPopup("Command", (Command)body.command);
            if (body.command == 0)
            {
                prop = serializedObject.FindProperty("index");
                EditorGUILayout.PropertyField(prop);
            }

            if (!master || master.randomize)
            {
                prop = serializedObject.FindProperty("randomAvg");
                EditorGUILayout.PropertyField(prop);
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #13
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 2))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Action");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
                T23_EditorUtility.ShowSwapButton(master, body.title);
                body.priority = master.actionTitles.IndexOf(body.title);
            }
            else
            {
                body.groupID  = EditorGUILayout.IntField("Group ID", body.groupID);
                body.priority = EditorGUILayout.IntField("Priority", body.priority);
            }

            prop = serializedObject.FindProperty("udonBehaviour");
            EditorGUILayout.PropertyField(prop);
            prop = serializedObject.FindProperty("method");
            EditorGUILayout.PropertyField(prop);
            prop          = serializedObject.FindProperty("ownershipControl");
            prop.intValue = System.Convert.ToInt32(EditorGUILayout.EnumPopup("Ownership Control", (OwnershipControl)body.ownershipControl));
            if (!master || master.randomize)
            {
                prop = serializedObject.FindProperty("randomAvg");
                EditorGUILayout.PropertyField(prop);
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #14
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 1))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Trigger");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
            }
            else
            {
                body.groupID = EditorGUILayout.IntField("Group ID", body.groupID);
            }

            EditorGUI.BeginChangeCheck();
            UdonSharpProgramAsset programAsset = UdonSharpEditorUtility.GetUdonSharpProgramAsset((UdonSharpBehaviour)target);

            UdonSharpGUI.DrawInteractSettings(target);
            if (EditorGUI.EndChangeCheck())
            {
                if (master)
                {
                    UdonBehaviour behaviour = UdonSharpEditorUtility.GetBackingUdonBehaviour((UdonSharpBehaviour)target);
                    master.interactText = behaviour.interactText;
                    master.proximity    = behaviour.proximity;
                    master.OrderComponents();
                }
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #15
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 1))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Trigger");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
            }
            else
            {
                body.groupID = EditorGUILayout.IntField("Group ID", body.groupID);
            }

            var pickup = body.GetComponent <VRC_Pickup>();

            if (pickup)
            {
                if (pickup.AutoHold != VRC_Pickup.AutoHoldMode.Yes)
                {
                    EditorGUILayout.HelpBox("VRC_Pickup の AutoHold を Yes にする必要があります。", MessageType.Warning);
                }
            }
            else
            {
                EditorGUILayout.HelpBox("VRC_Pickup が必要です。", MessageType.Warning);
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #16
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 2))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Action");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
                T23_EditorUtility.ShowSwapButton(master, body.title);
                body.priority = master.actionTitles.IndexOf(body.title);
            }
            else
            {
                body.groupID  = EditorGUILayout.IntField("Group ID", body.groupID);
                body.priority = EditorGUILayout.IntField("Priority", body.priority);
            }

            prop = serializedObject.FindProperty("objectPool");
            EditorGUILayout.PropertyField(prop);
            EditorGUILayout.HelpBox("無条件でObject PoolのOwnershipを取得します。", MessageType.Info);

            if (!master || master.randomize)
            {
                prop = serializedObject.FindProperty("randomAvg");
                EditorGUILayout.PropertyField(prop);
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #17
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 2))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Action");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
                T23_EditorUtility.ShowSwapButton(master, body.title);
                body.priority = master.actionTitles.IndexOf(body.title);
            }
            else
            {
                body.groupID  = EditorGUILayout.IntField("Group ID", body.groupID);
                body.priority = EditorGUILayout.IntField("Priority", body.priority);
            }

            prop = serializedObject.FindProperty("propertyBox");
            EditorGUILayout.PropertyField(prop);
            if (body.propertyBox)
            {
                serializedObject.FindProperty("calcOperator").intValue = EditorGUILayout.Popup("Operator", body.calcOperator, (body.propertyBox.valueType == 1 || body.propertyBox.valueType == 2 || body.propertyBox.valueType == 3) ? CalcOperator_a : CalcOperator_b);
                if (body.calcOperator != 0)
                {
                    if (body.propertyBox.valueType == 0)
                    {
                        T23_EditorUtility.PropertyBoxField(serializedObject, "value_bool", "valuePropertyBox", "usePropertyBox", () => serializedObject.FindProperty("value_bool").boolValue = EditorGUILayout.Toggle("Value_bool", body.value_bool));
                    }
                    else if (body.propertyBox.valueType == 1)
                    {
                        T23_EditorUtility.PropertyBoxField(serializedObject, "value_int", "valuePropertyBox", "usePropertyBox", () => serializedObject.FindProperty("value_int").intValue = EditorGUILayout.IntField("Value_int", body.value_int));
                    }
                    else if (body.propertyBox.valueType == 2 || (body.propertyBox.valueType == 3 && (body.calcOperator == 4 || body.calcOperator == 5)))
                    {
                        T23_EditorUtility.PropertyBoxField(serializedObject, "value_float", "valuePropertyBox", "usePropertyBox", () => serializedObject.FindProperty("value_float").floatValue = EditorGUILayout.FloatField("Value_float", body.value_float));
                    }
                    else if (body.propertyBox.valueType == 3)
                    {
                        T23_EditorUtility.PropertyBoxField(serializedObject, "value_Vector3", "valuePropertyBox", "usePropertyBox", () => serializedObject.FindProperty("value_Vector3").vector3Value = EditorGUILayout.Vector3Field("Value_Vector3", body.value_Vector3));
                    }
                    else if (body.propertyBox.valueType == 4)
                    {
                        T23_EditorUtility.PropertyBoxField(serializedObject, "value_string", "valuePropertyBox", "usePropertyBox", () => serializedObject.FindProperty("value_string").stringValue = EditorGUILayout.TextField("Value_string", body.value_string));
                    }
                }
            }

            if (!master || master.randomize)
            {
                prop = serializedObject.FindProperty("randomAvg");
                EditorGUILayout.PropertyField(prop);
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #18
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 1))
            {
                return;
            }

            UdonSharpProgramAsset programAsset = UdonSharpEditorUtility.GetUdonSharpProgramAsset((UdonSharpBehaviour)target);

            UdonSharpGUI.DrawCompileErrorTextArea(programAsset);

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Trigger");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
            }
            else
            {
                body.groupID = EditorGUILayout.IntField("Group ID", body.groupID);
            }

            prop = serializedObject.FindProperty("passive");
            EditorGUILayout.PropertyField(prop);
            if (!body.passive)
            {
                prop = serializedObject.FindProperty("allowContinuity");
                EditorGUILayout.PropertyField(prop);
            }

            GUILayout.Space(10);
            EditorGUILayout.LabelField("Base", EditorStyles.boldLabel);
            serializedObject.FindProperty("basePropertyBox").objectReferenceValue = EditorGUILayout.ObjectField("PropertyBox", body.basePropertyBox, typeof(T23_PropertyBox), true);

            if (body.basePropertyBox)
            {
                GUILayout.Space(10);
                EditorGUILayout.LabelField("Comparison", EditorStyles.boldLabel);
                serializedObject.FindProperty("compOperator").intValue      = EditorGUILayout.Popup("Operator", body.compOperator, (body.basePropertyBox.valueType == 1 || body.basePropertyBox.valueType == 2) ? CompOperator_a : CompOperator_b);
                serializedObject.FindProperty("compParameterType").intValue = (int)(CompParameterType)EditorGUILayout.EnumPopup("Parameter Type", (CompParameterType)body.compParameterType);
                if (body.compParameterType == 0)
                {
                    switch (body.basePropertyBox.valueType)
                    {
                    case 0:
                        serializedObject.FindProperty("comp_b").boolValue = EditorGUILayout.Toggle("Value", body.comp_b);
                        break;

                    case 1:
                        serializedObject.FindProperty("comp_i").intValue = EditorGUILayout.IntField("Value", body.comp_i);
                        break;

                    case 2:
                        serializedObject.FindProperty("comp_f").floatValue = EditorGUILayout.FloatField("Value", body.comp_f);
                        break;

                    case 4:
                        serializedObject.FindProperty("comp_s").stringValue = EditorGUILayout.TextField("Value", body.comp_s);
                        break;
                    }
                }
                if (body.compParameterType == 1)
                {
                    serializedObject.FindProperty("compPropertyBox").objectReferenceValue = EditorGUILayout.ObjectField("PropertyBox", body.compPropertyBox, typeof(T23_PropertyBox), true);
                    if (body.compPropertyBox)
                    {
                        if (body.compPropertyBox.valueType != body.basePropertyBox.valueType)
                        {
                            EditorGUILayout.HelpBox("PropertyBox の ValueType が不適合です", MessageType.Error);
                        }
                    }
                }
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #19
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 0))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Broadcast");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
                master.randomize = body.randomize;
            }
            else
            {
                body.groupID = EditorGUILayout.IntField("Group ID", body.groupID);
            }

            if (body.groupID > 9 || body.groupID < 0)
            {
                EditorGUILayout.HelpBox("BroadcastGlobal は Group #0 ~ #9 の間でしか使用できません。", MessageType.Error);
            }

            prop = serializedObject.FindProperty("sendTarget");
            EditorGUILayout.PropertyField(prop);
            serializedObject.FindProperty("useablePlayer").intValue = (int)(UsablePlayer)EditorGUILayout.EnumPopup("Usable Player", (UsablePlayer)body.useablePlayer);
            serializedObject.FindProperty("bufferType").intValue    = (int)(BufferType)EditorGUILayout.EnumPopup("Buffer Type", (BufferType)body.bufferType);
            prop = serializedObject.FindProperty("delayInSeconds");
            EditorGUILayout.PropertyField(prop);
            prop = serializedObject.FindProperty("randomize");
            EditorGUILayout.PropertyField(prop);

            if (body.bufferType == (int)BufferType.Unbuffered)
            {
                if (body.commonBuffer != null)
                {
                    body.commonBuffer = null;
                    T23_EditorUtility.UpdateAllCommonBuffersRelate();
                }
                body.commonBufferSearched = false;
            }
            else
            {
                EditorGUI.BeginChangeCheck();
                prop = serializedObject.FindProperty("commonBuffer");
                EditorGUILayout.PropertyField(prop);
                if (EditorGUI.EndChangeCheck())
                {
                    serializedObject.ApplyModifiedProperties();
                    serializedObject.Update();
                    T23_EditorUtility.UpdateAllCommonBuffersRelate();
                }
                if (body.commonBuffer == null && !body.commonBufferSearched)
                {
                    body.commonBuffer = T23_EditorUtility.GetAutoJoinCommonBuffer(body);
                    if (body.commonBuffer != null)
                    {
                        T23_EditorUtility.UpdateAllCommonBuffersRelate();
                    }
                    body.commonBufferSearched = true;
                }
            }

            serializedObject.ApplyModifiedProperties();
        }
예제 #20
0
        public override void OnInspectorGUI()
        {
            //base.OnInspectorGUI();

            if (!T23_EditorUtility.GuideJoinMaster(master, body, body.groupID, 2))
            {
                return;
            }

            serializedObject.Update();

            T23_EditorUtility.ShowTitle("Action");

            if (master)
            {
                GUILayout.Box("[#" + body.groupID.ToString() + "] " + body.title, T23_EditorUtility.HeadlineStyle());
                T23_EditorUtility.ShowSwapButton(master, body.title);
                body.priority = master.actionTitles.IndexOf(body.title);
            }
            else
            {
                body.groupID  = EditorGUILayout.IntField("Group ID", body.groupID);
                body.priority = EditorGUILayout.IntField("Priority", body.priority);
            }

            SerializedProperty recieverProp = serializedObject.FindProperty("recievers");

            if (recieverReorderableList == null)
            {
                recieverReorderableList                     = new ReorderableList(serializedObject, recieverProp);
                recieverReorderableList.draggable           = true;
                recieverReorderableList.displayAdd          = true;
                recieverReorderableList.drawHeaderCallback  = rect => EditorGUI.LabelField(rect, "Recievers");
                recieverReorderableList.drawElementCallback = (rect, index, isActive, isFocused) =>
                {
                    rect.height           = EditorGUIUtility.singleLineHeight;
                    body.recievers[index] = (GameObject)EditorGUI.ObjectField(rect, body.recievers[index], typeof(GameObject), true);
                };
            }
            recieverReorderableList.DoLayoutList();

            /*
             * List<string> customNameList = new List<string>();
             * if (body.recievers != null)
             * {
             *  foreach (var go in body.recievers)
             *  {
             *      if (go)
             *      {
             *          customNameList.AddRange(GetCustomNameList(go));
             *      }
             *  }
             * }
             * if (customNameList.Count > 0)
             * {
             *  var index = EditorGUILayout.Popup("Name", customNameList.IndexOf(body.Name), customNameList.ToArray());
             *  serializedObject.FindProperty("Name").stringValue = index >= 0 ? customNameList[index] : "";
             * }
             * else
             */
            {
                prop = serializedObject.FindProperty("Name");
                EditorGUILayout.PropertyField(prop);
            }
            if (!master || master.randomize)
            {
                prop = serializedObject.FindProperty("randomAvg");
                EditorGUILayout.PropertyField(prop);
            }

            serializedObject.ApplyModifiedProperties();
        }