コード例 #1
0
        protected virtual void Awake()
        {
            Instance = this;

            cameraPos = new Vector2(32768 - 400, 32768 - 300);
        }
コード例 #2
0
        public bool InitializeInstance(Shader initShader = null)
        {
            //Setting Initialization

            this.initialized = true;

            preview   = new VS_PreviewWindow();
            statusBox = new VS_StatusBox();
            statusBox.Initialize();

            //Use Scriptable Object Because we can use Undo ......  which Unity Provide
            ScriptableObject.CreateInstance <VVS_PassSettings>();


            //InitializeNodeTemplates();

            windowStyle         = new GUIStyle(EditorStyles.textField);
            windowStyle.margin  = new RectOffset(0, 0, 0, 0);
            windowStyle.padding = new RectOffset(0, 0, 0, 0);

            titleStyle          = new GUIStyle(EditorStyles.largeLabel);
            titleStyle.fontSize = 24;

            versionStyle                  = new GUIStyle(EditorStyles.miniBoldLabel);
            versionStyle.alignment        = TextAnchor.MiddleLeft;
            versionStyle.fontSize         = 9;
            versionStyle.normal.textColor = Color.gray;
            versionStyle.padding.left     = 1;
            versionStyle.padding.top      = 1;
            versionStyle.padding.bottom   = 1;
            versionStyle.margin.left      = 1;
            versionStyle.margin.top       = 3;
            versionStyle.margin.bottom    = 1;

            separatorLeft  = new DraggableSeparator(VS_GUI.Handle_drag);
            separatorRight = new DraggableSeparator(VS_GUI.Handle_drag);

            separatorLeft.rect  = new Rect(340, 0, 0, 0);
            separatorRight.rect = new Rect(Screen.width - 130f, 0, 0, 0);


            //Create Nodes List

            this.nodes = new List <VS_Node>();

            // Create main output node and add to list
            nodeCanvas = VS_NodeCanvas.CreateInstance <VS_NodeCanvas>();


            this.previousPosition = position;

            if (initShader == null)
            {
                // TODO: New menu etc
                //CreateOutputNode();
            }
            else
            {
                //currentShaderAsset = initShader;

                //Load Shader......
            }

            return(true);
        }