示例#1
0
 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);
 }
示例#2
0
 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();
             }
         }
     }
 }
示例#3
0
    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();
        }
    }