Ejemplo n.º 1
0
        private void CreateVariable(plyVarCreateWiz wiz)
        {
            plyVar var = wiz.var;

            wiz.Close();
            this.varEditor.VariableWasAdded();
            if (!string.IsNullOrEmpty(var.name))
            {
                if (plyEdUtil.StringIsUnique(this.blox.variables.varDefs, var.name))
                {
                    var.ident = this.blox.variables.CreateVariableIdent();
                    this.blox.variables.varDefs.Add(var);
                    this.Save();
                    BloxContainerInspector instance = BloxContainerInspector.Instance;
                    if ((object)instance != null)
                    {
                        instance.OnBloxVariablesChanged(this.blox.ident);
                    }
                }
                else
                {
                    EditorUtility.DisplayDialog("Variables", "The variable name must be unique.", "OK");
                }
            }
        }
Ejemplo n.º 2
0
        private void CreateVariable(plyVarCreateWiz wiz)
        {
            plyVar var = wiz.var;

            wiz.Close();
            this.varEditor.VariableWasAdded();
            if (!string.IsNullOrEmpty(var.name))
            {
                if (plyEdUtil.StringIsUnique(this.blox.variables.varDefs, var.name))
                {
                    var.ident = this.blox.variables.CreateVariableIdent();
                    this.blox.variables.varDefs.Add(var);
                    this.Save();
                }
                else
                {
                    EditorUtility.DisplayDialog("Variables", "The variable name must be unique.", "OK");
                }
            }
        }