コード例 #1
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            PsyiaForce myTarget = (PsyiaForce)target;

            EditorGUILayout.PropertyField(ShapeProperty, new GUIContent("Force Shape"));
            EditorGUILayout.PropertyField(StrengthProperty, new GUIContent("Force Strength (N)"));
            EditorGUILayout.PropertyField(StrengthMultiplierProperty, new GUIContent("Force Multiplier"));
            EditorGUILayout.PropertyField(AttenuationProperty, new GUIContent("Attenuation Mode"));
            if (AttenuationProperty.enumValueIndex == 4)
            {
                EditorGUILayout.PropertyField(DistanceProperty, new GUIContent("Attenuation Period"));
            }
            else if (AttenuationProperty.enumValueIndex > 4)
            {
                EditorGUILayout.PropertyField(DistanceProperty, new GUIContent("Attenuation Softening Distance"));
            }
            else if (AttenuationProperty.enumValueIndex != 0)
            {
                EditorGUILayout.PropertyField(DistanceProperty, new GUIContent("Attenuation Distance"));
            }

            serializedObject.ApplyModifiedProperties();
        }
コード例 #2
0
        public void RemoveSource(PsyiaForce NewSource)
        {
            if (!Sources.Contains(NewSource))
            {
                return;
            }

            Sources.Remove(NewSource);

            UpdateCount();
        }
コード例 #3
0
        public void AddSource(PsyiaForce NewSource)
        {
            if (Sources.Contains(NewSource))
            {
                return;
            }

            Sources.Add(NewSource);

            UpdateCount();
        }