void Awake()
        {
            #region Singleton
            // Singleton
            if (instance == null)
            {
                instance = this;
            }
            else if (instance != this)
            {
                Destroy(gameObject);
            }
            #endregion

            #region Creature Storage

            // If null, we either didn't load in the data or we have a wipe data check.  Either way, create a new one.
            if (animalInfoDictionary == null)
            {
                animalInfoDictionary = new Dictionary <int, AnimalStoredInfo>();
            }

            #endregion

            #region Breeding-specific
            storedAnimals = new List <Animal> ();

            selectedMother = null;
            selectedFather = null;
            #endregion

            string[] words = { "cherr", "hlaal3", "pooty44" };

            var query = from w in words
                        select w.Length;

            Debug.Log(query.Min());
        }
Esempio n. 2
0
        public override void OnInspectorGUI()
        {
            // Update the object this script is modifying
            serializedObject.Update();

            AnimalStorage mainScript = target as AnimalStorage;

            // Show script reference
            GUI.enabled = false;
            EditorGUILayout.ObjectField("Script:", MonoScript.FromMonoBehaviour(mainScript), typeof(MonoScript), false);
            GUI.enabled = true;

            // ============= MAIN CODE =====================


            // ...


            // =============================================

            // Updates property values as changes are made within this script
            serializedObject.ApplyModifiedProperties();
        }