コード例 #1
0
 public override void OnInspectorGUI()
 {
     serializedObject.Update();
     tileList.Draw();
     EditorGUILayout.PropertyField(serializedObject.FindProperty("comparison"));
     EditorGUILayout.PropertyField(serializedObject.FindProperty("count"));
     EditorGUILayout.PropertyField(serializedObject.FindProperty("eager"));
     serializedObject.ApplyModifiedProperties();
 }
コード例 #2
0
 public override void OnInspectorGUI()
 {
     serializedObject.Update();
     EditorGUILayout.PropertyField(serializedObject.FindProperty("hasPathTiles"));
     if (serializedObject.FindProperty("hasPathTiles").boolValue)
     {
         tileList.Draw();
     }
     EditorGUILayout.PropertyField(serializedObject.FindProperty("hasPathColors"));
     if (serializedObject.FindProperty("hasPathColors").boolValue)
     {
         colorList.Draw();
     }
     if (!serializedObject.FindProperty("hasPathTiles").boolValue&& !serializedObject.FindProperty("hasPathColors").boolValue)
     {
         EditorGUILayout.LabelField("Warning: Path Constraint needs at least one of path tiles or path colors.");
     }
     serializedObject.ApplyModifiedProperties();
 }
コード例 #3
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            var hasSymmetricTilesProperty = serializedObject.FindProperty("hasSymmetricTiles");

            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(hasSymmetricTilesProperty);
            if (EditorGUI.EndChangeCheck())
            {
                serializedObject.ApplyModifiedProperties();
                ((MirrorConstraint)target).SetSymmetricTiles();
                serializedObject.Update();
            }
            if (hasSymmetricTilesProperty.boolValue)
            {
                tileListX.Draw();
                tileListZ.Draw();
            }
            else
            {
                EditorGUILayout.HelpBox("Symmetric tiles autodetected.", MessageType.Info);
            }
            serializedObject.ApplyModifiedProperties();
        }