コード例 #1
0
        public override void OnInspectorGUI()
        {
            TraitContainer traitContainer = (TraitContainer)target;

            base.OnInspectorGUI();
            TraitManager traitManager = TraitManager.GetInstantiate();
            List <Trait> allTraits    = traitManager.GetTraits();

            GUILayout.Space(10);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("isHidden"));
            if (traitContainer.isHidden)
            {
                List <string> options = new List <string>();
                options.Add("NULL");
                foreach (Trait t in allTraits)
                {
                    options.Add(t.traitName);
                }
                int index = EditorGUILayout.Popup(allTraits.IndexOf(traitContainer.mimicryTrait) + 1, options.ToArray());
                if (index == 0)
                {
                    traitContainer.mimicryTrait = null;
                }
                else
                {
                    traitContainer.mimicryTrait = allTraits[index - 1];
                }
            }
            serializedObject.ApplyModifiedProperties();
        }
コード例 #2
0
ファイル: eTrait.cs プロジェクト: eakuznec/BadDetective_old
        public override void OnInspectorGUI()
        {
            Trait        trait        = (Trait)target;
            TraitManager traitManager = TraitManager.GetInstantiate();
            List <Trait> allTraits    = traitManager.GetTraits();
            GUIStyle     boldStyle    = new GUIStyle();

            boldStyle.fontStyle = FontStyle.Bold;
            if (!allTraits.Contains(trait))
            {
                if (PrefabUtility.GetPrefabType(trait) == PrefabType.Prefab)
                {
                    if (GUILayout.Button("!!! Registrate !!!"))
                    {
                        traitManager.Registrate(trait);
                    }
                }
                else
                {
                    EditorGUILayout.LabelField("---Обратитесь к префабу для регистрации в Game!---");
                }
                GUILayout.Space(10);
            }
            base.OnInspectorGUI();
            if (trait.type == TraitType.REMOVABLE)
            {
                EditorGUILayout.PropertyField(serializedObject.FindProperty("removePoint"));
            }
            else if (trait.type == TraitType.TEMPORARY)
            {
                EditorGUILayout.PropertyField(serializedObject.FindProperty("liveTime"));
            }
            serializedObject.ApplyModifiedProperties();
        }
コード例 #3
0
 public static TraitManager GetInstantiate()
 {
     if (instance == null)
     {
         instance = FindObjectOfType <TraitManager>();
     }
     if (instance == null)
     {
         Game game = Game.GetInstantiate();
         instance = Instantiate(game.traitManager, game.transform);
     }
     return(instance);
 }
コード例 #4
0
ファイル: Game.cs プロジェクト: eakuznec/BadDetective_old
        private void Awake()
        {
            GetInstantiate();

            DontDestroyOnLoad(instance);
            ControlManager.GetInstantiate();
            DetectiveManager.GetInstantiate();
            TraitManager.GetInstantiate();
            ItemManager.GetInstantiate();
            QuestManager.GetInstantiate();
            MapManager.GetInstantiate();
            DialogManager.GetInstantiate();
            Agency.GetInstantiate();
        }