public void SetTarget(plyVariables variables, GameObject variablesOwner)
 {
     this.variables       = variables;
     this.variablesOwner  = variablesOwner;
     this.isOnSceneObject = (!((UnityEngine.Object)variablesOwner == (UnityEngine.Object)null) && plyEdUtil.IsSceneObject(variablesOwner));
     this.varsList.list   = ((variables != null) ? variables.varDefs : null);
 }
Beispiel #2
0
 private plyVar FindVariable(plyVariables vars, string name)
 {
     for (int i = 0; i < vars.varDefs.Count; i++)
     {
         if (vars.varDefs[i].name == name)
         {
             return(vars.varDefs[i]);
         }
     }
     return(null);
 }
Beispiel #3
0
        public void Deserialize()
        {
            this.bloxLoaded = true;
            plyVariables obj = this.variables;

            if (obj != null)
            {
                obj.BuildCache();
            }
            for (int i = 0; i < this.events.Length; i++)
            {
                this.events[i].Deserialize(this);
            }
        }
 public plyVariablesEditor(plyVariables variables, plyVariablesType varsType, GameObject variablesOwner, bool canEditValues, bool canEditVariables, bool displayHeader, Action repaint, Action save, plyReorderableList.Button[] extraButtons)
 {
     plyVariablesEditor.LoadVarEds();
     this.variables        = variables;
     this.varsType         = varsType;
     this.variablesOwner   = variablesOwner;
     this.isOnSceneObject  = (!((UnityEngine.Object)variablesOwner == (UnityEngine.Object)null) && plyEdUtil.IsSceneObject(variablesOwner));
     this.canEditValues    = canEditValues;
     this.canEditVariables = canEditVariables;
     this.repaint          = repaint;
     this.save             = save;
     if (extraButtons == null)
     {
         extraButtons = new plyReorderableList.Button[0];
     }
     if (canEditVariables)
     {
         ArrayUtility.Add(ref extraButtons, new plyReorderableList.Button
         {
             label           = new GUIContent(Ico._rename, "Rename selected Variable"),
             callback        = this.OnRenameButton,
             requireSelected = true
         });
     }
     if (canEditVariables)
     {
         this.varsList = new plyReorderableList((variables != null) ? variables.varDefs : null, typeof(plyVar), false, true, true, true, false, false, extraButtons, null);
         this.varsList.elementHeight       = (float)((float)((!canEditValues) ? 1 : 2) * (EditorGUIUtility.singleLineHeight + 2.0) + 4.0);
         this.varsList.drawHeaderCallback  = this.DrawListHeader;
         this.varsList.drawElementCallback = this.DrawElement;
         this.varsList.onAddElement        = this.OnAdd;
         this.varsList.onRemoveElement     = this.OnRemove;
         this.varsList.onReorder           = null;
     }
     else
     {
         this.varsList = new plyReorderableList((variables != null) ? variables.varDefs : null, typeof(plyVar), false, displayHeader, false, false, false, false, extraButtons, null);
         this.varsList.elementHeight = (float)((float)((!canEditValues) ? 1 : 2) * (EditorGUIUtility.singleLineHeight + 2.0) + 4.0);
         if (displayHeader)
         {
             this.varsList.drawHeaderCallback = this.DrawListHeader;
         }
         this.varsList.drawElementCallback = this.DrawElement;
         this.varsList.onAddElement        = null;
         this.varsList.onRemoveElement     = null;
         this.varsList.onReorder           = null;
     }
 }
Beispiel #5
0
        public void Serialize()
        {
            //Debug.Log("Serialize", "Blox", Color.yellow);
            plyVariables obj = this.variables;

            if (obj != null)
            {
                obj.Serialize();
            }
            if (this._isDirty)
            {
                this._isDirty = false;
                for (int i = 0; i < this.events.Length; i++)
                {
                    this.events[i].Serialize();
                }
            }
        }
Beispiel #6
0
 protected void OnEnable()
 {
     this.bloxLoaded = false;
     if (this.scriptDirty)
     {
         Debug.Log("OnEnable", "BloxEditorWindow", Color.yellow);
         this.Deserialize();
     }
     else
     {
         plyVariables obj = this.variables;
         if (obj != null)
         {
             obj.BuildCache();
         }
         this.scriptType = BloxUtil.GetType("BloxGenerated." + this.ident, "Assembly-CSharp, Version=0.0.0.0, Culture=neutral");
     }
 }
Beispiel #7
0
        public void Deserialize()
        {
            //Debug.Log("Deserialize", "Blox", Color.yellow);
            this.bloxLoaded = true;
            plyVariables obj = this.variables;

            if (obj != null)
            {
                obj.BuildCache();
            }
            if (Application.isPlaying && !Application.isEditor)
            {
                return;
            }
            for (int i = 0; i < this.events.Length; i++)
            {
                this.events[i].Deserialize(this);
            }
        }