public void OnProjectOrHierarchyChanged(GameObject[] setTargets, IInspector inspector)
        {
            targets = setTargets;

                        #if UNITY_EDITOR
            if (editor == null || Editors.DisposeIfInvalid(ref editor))
            {
                inspector.InspectorDrawer.Editors.GetEditorInternal(ref editor, ArrayPool <GameObject> .Cast <Object>(targets), null, true);
            }
                        #endif
        }
예제 #2
0
        /// <inheritdoc/>
        protected override void DoPasteFromClipboard()
        {
            //var type = Type;
            if (memberInfo != null && memberInfo.MixedContent)
            {
                object multipleValues = null;
                if (Clipboard.TryPaste(typeof(Color[]), ref multipleValues))
                {
                    var array = multipleValues as object[];
                    if (array != null)
                    {
                        if (Type == Types.Color)
                        {
                            SetValues(array);
                        }
                        else
                        {
                            var colors32 = ArrayPool <object> .CastToValueTypeArray <Color32>(array);

                            var colors = ArrayPool <Color32> .CastToValueTypeArray <Color>(colors32);

                            var objs = ArrayPool <Color> .Cast <object>(colors);

                            SetValues(objs);
                        }
                        return;
                    }
                }
                else
                {
                    if (Clipboard.TryPaste(typeof(Color32[]), ref multipleValues))
                    {
                        var array = multipleValues as object[];
                        if (array != null)
                        {
                            if (Type == Types.Color32)
                            {
                                SetValues(array);
                            }
                            else
                            {
                                var colors = ArrayPool <object> .CastToValueTypeArray <Color>(array);

                                var colors32 = ArrayPool <Color> .CastToValueTypeArray <Color32>(colors);

                                var objs = ArrayPool <Color32> .Cast <object>(colors32);

                                SetValues(objs);
                            }
                            return;
                        }
                    }
                }
            }

            object setValue = default(Color);

            if (Clipboard.TryPaste(Types.Color, ref setValue))
            {
                SetValue(FromColor(setValue));
            }
            else
            {
                setValue = Clipboard.Paste(Types.Color32);
                if (Type == Types.Color32)
                {
                    SetValue(setValue);
                }
                else
                {
                    SetValue(ToColor(setValue));
                }
            }
        }
예제 #3
0
 /// <inheritdoc/>
 protected override void FindReferencesInScene()
 {
     DrawGUI.ExecuteMenuItem("CONTEXT/Component/Find References In Scene", ArrayPool <Component> .Cast <Object>(targets));
 }