예제 #1
0
        public Spell GetSpell(string id)
        {
            SpellItemScriptableObject obj = Resources.Load("GameControll.SpellItemScriptableObject") as SpellItemScriptableObject;

            if (obj == null)
            {
                Debug.Log("SpellItemScriptableObject cant load!");
                return(null);
            }

            int index = GetSpellIdFromString(id);

            if (index == -1)
            {
                return(null);
            }

            return(obj.spellItems_List[index]);
        }
예제 #2
0
        void LoadSpellIds()
        {
            SpellItemScriptableObject obj = Resources.Load("GameControll.SpellItemScriptableObject") as SpellItemScriptableObject;

            if (obj == null)
            {
                Debug.Log("SpellItemScriptableObject coundlt load");
                return;
            }
            for (int i = 0; i < obj.spellItems_List.Count; i++)
            {
                if (spell_ids.ContainsKey(obj.spellItems_List[i].itemName))
                {
                    Debug.Log(obj.spellItems_List[i].itemName + " is duplicate");
                }
                else
                {
                    spell_ids.Add(obj.spellItems_List[i].itemName, i);
                }
            }
        }