void Start() { EquippedSpell = Spells[0]; movements = GetComponent <Movement>(); defensives = GetComponent <Defense>(); MouseCtrl = GetComponent <MouseControl>(); movements.EquippedSpell = EquippedSpell; foreach (AbstractSpell AS in Spells) { AS.Init(); } foreach (AbstractSpell AS in DefensiveSpells) { AS.Init(); } CameraScreenDim = new Vector2(Camera.main.pixelWidth, Camera.main.pixelHeight); SpellImageHolder.transform.position = new Vector2(CameraScreenDim.x * .075f, CameraScreenDim.y * .125f); SpellImageHolder.sprite = Spells[0].SpellImage; for (int i = 0; i < UnuseSpellImages.Length; i++) { UnuseSpellImages[i].transform.position = new Vector2(CameraScreenDim.x * (float)(.175f + (float)i * .05f), CameraScreenDim.y * .1f); } for (int j = 0; j < DefensiveSpellImages.Length; j++) { DefensiveSpellImages[j].transform.position = new Vector2(CameraScreenDim.x * (float)(.175f + (float)(j + 1) * .05f), CameraScreenDim.y * .21f); } }
void Start() { movements = GetComponent <Movement>(); defensives = GetComponent <Defense>(); MouseCtrl = GetComponent <MouseControl>(); Charstats = GetComponent <CharacterStatus>(); animator = GetComponent <Animator>(); Target = MouseCtrl.SelectedObject; EquippedSpell = Spells[0]; movements.EquippedSpell = Spells[0]; foreach (AbstractSpell AS in Spells) { AS.Init(); } foreach (AbstractSpell AS in DefensiveSpells) { AS.Init(); } }