Exemplo n.º 1
0
            public WindowComponentParametersBase OnComponentChanged(WindowBase window, WindowComponent newComponent)
            {
                var hasChanged = (newComponent != this.component);

                this.component = newComponent;

                WindowComponentParametersBase instance = null;

                if (hasChanged == true)
                {
                                        #if UNITY_EDITOR
                    if (this.componentParameters != null)
                    {
                        var link = this.componentParameters;
                        //UnityEditor.EditorApplication.delayCall += () => {

                        Object.DestroyImmediate(link, allowDestroyingAssets: true);

                        //};
                    }
                                        #endif

                    instance = Layout.AddParametersFor(window, this.component);
                    this.componentParameters = instance;
                }
                else
                {
                    instance = this.componentParameters;
                }

                return(instance);
            }
            public WindowComponentParametersBase OnComponentChanged(WindowBase window, WindowComponent newComponent)
            {
                var hasChanged = (newComponent != this.component);

                this.component = newComponent;

                WindowComponentParametersBase instance = null;

                if (hasChanged == true)
                {
                    if (newComponent == null)
                    {
                        this.componentResource.ResetToDefault();
                    }

                    if (this.componentParameters != null)
                    {
                        var link = this.componentParameters;
                        //UnityEditor.EditorApplication.delayCall += () => {

                        Object.DestroyImmediate(link, allowDestroyingAssets: true);

                        //};
                    }

                    instance = Layout.AddParametersFor(window, this.component);
                    this.componentParameters = instance;

                    this.OnValidate();
                }
                else
                {
                    instance = this.componentParameters;
                }

                return(instance);
            }
Exemplo n.º 3
0
 public static WindowComponentParametersBase AddParametersFor(WindowBase window, WindowComponent component)
 {
     return(Layout.AddParametersFor(window.gameObject, component));
 }