Beispiel #1
0
        void DrawWin(int id)
        {
            base.DrawNodeWindow(id);
            if (GetChildTexture() != null)
            {
                if (texChildOrigin != GetChildTexture())
                {
                    UpdateTex();
                }

                //lsy : new remap ratio
                texChildOrigin_Width  = texChildOrigin.width;
                texChildOrigin_Height = texChildOrigin.height;

                if (textureEx != null)
                {
                    GUI.DrawTexture(rectArea, textureEx.Texture, ScaleMode.StretchToFill);
                }


                if (GUI.Button(new Rect(rectBotButton.x, rectBotButton.y, rectBotButton.width - buttonHeight, rectBotButton.height), "Edit", SWEditorUI.MainSkin.button))
                {
                    SWWindowDrawRemap.ShowEditor(this);
                }
                if (GUI.Button(new Rect(rectBotButton.x + rectBotButton.width - buttonHeight, rectBotButton.y, buttonHeight, rectBotButton.height), "+", SWEditorUI.MainSkin.button))
                {
                    data.useCustomTexture = !data.useCustomTexture;
                }
            }

            DrawNodeWindowEnd();
        }
        public override void Update()
        {
            Instance = this;
            if (!CanUpdate())
            {
                return;
            }
            base.Update();

            //[Main window close]    or    [related node deleted] ===>  close this window
            if (SWWindowMain.Instance == null || !SWWindowMain.Instance.NodeAll().ContainsKey(node.data.id))
            {
                Close();
                return;
            }
            SWWindowMain.Instance.NodeAll() [node.data.id] = (SWNodeBase)node;
        }