public override void Init(SWDataNode _data, SWWindowMain _window)
 {
     styleID = 2;
     base.Init(_data, _window);
     data.outputType.Add(SWDataType._UV);
     data.inputType.Add(SWDataType._UV);
 }
Exemple #2
0
 public override void Init(SWDataNode _data, SWWindowMain _window)
 {
     styleID    = 2;
     nodeWidth  = 152;
     nodeHeight = 130;
     base.Init(_data, _window);
     data.outputType.Add(SWDataType._UV);
     //data.inputType.Add (SWDataType._Color);
 }
Exemple #3
0
        public override void Init(SWDataNode _data, SWWindowMain _window)
        {
            nodeWidth  = NodeWidth + 70;
            nodeHeight = NodeHeight;

            base.Init(_data, _window);
            data.outputType.Add(SWDataType._UV);
            //data.inputType.Add (SWDataType._Color);
        }
 public override void Init(SWDataNode _data, SWWindowMain _window)
 {
     childPortSingleConnection = true;
     styleID    = 1;
     nodeWidth  = 190;
     nodeHeight = NodeBigHeight + 60;
     base.Init(_data, _window);
     data.outputType.Add(SWDataType._UV);
     data.inputType.Add(SWDataType._Color);
 }
		private static Shader CreateShader(SWWindowMain edit,string txt)
		{
			string path = string.Format ("{0}{1}.shader", edit.folderPath, edit.data.title);
			string fullPath = SWCommon.Path2FullPath (path);
			string adbPath =  SWCommon.Path2AssetDBPath (path);
//			string guid = AssetDatabase.AssetPathToGUID (adbPath);
			File.WriteAllText(fullPath, txt );    
			AssetDatabase.ImportAsset(adbPath, ImportAssetOptions.ForceUpdate);
			Shader currentShader = AssetDatabase.LoadAssetAtPath<Shader> ( adbPath);
			return currentShader;
		}
Exemple #6
0
        public override void Init(SWDataNode _data, SWWindowMain _window)
        {
            styleID = 0;
            base.Init(_data, _window);
            data.outputType.Add(SWDataType._Color);
            data.inputType.Add(SWDataType._UV);
            data.inputType.Add(SWDataType._Alpha);

            //Color node can be child node of color node
            data.inputType.Add(SWDataType._Color);
        }
        public override void Init(SWDataNode _data, SWWindowMain _window)
        {
            styleID = 2;
            base.Init(_data, _window);
            data.outputType.Add(SWDataType._UV);
            data.inputType.Add(SWDataType._Color);

            if (textureEx.IsNull)
            {
                textureEx = SWCommon.TextureCreate(512, 512, TextureFormat.ARGB32);
            }
        }
 public override void Init(SWDataNode _data, SWWindowMain _window)
 {
     styleID = 1;
     base.Init(_data, _window);
     data.outputType.Add(SWDataType._Color);
     data.outputType.Add(SWDataType._UV);
     data.outputType.Add(SWDataType._Alpha);
     data.inputType.Add(SWDataType._Color);
     data.inputType.Add(SWDataType._UV);
     data.inputType.Add(SWDataType._Alpha);
     UpdatePort();
 }
Exemple #9
0
        public override void Init(SWDataNode _data, SWWindowMain _window)
        {
            styleID    = 0;
            nodeWidth  = 144;
            nodeHeight = NodeBigHeight;
            base.Init(_data, _window);
            data.outputType.Add(SWDataType._Color);
            data.inputType.Add(SWDataType._Alpha);

            ePopup_op = new SWEnumPopup(typeof(SWOutputOP), (int)data.effectDataColor.op, false, null,
                                        delegate(int index){
                data.effectDataColor.op = (SWOutputOP)index;
            });
        }
Exemple #10
0
        public override void Init(SWDataNode _data, SWWindowMain _window)
        {
            nodeHeight = 80;
            styleID    = 2;
            base.Init(_data, _window);
            data.outputType.Add(SWDataType._UV);
            data.childPortNumber = 0;

            ePopup_coordMode = new SWEnumPopup(typeof(SWCoordMode), (int)data.coordMode, false, null,
                                               delegate(int index) {
                data.coordMode = (SWCoordMode)index;
            }
                                               );
        }
        public override void Init(SWDataNode _data, SWWindowMain _window)
        {
            styleID = 0;
            base.Init(_data, _window);
            data.outputType.Add(SWDataType._Color);
            data.inputType.Add(SWDataType._Color);
            data.inputType.Add(SWDataType._UV);
            data.inputType.Add(SWDataType._Alpha);
            InitForSp();

            //force set to no loop,in case of old data
            //new project should be OK, since SWDataNode' constructor has loop logic
            data.effectData.useLoop = false;
        }
Exemple #12
0
        public override void Init(SWDataNode _data, SWWindowMain _window)
        {
            childPortSingleConnection = true;
            styleID = 2;
            base.Init(_data, _window);
            data.outputType.Add(SWDataType._UV);
            data.inputType.Add(SWDataType._Color);

            if (textureEx.IsNull)
            {
                ResetTex();
            }

            lineInfo = ScriptableObject.CreateInstance <RemapLineInfo>();
        }
 public override void Init(SWDataNode _data, SWWindowMain _window)
 {
     styleID = 1;
     base.Init(_data, _window);
     data.outputType.Add(SWDataType._Color);
     data.outputType.Add(SWDataType._UV);
     data.outputType.Add(SWDataType._Alpha);
     data.inputType.Add(SWDataType._Color);
     data.inputType.Add(SWDataType._UV);
     data.inputType.Add(SWDataType._Alpha);
     if (texMask.IsNull)
     {
         ResetMask();
     }
 }
        public static Material CreateMaterial(SWWindowMain _edit)
        {
            edit = _edit;
            //step:shader
            var shader = CreateStep_Shader();

            if (edit.data.shaderType == SWShaderType.ngui_ui2dSprite)
            {
                CreateStep_ShaderNGUI();
            }

            //step:material
            Material mat = CreateStep_Material(shader);

            return(mat);
        }
		public static Material CreateMaterial(SWWindowMain edit)
		{
			foreach (var item in edit.NodeAll()) {
				item.Value.shaderOutput = null;
			}

			SWShaderCreaterBase sc = null;
			if (edit.data.shaderType == SWShaderType.normal) {
				sc = new SWShaderCreaterBase (edit);
			}
			if (edit.data.shaderType == SWShaderType.ui) {
				sc = new SWShaderCreaterUI (edit);
			}
			if (edit.data.shaderType == SWShaderType.uiFont) {
				sc = new SWShaderCreaterUIFont (edit);
			}
			if (edit.data.shaderType == SWShaderType.sprite) {
				if(edit.data.spriteLightType == SWSpriteLightType.no)
					sc = new SWShaderCreaterSprite (edit);
				else if(edit.data.spriteLightType == SWSpriteLightType.diffuse)
					sc = new SWShaderCreaterSpriteLight (edit);
			}

			float f = Time.realtimeSinceStartup;


			string txt = sc.CreateShaderText();
			var shader = CreateShader (edit,txt);

			string path = "";
			if (edit.newCopy || string.IsNullOrEmpty (edit.data.materialGUID)) 
				path = string.Format ("{0}{1}.mat", edit.folderPath, edit.data.title);
			else
				path = SWCommon.AssetDBPath2Path(AssetDatabase.GUIDToAssetPath (edit.data.materialGUID));
				
			Material m = AssetDatabase.LoadAssetAtPath<Material> (SWCommon.Path2AssetDBPath(path));
			if (m == null) {
				m = new Material (shader);
				SetMaterialProp (m, edit);
				m = SWCommon.SaveReload<Material> (m, path);
			} else {
				m.shader = shader;
				SetMaterialProp (m, edit);
			}
			edit.data.materialGUID = SWEditorTools.ObjectToGUID (m);
			return m;
		}
		private static void SetMaterialProp(Material m,SWWindowMain edit)
		{
			foreach (var item in edit.textures) {
				if(item.Value !=null)
					m.SetTexture (item.Key, item.Value);
			}


			foreach (var item in edit.nodes) {
				if (item.HasColorAttribute ()) {
					if(item.data.type == SWNodeType.root)
						m.SetColor (string.Format ("_Color"),item.data.effectDataColor.color);
					else
						m.SetColor (string.Format ("_Color{0}", item.data.iName),item.data.effectDataColor.color);
				}
			}
		}
        public virtual void Init(SWDataNode _data, SWWindowMain _window)
        {
            SerializedInit();
            data  = _data;
            index = SWWindowMain.Instance.GetNextIndex();
            if (string.IsNullOrEmpty(data.name))
            {
                data.name = data.type.ToString() + index;
            }
            if (this is SWNodeRoot)
            {
                data.name = "ROOT";
            }

            InitLayout();
            SetRectsAll();
            data.outputType.Clear();
            data.inputType.Clear();
        }
Exemple #18
0
        public override void Init(SWDataNode _data, SWWindowMain _window)
        {
            childPortSingleConnection = true;
            nodeWidth  = NodeBigWidth;
            nodeHeight = 80;
            styleID    = 1;
            base.Init(_data, _window);
            data.outputType.Add(SWDataType._Color);
            data.outputType.Add(SWDataType._UV);
            data.outputType.Add(SWDataType._Alpha);
            data.inputType.Add(SWDataType._Color);
            data.inputType.Add(SWDataType._UV);
            data.inputType.Add(SWDataType._Alpha);
            UpdatePort();

            foreach (var item in data.gradients)
            {
                item.UpdateTex();
            }
        }
 public SWShaderCreaterSprite(SWWindowMain _window) : base(_window)
 {
     IsSprite = true;
 }
 public SWShaderCreaterUIFont(SWWindowMain _window) : base(_window)
 {
     IsTextureSampleAdd = true;
 }
 public SWShaderCreaterNGUIClipSoftBase(SWWindowMain _window) : base(_window)
 {
 }
 public SWShaderCreaterUI(SWWindowMain _window) : base(_window)
 {
     IsTextureSampleAdd = true;
     IsSprite           = true;
 }
Exemple #23
0
 public SWShaderCreaterNGUIClipTex(SWWindowMain _window) : base(_window)
 {
     postFix_fileName   = " NGUI ClipTex";
     postFix_shaderName = " (TextureClip)";
 }
Exemple #24
0
 public SWShaderCreaterNGUI(SWWindowMain _window) : base(_window)
 {
 }
 public SWShaderCreaterSpriteLight(SWWindowMain _window) : base(_window)
 {
 }
 public SWShaderCreaterNGUIClip1(SWWindowMain _window) : base(_window)
 {
     clipCount = 1;
     InitName();
 }
 public SWShaderCreaterBase(SWWindowMain _window)
 {
     Instance = this;
     window   = _window;
 }