public VisualEditor.BackEnd.Spell GetSpell() { VisualEditor.BackEnd.Node[] nodes = new VisualEditor.BackEnd.Node[allNodes.Count]; for (int i = 0; i < allNodes.Count; i++) { nodes[i] = allNodes[i].GetComponent <NodeVisual>().node; } VisualEditor.BackEnd.Spell spell = new VisualEditor.BackEnd.Spell(nodes, saveName); return(spell); }
void Update() { for (int i = (int)KeyCode.Alpha1; i < (int)KeyCode.Alpha1 + spells.Length; i++) { if (Input.GetKeyDown((KeyCode)i)) { VisualEditor.BackEnd.Spell sp = spells[i - (int)KeyCode.Alpha1]; if (sp.running) { sp.Stop(); } else { sp.Run(); } } } }
internal void PlayStopSpell() { if (spell == null) { spell = GetSpell(); //hide UI and spawn player activeManager.Hide(); testPlayer = Instantiate(Resources.Load <GameObject>("Player local")); testTerrain = Instantiate(Resources.Load <GameObject>("Test terrain")); Camera.main.GetComponent <CameraControl>().UpdatePlayerList(); testSpellManager = SpellInGameManager.Create(new VisualEditor.BackEnd.Spell[] { spell }); } else { Destroy(testPlayer); Destroy(testTerrain); Destroy(testSpellManager.gameObject); activeManager.Show(); spell.Stop(); spell = null; ResetNodes(); } }