Example #1
0
 public UnityObjectProperties(ExposeProperties owner, PropertyInfo info, ExposePropertyAttribute attribute)
     : base(owner, attribute.Order, info)
 {
     _Field = new Skill.Editor.UI.UntypedObjectField(Info.PropertyType.IsArray ? Info.PropertyType.GetElementType() : Info.PropertyType);
     _Field.ObjectChanged += ObjectField_ValueChanged;
     _Field.Label.text     = attribute.Name;
     _Field.Label.tooltip  = attribute.Description;
 }
Example #2
0
            protected override void RefreshData()
            {
                base.RefreshData();

                if (_ClipField == null)
                {
                    foreach (var c in Controls)
                    {
                        if (_ClipField == null && c is Skill.Editor.UI.UntypedObjectField)
                        {
                            if (((Skill.Editor.UI.UntypedObjectField)c).ObjectType == typeof(AudioClip))
                            {
                                _ClipField = (Skill.Editor.UI.UntypedObjectField)c;
                                _ClipField.ObjectChanged += _ClipField_ObjectChanged;
                            }
                        }
                        else if (c is Skill.Editor.UI.FloatField)
                        {
                            Skill.Editor.UI.FloatField ff = (Skill.Editor.UI.FloatField)c;

                            if (ff.Label.text == "Start" || ff.Label.text == "End")
                            {
                                ff.ValueChanged += StartEnd_ValueChanged;
                            }
                        }
                    }
                }

                _BtnPreview.IsPressed = false;
                _BreakPointsEditor.RefreshData();
                _NextStateOptions.Options.Clear();
                AudioStateGraphEditor editor = _Node.FindInParents <AudioStateGraphEditor>();

                AudioStateNode[] states = editor.GetStates();

                Skill.Editor.UI.PopupOption noneOp = new Skill.Editor.UI.PopupOption(-1, " ");
                _NextStateOptions.Options.Add(noneOp);

                Skill.Editor.UI.PopupOption selectedOp = noneOp;
                for (int i = 0; i < states.Length; i++)
                {
                    if (states[i] == _Node)
                    {
                        continue;
                    }
                    Skill.Editor.UI.PopupOption op = new Skill.Editor.UI.PopupOption(i, states[i].StateName);
                    op.UserData = states[i];
                    if (states[i] == _Node.NextState)
                    {
                        selectedOp = op;
                    }
                    _NextStateOptions.Options.Add(op);
                }
                _NextStateOptions.SelectedOption = selectedOp;
            }