Exemplo n.º 1
0
        void BindToMagicScript()
        {
            magicScript = Magic.LocalMagicInstance;
            for (int i = 0; i < magicScript.ActiveSpells.Count; i++)
            {
                spellUIs.Add(magicScript.ActiveSpells[i].SpellUI);
            }
            magicScript.GetComponent <PlayerManager>().SelectedSpell = spellUIs.Modulo(2);


            for (int i = 0; i < ScrollCount; i++)
            {
                scrolls[i].magicScript = magicScript;
                scrolls[i].SetSpell(spellUIs.Modulo(i), spellUIs);
            }
            spellNameText.text = scrolls[2].spellUI.name.Split("(".ToCharArray())[0];
        }
Exemplo n.º 2
0
        void Start()
        {
            scrolls  = new CyclicList <Scroll>();
            spellUIs = new CyclicList <GameObject>();

            for (int i = 0; i < ScrollCount; i++)
            {
                scrolls.Add(transform.GetChild(i).GetComponent <Scroll>());
            }
            data = new Vector3[ScrollCount];

            for (int i = 0; i < ScrollCount; i++)
            {
                Vector3 dataVector = scrolls[i].transform.position;
                dataVector.z = scrolls[i].myImage.color.a;
                data[i]      = dataVector;
            }
        }