Beispiel #1
0
 protected override void DrawSelected(CharacterAttributeDef def)
 {
     def.initialValue = EditorGUILayout.FloatField(EdAttributeDefinitions.GC_AttrInitialValue, def.initialValue);
     DataProviderEd.DataBindingField(EdAttributeDefinitions.GC_AttrModifiers, def.valueModifier, BloxEdGlobal.AttributeDefs, false, null);
     def.initialMaxVal = EditorGUILayout.FloatField(EdAttributeDefinitions.GC_AttrInitialMax, def.initialMaxVal);
     DataProviderEd.DataBindingField(EdAttributeDefinitions.GC_AttrModifiers, def.maxValModifier, BloxEdGlobal.AttributeDefs, false, null);
     def.resetValueToMax = EditorGUILayout.Toggle(EdAttributeDefinitions.GC_AttrInitValMax, def.resetValueToMax);
     EditorGUILayout.Space();
 }
Beispiel #2
0
 private void RemoveComparisonComponent(int index)
 {
     if ((UnityEngine.Object) this.Target.screens[index].watchVariable != (UnityEngine.Object)null)
     {
         DataProviderEd.DestroyDataprovider(this.Target.screens[index].watchVariable);
         this.Target.screens[index].watchVariable = null;
         plyEdUtil.SetDirty(this.Target);
     }
 }
Beispiel #3
0
        public override SimpleParamInfo[] GetSetterParams(DataProvider target)
        {
            ManagedProperty property = PropertiesManagerEd.GetProperty((target as ManagedPropertyRefProvider).propertyName);

            if (property != null && property.setter != null)
            {
                return(DataProviderEd.GetBindParams(property.setter));
            }
            return(new SimpleParamInfo[0]);
        }
Beispiel #4
0
 protected void OnEnable()
 {
     this.p_onSpashScreenShown  = base.serializedObject.FindProperty("onSpashScreenShown");
     this.p_onSpashScreenHidden = base.serializedObject.FindProperty("onSpashScreenHidden");
     this.p_onSpashScreensDone  = base.serializedObject.FindProperty("onSpashScreensDone");
     if (this.comparisonCheckEd == null)
     {
         this.comparisonCheckEd = DataProviderEd.factory.CreateEditor(typeof(ComparisonDataProvider));
     }
 }
 public static void RemoveProperty(int idx)
 {
     DataProviderEd.DestroyDataprovider(PropertiesManagerEd.PropertiesManager.properties[idx].getter.dataprovider);
     DataProviderEd.DestroyDataprovider(PropertiesManagerEd.PropertiesManager.properties[idx].setter.dataprovider);
     PropertiesManagerEd.PropertiesManager.properties.RemoveAt(idx);
     plyEdUtil.SetDirty(PropertiesManagerEd.PropertiesManager);
     PropertiesManagerEd._managedPropertyLabels = new GUIContent[PropertiesManagerEd._propertiesManager.properties.Count];
     for (int i = 0; i < PropertiesManagerEd._propertiesManager.properties.Count; i++)
     {
         PropertiesManagerEd._managedPropertyLabels[i] = new GUIContent(PropertiesManagerEd._propertiesManager.properties[i].propertyName);
     }
 }
Beispiel #6
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            UIDropdownUpdater uIDropdownUpdater = (UIDropdownUpdater)base.target;

            DataProviderEd.DataBindingField(UIDropdownUpdaterInspector.GC_LabelsSource, uIDropdownUpdater.labelsSource, uIDropdownUpdater, false, UIDropdownUpdaterInspector.limitTypes);
            if (GUI.changed)
            {
                plyEdUtil.SetDirty(uIDropdownUpdater);
                GUI.changed = false;
            }
        }
        public override void OnInspectorGUI()
        {
            UIButtonAction uIButtonAction = (UIButtonAction)base.target;

            base.serializedObject.Update();
            EditorGUILayout.PropertyField(this.prop_button, UIButtonActionInspector.GC_Target);
            base.serializedObject.ApplyModifiedProperties();
            DataProviderEd.DataBindingField(UIButtonActionInspector.GC_ClickAction, uIButtonAction.databinding, uIButtonAction, true, null);
            EditorGUILayout.Space();
            base.OnInspectorGUI();
            if (GUI.changed)
            {
                plyEdUtil.SetDirty(uIButtonAction);
                GUI.changed = false;
            }
        }
Beispiel #8
0
        private void DrawElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            Rect rect2 = rect;

            rect2.y     += 3f;
            rect2.height = EditorGUIUtility.singleLineHeight;
            this.Target.screens[index].target = (GameObject)EditorGUI.ObjectField(rect2, this.Target.screens[index].target, typeof(GameObject), true);
            rect2.y += (float)(rect2.height + 2.0);
            if (this.Target.screens[index].waitType == SplashScreensManager.SplashScreen.WaitType.Timeout)
            {
                this.RemoveComparisonComponent(index);
                rect2.width /= 2f;
                this.Target.screens[index].waitType = (SplashScreensManager.SplashScreen.WaitType)EditorGUI.EnumPopup(rect2, (Enum)(object)this.Target.screens[index].waitType);
                float x = GUI.skin.label.CalcSize(SplashScreensManagerInspector.GC_Seconds).x;
                rect2.x     += (float)(rect2.width + 2.0);
                rect2.width -= (float)(2.0 + x);
                this.Target.screens[index].timeout = EditorGUI.FloatField(rect2, this.Target.screens[index].timeout);
                rect2.x    += rect2.width;
                rect2.width = x;
                GUI.Label(rect2, SplashScreensManagerInspector.GC_Seconds);
            }
            else if (this.Target.screens[index].waitType == SplashScreensManager.SplashScreen.WaitType.WatchVariable)
            {
                if ((UnityEngine.Object) this.Target.screens[index].watchVariable == (UnityEngine.Object)null)
                {
                    this.Target.screens[index].watchVariable = DataProviderEd.CreateDataprovider <ComparisonDataProvider>("", false);
                    plyEdUtil.SetDirty(this.Target);
                }
                rect2.width = 18f;
                this.Target.screens[index].waitType = (SplashScreensManager.SplashScreen.WaitType)EditorGUI.EnumPopup(rect2, (Enum)(object)this.Target.screens[index].waitType);
                rect2.x    += 19f;
                rect2.width = (float)(rect.width - 19.0);
                this.comparisonCheckEd.DrawEditor(rect2, this.Target.screens[index].watchVariable, false);
            }
            else if (this.Target.screens[index].waitType == SplashScreensManager.SplashScreen.WaitType.WaitScreenEndTrigger)
            {
                this.RemoveComparisonComponent(index);
                this.Target.screens[index].waitType = (SplashScreensManager.SplashScreen.WaitType)EditorGUI.EnumPopup(rect2, (Enum)(object)this.Target.screens[index].waitType);
            }
            rect2.x     = rect.x;
            rect2.width = rect.width;
            rect2.y    += (float)(rect2.height + 2.0);
            rect2.width = rect.width;
            this.Target.screens[index].playerCanSkip = EditorGUI.ToggleLeft(rect2, SplashScreensManagerInspector.GC_PlayerSkip, this.Target.screens[index].playerCanSkip);
        }
Beispiel #9
0
        protected override void Draw(Rect rect, DataProvider target, bool isSetter)
        {
            ManagedPropertyRefProvider managedPropertyRefProvider = target as ManagedPropertyRefProvider;

            EditorGUIUtility.labelWidth = 30f;
            rect.height = EditorGUIUtility.singleLineHeight;
            Rect rect2 = rect;

            rect2.width = EditorGUIUtility.labelWidth;
            GUI.Label(rect2, isSetter ? ManagedPropertyRefProviderEd.GC_SetVar : ManagedPropertyRefProviderEd.GC_GetVar);
            rect2.x    += EditorGUIUtility.labelWidth;
            rect2.width = rect.width - EditorGUIUtility.labelWidth;
            managedPropertyRefProvider.propertyName = plyEdGUI.PopupTextField(rect2, managedPropertyRefProvider.propertyName, PropertiesManagerEd.PropertyLabels, false);
            if (isSetter)
            {
                rect.y += (float)(EditorGUIUtility.singleLineHeight + 2.0);
                managedPropertyRefProvider.valSetterSource = DataProviderEd.DataBindingValueSourceField(rect, ManagedPropertyRefProviderEd.GC_ToVal, managedPropertyRefProvider.valSetterSource, ManagedPropertyRefProviderEd.GC_ToValBindWin, managedPropertyRefProvider);
            }
        }
Beispiel #10
0
        protected override void Draw(Rect rect, DataProvider target, bool isSetter)
        {
            AttributeDataProvider attributeDataProvider = target as AttributeDataProvider;

            EditorGUIUtility.labelWidth = 30f;
            float num   = (float)((rect.width - EditorGUIUtility.labelWidth - 2.0) / 2.0);
            Rect  rect2 = rect;

            rect2.height = EditorGUIUtility.singleLineHeight;
            rect2.width  = EditorGUIUtility.labelWidth;
            GUI.Label(rect2, isSetter ? AttributeDataProviderEd.GC_SetAtt : AttributeDataProviderEd.GC_GetAtt);
            rect2.x    += EditorGUIUtility.labelWidth;
            rect2.width = num;
            attributeDataProvider.attId = plyEdGUI.IdxIdConvertedPopup(rect2, attributeDataProvider.attId, BloxEdGlobal.AttributeDefs.Labels(), BloxEdGlobal.AttributeDefs);
            rect2.x += (float)(num + 2.0);
            attributeDataProvider.attValType = (AttributeDataProvider.ValueType)EditorGUI.EnumPopup(rect2, (Enum)(object)attributeDataProvider.attValType);
            rect2.y    += (float)(EditorGUIUtility.singleLineHeight + 2.0);
            rect2.x     = rect.x;
            rect2.width = EditorGUIUtility.labelWidth;
            GUI.Label(rect2, AttributeDataProviderEd.GC_Of);
            rect2.x    += EditorGUIUtility.labelWidth;
            rect2.width = ((attributeDataProvider.attSource == AttributeDataProvider.ValueSource.Caller) ? (rect.width - EditorGUIUtility.labelWidth) : num);
            attributeDataProvider.attSource = (AttributeDataProvider.ValueSource)EditorGUI.EnumPopup(rect2, (Enum)(object)attributeDataProvider.attSource);
            if (attributeDataProvider.attSource == AttributeDataProvider.ValueSource.Target)
            {
                rect2.x += (float)(num + 2.0);
                DataProviderEd.DataBindingField(rect2, null, attributeDataProvider.attOwnerBind, attributeDataProvider, false, AttributeDataProviderEd.limitTypes);
            }
            if (isSetter)
            {
                rect2.y    += (float)(EditorGUIUtility.singleLineHeight + 2.0);
                rect2.x     = rect.x;
                rect2.width = rect.width;
                attributeDataProvider.valSetterSource = DataProviderEd.DataBindingValueSourceField(rect2, AttributeDataProviderEd.GC_ToVal, attributeDataProvider.valSetterSource, AttributeDataProviderEd.GC_ToValBindWin, attributeDataProvider);
            }
        }
        protected override void Draw(Rect rect, DataProvider target, bool isSetter)
        {
            plyVarDataProvider plyVarDataProvider = target as plyVarDataProvider;

            EditorGUIUtility.labelWidth = 30f;
            rect.height = EditorGUIUtility.singleLineHeight;
            Rect  rect2 = rect;
            float num   = (float)((rect.width - (EditorGUIUtility.labelWidth + 3.0)) / 3.0);

            rect2.width = EditorGUIUtility.labelWidth;
            GUI.Label(rect2, isSetter ? plyVarDataProviderEd.GC_SetVar : plyVarDataProviderEd.GC_GetVar);
            rect2.x    += EditorGUIUtility.labelWidth;
            rect2.width = num;
            plyVarDataProvider.varType = (plyVarDataProvider.VariableType)EditorGUI.EnumPopup(rect2, (Enum)(object)plyVarDataProvider.varType);
            rect2.x    += (float)(num + 3.0);
            rect2.width = (float)(rect.width - (num + EditorGUIUtility.labelWidth + 3.0));
            plyVarDataProvider.varName = plyEdGUI.InlineLabelTextField(rect2, plyVarDataProviderEd.GC_VarName, plyVarDataProvider.varName);
            rect2.x += EditorGUIUtility.labelWidth;
            if (plyVarDataProvider.varType != 0)
            {
                rect2.y    += (float)(EditorGUIUtility.singleLineHeight + 2.0);
                rect2.x     = rect.x;
                rect2.width = EditorGUIUtility.labelWidth;
                GUI.Label(rect2, plyVarDataProviderEd.GC_Of);
                rect2.x    += EditorGUIUtility.labelWidth;
                rect2.width = num;
                plyVarDataProvider.sourceObjType = (plyVarDataProvider.DataSourceOject)EditorGUI.EnumPopup(rect2, (Enum)(object)plyVarDataProvider.sourceObjType);
                rect2.x    += (float)(num + 3.0);
                rect2.width = (float)(rect.width - (num + EditorGUIUtility.labelWidth + 3.0));
                if (plyVarDataProvider.varType == plyVarDataProvider.VariableType.Blox)
                {
                    rect2.width = (float)((rect2.width - 5.0) / 2.0);
                }
                if (plyVarDataProvider.sourceObjType != plyVarDataProvider.DataSourceOject.OfOwner)
                {
                    plyVarDataProvider.objNameOrTag = plyEdGUI.InlineLabelTextField(rect2, (plyVarDataProvider.sourceObjType == plyVarDataProvider.DataSourceOject.ObjWithName) ? plyVarDataProviderEd.GC_ObjName : plyVarDataProviderEd.GC_TagName, plyVarDataProvider.objNameOrTag);
                }
                if (plyVarDataProvider.varType == plyVarDataProvider.VariableType.Blox)
                {
                    Blox blox = null;
                    if (!string.IsNullOrEmpty(plyVarDataProvider.bloxIdent))
                    {
                        blox = BloxEd.GetBloxDef(plyVarDataProvider.bloxIdent);
                        if ((UnityEngine.Object)blox == (UnityEngine.Object)null)
                        {
                            plyVarDataProvider.bloxIdent = "";
                        }
                        else
                        {
                            plyVarDataProviderEd.GC_BloxName.text = blox.screenName;
                        }
                    }
                    plyVarDataProviderEd.GC_BloxName.text = (((UnityEngine.Object)blox == (UnityEngine.Object)null) ? "-select-" : blox.screenName);
                    rect2.x += (float)(rect2.width + 3.0);
                    if (GUI.Button(rect2, plyVarDataProviderEd.GC_BloxName))
                    {
                        BloxListPopup.Show_BloxListPopup(null, this.OnBloxSelected, new object[1]
                        {
                            plyVarDataProvider
                        });
                    }
                }
            }
            if (isSetter)
            {
                rect2.y    += (float)(EditorGUIUtility.singleLineHeight + 2.0);
                rect2.x     = rect.x;
                rect2.width = rect.width;
                plyVarDataProvider.valSetterSource = DataProviderEd.DataBindingValueSourceField(rect2, plyVarDataProviderEd.GC_ToVal, plyVarDataProvider.valSetterSource, plyVarDataProviderEd.GC_ToValBindWin, plyVarDataProvider);
            }
        }
Beispiel #12
0
        private void DrawPropertiesListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            ManagedProperty managedProperty = PropertiesManagerEd.PropertiesManager.properties[index];
            float           num             = (float)(rect.width / 3.0 - 10.0);
            Rect            rect2           = new Rect(rect.x, (float)(rect.y + 2.0), num, EditorGUIUtility.singleLineHeight);

            rect2.width = 20f;
            if (GUI.Button(rect2, MainEditorPanel.GC_RestoreDuringBootstrap[(!managedProperty.runDuringBoot) ? 1 : 0], plyEdGUI.Styles.SmallButtonFlat))
            {
                managedProperty.runDuringBoot = !managedProperty.runDuringBoot;
                plyEdUtil.SetDirty(PropertiesManagerEd.PropertiesManager);
            }
            MainEditorPanel.GC_s0.text = managedProperty.propertyName;
            rect2.x    += 20f;
            rect2.width = (float)(num - 20.0);
            GUI.Label(rect2, MainEditorPanel.GC_s0);
            MainEditorPanel.GC_s1.text = "[none]";
            Type type  = managedProperty.getter.DataType(true);
            Type type2 = managedProperty.setter.DataType(false);

            if (type != null || type2 != null)
            {
                if (type == type2)
                {
                    MainEditorPanel.GC_s1.text = "[" + BloxEd.PrettyTypeName(type, true) + "]";
                }
                else if (type == null || type2 == null)
                {
                    MainEditorPanel.GC_s1.text = "[" + BloxEd.PrettyTypeName(type, true) + "|" + BloxEd.PrettyTypeName(type2, true) + "]";
                }
                else
                {
                    MainEditorPanel.GC_s1.text = "[<color=red>" + BloxEd.PrettyTypeName(type, true) + "|" + BloxEd.PrettyTypeName(type2, true) + "</color>]";
                }
            }
            Vector2 vector = GUI.skin.label.CalcSize(MainEditorPanel.GC_s0);

            vector.x += 2f;
            Vector2 vector2  = plyEdGUI.Styles.Label_RT.CalcSize(MainEditorPanel.GC_s1);
            Rect    position = new Rect(rect2.xMax - vector2.x, rect2.y, vector2.x, rect2.height);

            if (position.x < rect2.x + vector.x)
            {
                position.x     = rect2.x + vector.x;
                position.width = rect2.xMax - (rect2.x + vector.x);
            }
            if (position.width > 0.0)
            {
                GUI.Label(position, MainEditorPanel.GC_s1, plyEdGUI.Styles.Label_RT);
            }
            rect2.x    += (float)(rect2.width + 10.0);
            rect2.width = 20f;
            GUI.Label(rect2, MainEditorPanel.GC_PropertyGetter, plyEdGUI.Styles.Label);
            rect2.x    += 20f;
            rect2.width = (float)(num - 20.0);
            DataProviderEd.DataBindingField(rect2, null, managedProperty.getter, PropertiesManagerEd.PropertiesManager, false, null);
            rect2.x    += (float)(rect2.width + 10.0);
            rect2.width = 20f;
            GUI.Label(rect2, MainEditorPanel.GC_PropertySetter, plyEdGUI.Styles.Label);
            rect2.x    += 20f;
            rect2.width = (float)(num - 20.0);
            DataProviderEd.DataBindingField(rect2, null, managedProperty.setter, PropertiesManagerEd.PropertiesManager, true, null);
        }