コード例 #1
0
        protected override Dictionary <string, Action <SerializedProperty> > OverrideConfigurationDrawers()
        {
            var drawers = base.OverrideConfigurationDrawers();

            drawers[nameof(ScriptsConfiguration.InitializationScript)] = p => EditorResources.DrawPathPopup(p, ResourcesCategoryId, ResourcesPathPrefix, "None (disabled)");
            drawers[nameof(ScriptsConfiguration.TitleScript)]          = p => EditorResources.DrawPathPopup(p, ResourcesCategoryId, ResourcesPathPrefix, "None (disabled)");
            drawers[nameof(ScriptsConfiguration.StartGameScript)]      = p => EditorResources.DrawPathPopup(p, ResourcesCategoryId, ResourcesPathPrefix);
            drawers[nameof(ScriptsConfiguration.ExternalLoader)]       = p => { if (Configuration.EnableCommunityModding)
                                                                                {
                                                                                    EditorGUILayout.PropertyField(p);
                                                                                }
            };
            drawers[nameof(ScriptsConfiguration.ShowNavigatorOnInit)] = p => { if (Configuration.EnableNavigator)
                                                                               {
                                                                                   EditorGUILayout.PropertyField(p);
                                                                               }
            };
            drawers[nameof(ScriptsConfiguration.NavigatorSortOrder)] = p => { if (Configuration.EnableNavigator)
                                                                              {
                                                                                  EditorGUILayout.PropertyField(p);
                                                                              }
            };
            drawers[nameof(ScriptsConfiguration.HideUnusedParameters)] = p => { if (Configuration.EnableVisualEditor)
                                                                                {
                                                                                    EditorGUILayout.PropertyField(p);
                                                                                }
            };
            drawers[nameof(ScriptsConfiguration.InsertLineKey)] = p => { if (Configuration.EnableVisualEditor)
                                                                         {
                                                                             EditorGUILayout.PropertyField(p);
                                                                         }
            };
            drawers[nameof(ScriptsConfiguration.InsertLineModifier)] = property => { if (Configuration.EnableVisualEditor)
                                                                                     {
                                                                                         EditorGUILayout.PropertyField(property);
                                                                                     }
            };
            drawers[nameof(ScriptsConfiguration.SaveScriptKey)] = p => { if (Configuration.EnableVisualEditor)
                                                                         {
                                                                             EditorGUILayout.PropertyField(p);
                                                                         }
            };
            drawers[nameof(ScriptsConfiguration.SaveScriptModifier)] = p => { if (Configuration.EnableVisualEditor)
                                                                              {
                                                                                  EditorGUILayout.PropertyField(p);
                                                                              }
            };
            drawers[nameof(ScriptsConfiguration.EditorPageLength)] = p => { if (Configuration.EnableVisualEditor)
                                                                            {
                                                                                EditorGUILayout.PropertyField(p);
                                                                            }
            };
            drawers[nameof(ScriptsConfiguration.EditorCustomStyleSheet)] = p => { if (Configuration.EnableVisualEditor)
                                                                                  {
                                                                                      EditorGUILayout.PropertyField(p);
                                                                                  }
            };
            return(drawers);
        }
コード例 #2
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            if (!editorResources)
            {
                editorResources = EditorResources.LoadOrDefault();
            }

            var attr = attribute as ResourcesPopupAttribute;

            editorResources.DrawPathPopup(position, property, attr.Category, attr.PathPrefix, attr.EmptyOption);
        }
コード例 #3
0
        protected override Dictionary <string, Action <SerializedProperty> > OverrideConfigurationDrawers()
        {
            var drawers = base.OverrideConfigurationDrawers();

            drawers[nameof(MoviesConfiguration.IntroMovieName)] = property =>
            {
                if (Configuration.PlayIntroMovie)
                {
                    EditorResources.DrawPathPopup(property, ResourcesCategoryId, ResourcesPathPrefix);
                }
            };
            return(drawers);
        }
コード例 #4
0
        protected override Dictionary <string, Action <SerializedProperty> > OverrideMetaDrawers()
        {
            var drawers = base.OverrideMetaDrawers();

            drawers[nameof(CharacterMetadata.CustomShader)] = p => { if (ResourcesTypeConstraint != null && ResourcesTypeConstraint != typeof(GenericCharacterBehaviour))
                                                                     {
                                                                         EditorGUILayout.PropertyField(p);
                                                                     }
            };
            drawers[nameof(CharacterMetadata.RenderTexture)] = p => { if (ResourcesTypeConstraint != null && ResourcesTypeConstraint != typeof(GenericCharacterBehaviour))
                                                                      {
                                                                          EditorGUILayout.PropertyField(p);
                                                                      }
            };
            drawers[nameof(CharacterMetadata.CorrectRenderAspect)] = p => { if (ResourcesTypeConstraint != typeof(GenericCharacterBehaviour) && EditedMetadata.RenderTexture)
                                                                            {
                                                                                EditorGUILayout.PropertyField(p);
                                                                            }
            };
            drawers[nameof(CharacterMetadata.BakedLookDirection)] = p => { if (ResourcesTypeConstraint != null)
                                                                           {
                                                                               EditorGUILayout.PropertyField(p);
                                                                           }
            };
            drawers[nameof(CharacterMetadata.NameColor)] = p => { if (EditedMetadata.UseCharacterColor)
                                                                  {
                                                                      EditorGUILayout.PropertyField(p);
                                                                  }
            };
            drawers[nameof(CharacterMetadata.MessageColor)] = p => { if (EditedMetadata.UseCharacterColor)
                                                                     {
                                                                         EditorGUILayout.PropertyField(p);
                                                                     }
            };
            drawers[nameof(CharacterMetadata.HighlightWhenSpeaking)] = p => { if (ResourcesTypeConstraint != null)
                                                                              {
                                                                                  EditorGUILayout.PropertyField(p);
                                                                              }
            };
            drawers[nameof(CharacterMetadata.HighlightCharacterCount)] = p => { if (EditedMetadata.HighlightWhenSpeaking)
                                                                                {
                                                                                    EditorGUILayout.PropertyField(p);
                                                                                }
            };
            drawers[nameof(CharacterMetadata.SpeakingTint)] = p => { if (EditedMetadata.HighlightWhenSpeaking)
                                                                     {
                                                                         EditorGUILayout.PropertyField(p);
                                                                     }
            };
            drawers[nameof(CharacterMetadata.NotSpeakingTint)] = p => { if (EditedMetadata.HighlightWhenSpeaking)
                                                                        {
                                                                            EditorGUILayout.PropertyField(p);
                                                                        }
            };
            drawers[nameof(CharacterMetadata.PlaceOnTop)] = p => { if (EditedMetadata.HighlightWhenSpeaking)
                                                                   {
                                                                       EditorGUILayout.PropertyField(p);
                                                                   }
            };
            drawers[nameof(CharacterMetadata.HighlightDuration)] = p => { if (EditedMetadata.HighlightWhenSpeaking)
                                                                          {
                                                                              EditorGUILayout.PropertyField(p);
                                                                          }
            };
            drawers[nameof(CharacterMetadata.HighlightEasing)] = p => { if (EditedMetadata.HighlightWhenSpeaking)
                                                                        {
                                                                            EditorGUILayout.PropertyField(p);
                                                                        }
            };
            drawers[nameof(CharacterMetadata.MessageSound)]     = p => EditorResources.DrawPathPopup(p, AudioConfiguration.DefaultAudioPathPrefix, AudioConfiguration.DefaultAudioPathPrefix, "None (disabled)");
            drawers[nameof(CharacterMetadata.ClipMessageSound)] = p => { if (!string.IsNullOrEmpty(EditedMetadata.MessageSound))
                                                                         {
                                                                             EditorGUILayout.PropertyField(p);
                                                                         }
            };
            drawers[nameof(CharacterMetadata.LinkedPrinter)] = p => EditorResources.DrawPathPopup(p, $"{TextPrintersConfiguration.DefaultPathPrefix}/*", "*", "None (disabled)");
            drawers[nameof(CharacterMetadata.Poses)]         = p => { if (ResourcesTypeConstraint != null)
                                                                      {
                                                                          EditorGUILayout.PropertyField(p);
                                                                      }
            };
            return(drawers);
        }