示例#1
0
 public override void UpdateUI(bool isOk)
 {
     if (isOk)
     {
         Compiler.instance.Uncompile();
         oldI = i.text;
         type = GetNewType(typeInput.text);
         if (!(oldVar == var.text))
         {
             if (VariableManager.Create(var.text, type, VariableManager.StructureType.Array))
             {
                 VariableManager.RemoveFromList(oldVar);
                 oldVar  = var.text;
                 oldType = typeInput.text;
             }
         }
         else if (!(oldType == typeInput.text))
         {
             VariableManager.RemoveFromList(oldVar);
             VariableManager.Create(var.text, type, VariableManager.StructureType.Array);
             oldVar  = var.text;
             oldType = typeInput.text;
         }
         Bloco.changed = true;
         ToUI();
     }
     else
     {
         var.text       = oldVar;
         i.text         = oldI;
         typeInput.text = oldType;
     }
 }
示例#2
0
 public override void UpdateUI(bool isOk)
 {
     if (isOk)
     {
         oldI = i.text;
         type = GetType(typeInput.text);
         if (!(oldVar == var.text))
         {
             if (VariableManager.Create(var.text, type, VariableManager.StructureType.Array))
             {
                 VariableManager.RemoveFromList(oldVar);
                 oldVar  = var.text;
                 oldType = typeInput.text;
             }
         }
         else if (!(oldType == typeInput.text))
         {
             VariableManager.RemoveFromList(oldVar);
             VariableManager.Create(var.text, type, VariableManager.StructureType.Array);
             oldVar  = var.text;
             oldType = typeInput.text;
         }
     }
     else
     {
         var.text       = oldVar;
         i.text         = oldI;
         typeInput.text = oldType;
     }
     ToUI();
     return;
 }
示例#3
0
 public override void UpdateUI(bool isOk)
 {
     if (isOk)
     {
         Compiler.instance.Uncompile();
         type = GetNewType(typeInput.text);
         Debug.Log("teste " + type);
         if (!(oldVar == var.text))
         {
             if (VariableManager.Create(var.text, type, VariableManager.StructureType.Variable))
             {
                 VariableManager.RemoveFromList(oldVar);
                 oldVar        = var.text;
                 oldType       = typeInput.text;
                 Bloco.changed = true;
             }
         }
         else if (!(oldType == typeInput.text))
         {
             VariableManager.RemoveFromList(oldVar);
             VariableManager.Create(var.text, type, VariableManager.StructureType.Variable);
             oldVar        = var.text;
             oldType       = typeInput.text;
             Bloco.changed = true;
         }
     }
     else
     {
         var.text = oldVar;
     }
     Debug.Log(oldVar);
     Bloco.changed = true;
     ToUI();
     return;
 }
示例#4
0
 // Start is called before the first frame update
 void Awake()
 {
     name.text = VariableManager.NextName();
     VariableManager.Create(name.text, VariableManager.Type.Int, type);
 }