Example #1
0
	static public ShaderObjectField Show(ShaderVar SV,string Name,List<object> Objects,List<Texture2D> Images,List<bool> Bools,int Sel){
		ShaderObjectField windowG = (ShaderObjectField)ScriptableObject.CreateInstance(typeof(ShaderObjectField));//new ShaderObjectField();
		windowG.ShowAuxWindow();
		windowG.Caller = SV;
		//windowG.ShowUtility();
		windowG.title = Name;
		windowG.ObjFieldObject = Objects;
		windowG.ObjFieldImage = Images;
		windowG.ObjFieldEnabled = Bools;
		
		/*int X = -1;
		foreach(object obj in windowG.ObjFieldObject){
			X+=1;
			if (obj==Sel){
			windowG.Selected = X;
			Debug.Log(obj);
			}
		}*/
		windowG.Selected = Sel;
		return windowG;
	}
Example #2
0
 public void LoadData(Dictionary <string, string> data)
 {
     json = (Newtonsoft.Json.Linq.JObject)
            JsonConvert.DeserializeObject(data[Editor.Forms.Component.JsonDictionaryKey], new JsonSerializerSettings()
     {
         TypeNameHandling = TypeNameHandling.Objects
     });
     this.fieldGuid.LoadData(json["guid"].ToString());
     this.fieldAsset.LoadData(json["filePath"].ToString());
     this.fieldShaderLevel.LoadData(json["shaderLevel"].ToString());
     this.tabControl1.TabPages.Clear();
     foreach (var shadvar in json["shaderVars"])
     {
         var       item = JsonConvert.DeserializeObject <Dictionary <string, string> >(shadvar.ToString());
         ShaderVar page = new ShaderVar();
         page.Text = this.tabControl1.TabPages.Count.ToString();
         page.textSemanticName.Text  = item["SemanticName"];
         page.textSemanticIndex.Text = item["SemanticIndex"];
         //page.textFormat.Text = Enum.Parse(typeof(ShaderFormat), item["Format"]).ToString();
         ShaderFormat format;
         if (Enum.TryParse(item["Format"], out format))
         {
             page.textFormat.Text = format.ToString();
         }
         else
         {
             page.textFormat.Text = item["Format"];
         }
         page.textSlot.Text = item["Slot"];
         page.textAlignedByteOffset.Text    = item["AlignedByteOffset"];
         page.textClassification.Text       = item["Classification"];
         page.textInstanceDataStepRate.Text = item["InstanceDataStepRate"];
         this.tabControl1.TabPages.Add(page);
     }
     this.tabControl1.TabPages.Add(new AddPage(AddPage_Enter));
 }
Example #3
0
	public ShaderVar Copy(){
		ShaderVar SV = new ShaderVar();
		SV.Vector = Vector;
		SV.Image = Image;
		SV.ImageGUID = ImageGUID;
		SV.Cube = Cube;
		SV.CubeGUID = CubeGUID;
		SV.Float = Float;
		SV.Input = Input;
		SV.UseInput = UseInput;
		SV.Editing = Editing;
		SV.EditingPopup = EditingPopup;
		SV.ObjField = ObjField;
		SV.ObjFieldOn = ObjFieldOn;
		SV.Type = Type;
		SV.LastUsedRect = LastUsedRect;
		SV.Names = Names;
		SV.CodeNames = CodeNames;
		SV.Descriptions = Descriptions;
		
		
		SV.ImagePaths = ImagePaths;
		SV.Images = Images;
		SV.On = On;
		
		SV.TypeDispL = TypeDispL;
		
		SV.Range0 = Range0;
		SV.Range1 = Range1;
		
		SV.CType = CType;
		
		SV.NoInputs = NoInputs;
		
		SV.Name = Name;
		return SV;
	}
Example #4
0
	void GUIStart(Vector2 WinSize,Vector2 Position)
	{
		//TestInt = EditorGUI.Popup(new Rect(5,20,75,15), TestInt, new string[]{"Sup","Poop","hi!"},GUI.skin.GetStyle("MiniPopup"));
		//Debug.Log(TestInt);
		ShaderVarEditing = null;
		ShaderUtil.BeginGroup(new Rect(Position.x,Position.y,WinSize.x,WinSize.y));
		float BannerHeight = (144f/1006f)*WinSize.x;
		GUI.DrawTexture(new Rect(00,20,WinSize.x,BannerHeight), Banner, ScaleMode.ScaleToFit);
		BannerHeight+=20+32;
		
		GUIStyle LabelStyle = new GUIStyle(GUI.skin.box);
		LabelStyle.alignment = TextAnchor.UpperLeft;
		LabelStyle.richText = true;
		GUIStyle ButtonStyle2 = new GUIStyle(GUI.skin.button);
		ButtonStyle2.alignment = TextAnchor.MiddleLeft;
		int RecentlyOpenedSize = (int)(WinSize.x/3.5714f);//210;
		if (!SSSettings.HasAny())
			GUI.Box(ShaderUtil.Rect2(RectDir.Bottom,0,WinSize.y,RecentlyOpenedSize,WinSize.y-(BannerHeight)),"Recently Opened\n__________________________\n - None, get to it already! :)",LabelStyle);
		else{
			GUI.Box(ShaderUtil.Rect2(RectDir.Bottom,0,WinSize.y,RecentlyOpenedSize,WinSize.y-(BannerHeight)),"Recently Opened\n__________________________",LabelStyle);
			int Y = 0;
			foreach(string File in SSSettings.RecentFilesList){
				if (File!=""&&File!=null){
					Shader TheActualFile = null;
					//try{
						TheActualFile = ((Shader)AssetDatabase.LoadAssetAtPath(File,typeof(Shader)));
					//}catch{};
					if (TheActualFile!=null){
						FileInfo file = new FileInfo(Application.dataPath+File);
						if (GUI.Button(new Rect(10,(BannerHeight)+Y+30,RecentlyOpenedSize-10,20),TheActualFile.name+"("+file.Name+")",ButtonStyle2 )){
							Load(File);
							Goto(GUIType.Layers,ShaderTransition.TransDir.Forward);
						}
						Y+=20;
					}
				}
			}
			if (GUI.Button(ShaderUtil.Rect2(RectDir.Bottom,0,WinSize.y,RecentlyOpenedSize,20),"Clear"))
			SSSettings.RecentFiles = null;
		}
		
		
		GUI.Box(ShaderUtil.Rect2(RectDir.Diag,WinSize.x,WinSize.y,RecentlyOpenedSize,WinSize.y-(BannerHeight)),MOTD,LabelStyle);
		
		float ButtonOrder = 0;
		int ButtonWidth = (int)((float)RecentlyOpenedSize*0.85f);
		if (OpenShader!=null)
		{
			if (GUI.Button( ShaderUtil.Rect2(RectDir.MiddleTop,WinSize.x/2f,BannerHeight+ButtonOrder*28f,ButtonWidth,24),"Continue"))
			Goto(GUIType.Layers,ShaderTransition.TransDir.Forward);
			
			ButtonOrder+=1;
			
			if (GUI.Button( ShaderUtil.Rect2(RectDir.MiddleTop,WinSize.x/2f,BannerHeight+ButtonOrder*28f,ButtonWidth,24),"Save As"))
			{
				SaveAs();
			}
			ButtonOrder+=2;
		}
		
		if(StartNewTrans.Get()!=0)
		{
			GUI.color = new Color(GUI.color.r,GUI.color.g,GUI.color.b,StartNewTrans.Get());
			if (GUI.Button( ShaderUtil.Rect2(RectDir.MiddleTop,WinSize.x/2f,BannerHeight+(StartNewTrans.Get()*28f)+ButtonOrder*28f,ButtonWidth/1.25f,24),"Start from Scratch!"))
			{
				NewAdvanced();
			}
			
			if (GUI.Button( ShaderUtil.Rect2(RectDir.MiddleTop,WinSize.x/2f,BannerHeight+(StartNewTrans.Get()*56f)+ButtonOrder*28f,ButtonWidth/1.25f,24),"Start from a Preset!"))
			{
				NewSimple();
			}
			
			GUI.color = new Color(GUI.color.r,GUI.color.g,GUI.color.b,1);
		}
		
		
		if (GUI.Button( ShaderUtil.Rect2(RectDir.MiddleTop,WinSize.x/2f,BannerHeight+ButtonOrder*28f,ButtonWidth,24),"New Shader"))
		//NewAdvanced();
		StartNewTrans.Start(ShaderTransition.TransDir.Reverse);
		
		ButtonOrder+=1;
		if (GUI.Button( ShaderUtil.Rect2(RectDir.MiddleTop,WinSize.x/2f,BannerHeight+ButtonOrder*28f+(StartNewTrans.Get()*56f),ButtonWidth,24),"Open Shader"))
		{
			Load();
			Goto(GUIType.Layers,ShaderTransition.TransDir.Forward);
		}
		
		ButtonOrder+=1;
		//GUI.Button( ShaderUtil.Rect2(RectDir.MiddleTop,WinSize.x/2f,BannerHeight+ButtonOrder*28f+(StartNewTrans.Get()*56f),ButtonWidth,24),"Get Shaders");
		
		ButtonOrder=8;
		if (GUI.Button( ShaderUtil.Rect2(RectDir.MiddleTop,WinSize.x/2f,BannerHeight+ButtonOrder*28f,ButtonWidth,24),"Help!")){
			OpenHelp();
		}
		//if (GUI.Button( ShaderUtil.Rect2(RectDir.MiddleTop,WinSize.x/2f,BannerHeight+84f+(StartNewTrans.Get()*56f),150,24),"Temp Config"))
		//Goto(GUIType.Configure,ShaderTransition.TransDir.Forward);
		
		GUIStyle ButtonStyle = new GUIStyle(GUI.skin.button);
		ButtonStyle.fontSize = 30;		
		//if (GUI.Button( ShaderUtil.Rect2(RectDir.Diag,WinSize.x,WinSize.y,210,50),"New Shader",ButtonStyle))
		//Goto(GUIType.Presets,ShaderTransition.TransDir.Forward);
		
		ShaderUtil.EndGroup();	
	}
Example #5
0
	Vector2 GUIConfigureBoxStart(string Name,ShaderVar Tickbox,Vector2 WinSize,float X,float Y){
		float BoxWidth = (WinSize.x-15f)/2f;
		float BoxHeight = 190f;	
		Vector2 RetHW = new Vector2(BoxWidth-15f,BoxHeight-15f);
		
		if (Name!="")
		{
		if (Flatter)
		ShaderUtil.BeginGroup(new Rect((int)((BoxWidth)*(float)X+15f),(BoxHeight)*(float)Y+15f+100f,BoxWidth-15f,BoxHeight-15f),GUI.skin.box);
		else
		ShaderUtil.BeginGroup(new Rect((int)((BoxWidth)*(float)X+15f),(BoxHeight)*(float)Y+15f+100f,BoxWidth-15f,BoxHeight-15f),GUI.skin.button);
		
		
		BoxWidth-=15f;
		BoxHeight-=15f;
		GUI.skin.label.alignment = TextAnchor.UpperLeft;
		GUI.skin.label.fontSize = 20;
		GUI.Label(new Rect(10,4,BoxWidth,25),Name);
		
		if (Tickbox!=null){
		if (Tickbox.On)
		{
			Tickbox.On = GUI.Toggle(new Rect(BoxWidth-34,4,30,30),Tickbox.On,new GUIContent(Tick),"Button");
		}
		else
		{
			Tickbox.On = GUI.Toggle(new Rect(BoxWidth-34,4,30,30),Tickbox.On,new GUIContent(Cross),"Button");
		}
		GUI.enabled = true;
		if (!Tickbox.On)
		GUI.enabled = false;
		}
		}
		return RetHW;//new Vector2(BoxWidth,BoxHeight);
	}
Example #6
0
	void GUIPresets(Vector2 WinSize,Vector2 Position)
	{
		ShaderVarEditing = null;
		ShaderUtil.BeginGroup(new Rect(Position.x,Position.y,WinSize.x,WinSize.y));
		/*GUILayout.BeginVertical(SCSkin.box,GUILayout.Height(200));
		
		GUILayout.EndVertical();*/
		
		//string[] BaseVarients = {"Plain","Plant","Fur","Grass","Skin"};
		//string[] ExtraVarients = {"","Specular","Normal Mapped","Specular Normal Mapped","Rim Lit","Normal Mapped Rim Lit","POM","Specular POM","Normal Mapped POM","Specular Normal Mapped POM"};
		/*string[] selStrings = new string[BaseVarients.Length*ExtraVarients.Length];
		int i = 0;
		foreach (string Var2 in ExtraVarients)
		{
			foreach (string Var in BaseVarients)
			{
				selStrings[i] = Var+" "+Var2;
				i+=1;
			}
		}*/
		if (PresetsGUIContents==null||PresetsGUIContents.Count==0||PresetsPaths==null||PresetsPaths.Count==0){
			PresetsGUIContents = new List<GUIContent>(); 
			PresetsPaths = new List<string>();
			//DirectoryInfo info = null;
			//try{
				//---------info = new DirectoryInfo(Application.dataPath+"/Shader Sandwich/Internal/Editor/Shader Sandwich/Presets/");//ScriptFileFolder);
			//}catch{}
			/*if (info!=null&&info.Exists){
				FileInfo[] fileInfo = info.GetFiles();
				//List<GUIContent> selStrings = new List<GUIContent>();
				//List<Texture2D> selImages = new List<Texture2D>();
				foreach (FileInfo file in fileInfo){
					//List<string> FileText = new List<string>();
					if (file.Extension==".shader"){
						//StreamReader theReader = new StreamReader(file.ToString());
						//Debug.Log(file.Name);
						
						//Debug.Log(file.FullName);
						if (System.IO.File.Exists(file.DirectoryName+"\\"+file.Name.Replace(".shader",".png").Substring(1))){
						var bytes = System.IO.File.ReadAllBytes(file.DirectoryName+"\\"+file.Name.Replace(".shader",".png").Substring(1));
						var tex = new Texture2D(1, 1);
						tex.LoadImage(bytes);
						//PresetsGUIContents.Add(new GUIContent(tex));
						PresetsGUIContents.Add(new GUIContent(file.Name.Replace(".shader","").Substring(1),tex));
						PresetsPaths.Add(file.DirectoryName+"\\"+file.Name);
						//selStrings.Add(new GUIContent(tex));
						}
					}
				}
			}*/
			string[] guids2 = AssetDatabase.FindAssets ("t:Shader", new string[]{"Assets/Shader Sandwich/Internal/Editor/Shader Sandwich/Presets"});
			//for (string guid in guids2)
				//Debug.Log (AssetDatabase.GUIDToAssetPath(guid));
			//FileInfo[] fileInfo = info.GetFiles();
			//List<GUIContent> selStrings = new List<GUIContent>();
			//List<Texture2D> selImages = new List<Texture2D>();
			foreach (string guid in guids2){
				//Debug.Log (AssetDatabase.GUIDToAssetPath(guid));
				string ImgPath = AssetDatabase.GUIDToAssetPath(guid).Replace(".shader",".png");
				ImgPath = ImgPath.Remove(ImgPath.LastIndexOf("/")+1,1);
				//Debug.Log(ImgPath);
				Texture2D tex = (Texture2D)AssetDatabase.LoadAssetAtPath(ImgPath,typeof(Texture2D));
				if (tex!=null){
					PresetsGUIContents.Add(new GUIContent(new FileInfo(AssetDatabase.GUIDToAssetPath(guid)).Name.Replace(".shader","").Substring(1),tex));
					PresetsPaths.Add(AssetDatabase.GUIDToAssetPath(guid));
				}
				//Debug.Log("YAY!");
				/*if (System.IO.File.Exists(file.DirectoryName+"\\"+file.Name.Replace(".shader",".png").Substring(1))){
					var bytes = System.IO.File.ReadAllBytes(file.DirectoryName+"\\"+file.Name.Replace(".shader",".png").Substring(1));
					var tex = new Texture2D(1, 1);
					tex.LoadImage(bytes);
					//PresetsGUIContents.Add(new GUIContent(tex));
					PresetsGUIContents.Add(new GUIContent(file.Name.Replace(".shader","").Substring(1),tex));
					PresetsPaths.Add(file.DirectoryName+"\\"+file.Name);
				}	*/
			}
		}
		//List<string> selStrings = new string[]{"Legacy Diffuse","PBR Diffuse","PBR Normal Mapped","PBR Height Mapped","Parallax Occlusion Mapped","Displacement Mapped","Glow","Cartoon"};
		int XCount = (int)Mathf.Floor((WinSize.x-120f)/192f);
		Rect gridRect = new Rect(0, 0, XCount*192, Mathf.Ceil(PresetsGUIContents.Count/Mathf.Floor((WinSize.x-120f)/256f))*192);
		GUI.Box(new Rect(100,32,XCount*192+20,WinSize.y-64),"",GUI.skin.button);
		StartScroll = ShaderUtil.BeginScrollView(new Rect(100,32,XCount*192+20,WinSize.y-64),StartScroll,new Rect(0,0,gridRect.width,Mathf.Max((int)(PresetsGUIContents.Count/XCount)*192,gridRect.height-180)),false,false);
		
		GUIStyle GridStyle = new GUIStyle(GUI.skin.button);
		//GridStyle.margin = new RectOffset(GridStyle.margin.left+20,GridStyle.margin.right+20,GridStyle.margin.top+20,GridStyle.margin.bottom+20); 
		GridStyle.wordWrap = true;
		GridStyle.imagePosition = ImagePosition.ImageAbove;
		GridStyle.fixedHeight =192;
		
		foreach(GUIContent GC in PresetsGUIContents){
			if (GUI.skin.label.CalcHeight(new GUIContent(GC.text), 192)<20){
				GC.text+="\n";
			}
		}
		
		selGridInt = GUI.SelectionGrid(gridRect, selGridInt, PresetsGUIContents.ToArray(), XCount,GridStyle);
		if (PresetsGUIContents.Count==0)
		GUI.Label(new Rect(20,20,500,300),"Sorry, the presets can't be loaded. Make sure Shader Sandwich has been imported properly, and if it has, please file a bug report :).");
		ShaderUtil.EndScrollView();
		
		GUIStyle ButtonStyle = new GUIStyle(GUI.skin.button);
		ButtonStyle.fontSize = 20;		
		if (GUI.Button( ShaderUtil.Rect2(RectDir.Bottom,0,WinSize.y,100,30),"Back",ButtonStyle))
			Goto(GUIType.Start,ShaderTransition.TransDir.Backward);	
		if (PresetsGUIContents.Count>0){
			if (GUI.Button( ShaderUtil.Rect2(RectDir.Diag,WinSize.x,WinSize.y,100,30),"Next",ButtonStyle)||Event.current.clickCount==2){
				//Debug.Log(PresetsPaths[selGridInt]);
				SimpleLoad(PresetsPaths[selGridInt]);
				OpenShader.ShaderName.Text = "Untitled Shader";
				Goto(GUIType.Layers,ShaderTransition.TransDir.Forward);
			}
		}
		
		ShaderUtil.EndGroup();		
	}
Example #7
0
 public void LoadData(Dictionary<string, string> data)
 {
     json = (Newtonsoft.Json.Linq.JObject)
            JsonConvert.DeserializeObject(data[Editor.Forms.Component.JsonDictionaryKey], new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.Objects });
     this.fieldGuid.LoadData(json["guid"].ToString());
     this.fieldAsset.LoadData(json["filePath"].ToString());
     this.fieldShaderLevel.LoadData(json["shaderLevel"].ToString());
     this.tabControl1.TabPages.Clear();
     foreach (var shadvar in json["shaderVars"])
     {
         var item = JsonConvert.DeserializeObject<Dictionary<string, string>>(shadvar.ToString());
         ShaderVar page = new ShaderVar();
         page.Text = this.tabControl1.TabPages.Count.ToString();
         page.textSemanticName.Text = item["SemanticName"];
         page.textSemanticIndex.Text = item["SemanticIndex"];
         //page.textFormat.Text = Enum.Parse(typeof(ShaderFormat), item["Format"]).ToString();
         ShaderFormat format;
         if (Enum.TryParse(item["Format"], out format))
             page.textFormat.Text = format.ToString();
         else
             page.textFormat.Text = item["Format"];
         page.textSlot.Text = item["Slot"];
         page.textAlignedByteOffset.Text = item["AlignedByteOffset"];
         page.textClassification.Text = item["Classification"];
         page.textInstanceDataStepRate.Text = item["InstanceDataStepRate"];
         this.tabControl1.TabPages.Add(page);
     }
     this.tabControl1.TabPages.Add(new AddPage(AddPage_Enter));
 }
Example #8
0
public ShaderLayer(){
Name = new ShaderVar("Layer Name","");
LayerType = new ShaderVar( "Layer Type",new string[] {"Color", "Gradient", "Vertex Color","Texture","Cubemap","Noise","Previous","Literal","Grab/Depth"},new string[] {"Color - A plain color.", "Gradient - A color that fades.", "Vertex Colors - The colors interpolated between each vertex","Texture - A 2d texture.","Cubemap - A 3d reflection map.","Noise - Perlin Noise","Previous - The previous value.","Literal - Uses the value directly from the mapping.","Grab/Depth - Access the entire screen or the screen's depth buffer."},3);
ShaderVars.Add(LayerType);

Color = new ShaderVar("Main Color", new Vector4(160f/255f,204f/255f,225/255f,1f));
ShaderVars.Add(Color);
Color2 = new ShaderVar("Second Color", new Vector4(0.0f,0.0f,0.0f,1f));
ShaderVars.Add(Color2);
Image = new ShaderVar("Main Texture", "Texture2D");ShaderVars.Add(Image);

Cube = new ShaderVar( "Cubemap","Cubemap");
ShaderVars.Add(Cube);
UseAlpha = new ShaderVar("Use Alpha",false);
Stencil = new ShaderVar("Stencil","ListOfObjects");

MixAmount = new ShaderVar( "Mix Amount",1f);ShaderVars.Add(MixAmount);

UseFadeout = new ShaderVar("Use Fadeout",false);
FadeoutMinL = new ShaderVar("Fadeout Limit Min",0f);
FadeoutMaxL = new ShaderVar("Fadeout Limit Max",10f);
FadeoutMin = new ShaderVar("Fadeout Start",3f);
FadeoutMax = new ShaderVar("Fadeout End",5f);

MixType = new ShaderVar("Mix Type", new string[]{"Mix","Add","Subtract","Multiply","Divide","Lighten","Darken","Normal Map Combine","Dot"},new string[]{"","","","","","","","",""},3);ShaderVars.Add(MixType);

MapType = new ShaderVar("UV Map",new string[]{"UV Map","UV Map2","Reflection","Direction","Rim Light","Generate","View","Position"},new string[]{"The first UV Map","The second UV Map (Lightmapping)","The reflection based on the angle of the face.","Simply the angle of the face.","Maps from the edge to the center of the model.","Created the UVMap using tri-planar mapping.(Good for generated meses)","Plaster the layer onto it from whatever view you are facing from.","Maps using the world position."});
MapLocal = new ShaderVar("Map Local",false);

NoiseDim = new ShaderVar("Noise Dimensions",new string[]{"2D","3D"},new string[]{"",""});
NoiseType = new ShaderVar("Noise Type",new string[]{"Perlin","Cloud","Cubist","Cell","Dot"},new string[]{"","","","",""});
NoiseA = new ShaderVar("Noise A",0f);
NoiseB = new ShaderVar("Noise B",1f);
NoiseC = new ShaderVar("Noise C",false);

LightData = new ShaderVar("Light Data",new string[]{"Light/Direction","Light/Attenuation","View Direction","Channels/Albedo(Diffuse)","Channels/Normal","Channels/Specular","Channels/Emission","Channels/Alpha","Light/Color"},new string[]{"","","","","","","","",""});
//NoiseC.Range0 = 1;
//NoiseC.Range1 = 3;
NoiseC.NoInputs = true;
SpecialType = new ShaderVar("Special Type",new string[]{"Grab","Depth"},new string[]{"",""});
LinearizeDepth = new ShaderVar("Linearize Depth",false);
VertexMask = new ShaderVar("Vertex Mask",2f);

}
Example #9
0
public void AddTextureOrCubemapInput(int Option,ShaderVar SV){
	if (Option==0){
		if (LayerType.Type==(int)LayerTypes.Texture){
			Image.AddInput();
		}
		if (LayerType.Type==(int)LayerTypes.Cubemap){
			Cube.AddInput();
		}
		Image.WarningReset();
		Cube.WarningReset();
	}
}
Example #10
0
public void WarningFixDelegate(int Option,ShaderVar SV){
	if (Option==1){
		AddLayerEffect("SSENormalMap");
		LayerEffects[LayerEffects.Count-1].Inputs[2].Type = 0;
		LayerEffects[LayerEffects.Count-1].AutoCreated = true;
	}
	if (Option==0){
		AddLayerEffect("SSESwizzle");
		LayerEffects[LayerEffects.Count-1].AutoCreated = true;
		LayerEffects[LayerEffects.Count-1].Inputs[0].Type = 3;
		LayerEffects[LayerEffects.Count-1].Inputs[1].Type = 1;
		LayerEffects[LayerEffects.Count-1].Inputs[2].Type = 0;
		LayerEffects[LayerEffects.Count-1].Inputs[3].Type = 0;
	}
	//Image.WarningReset();
}
Example #11
0
	public Dictionary<string,ShaderVar> GetSaveLoadDict(){
		//Create some temp Shader Vars
		ShaderVar SVType = new ShaderVar("Type",(float)Type);
		ShaderVar SVVisName = new ShaderVar("VisName",VisName);
		ShaderVar SVImageDefault = new ShaderVar("ImageDefault",ImageDefault);
		ShaderVar SVImage = new ShaderVar("Image",AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(Image)));
		ShaderVar SVCube = new ShaderVar("Cube",AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(Cube)));
		ShaderVar SVColor = new ShaderVar("Color",new Color(0.8f,0.8f,0.8f,1f));
		if (Color!=null)
		SVColor = new ShaderVar("Color",Color.ToColor());
		ShaderVar SVNumber = new ShaderVar("Number",Number);
		ShaderVar SVRange0 = new ShaderVar("Range0",Range0);
		ShaderVar SVRange1 = new ShaderVar("Range1",Range1);
		ShaderVar SVMainType = new ShaderVar("MainType",(float)(int)MainType);
		ShaderVar SVSpecialType = new ShaderVar("SpecialType",(float)(int)SpecialType);
		ShaderVar SVInEditor = new ShaderVar("InEditor",InEditor?1f:0f);
		ShaderVar SVNormalMap = new ShaderVar("NormalMap",NormalMap?1f:0f);
		
		Dictionary<string,ShaderVar> D = new Dictionary<string,ShaderVar>();

		D.Add(SVType.Name,SVType);
		D.Add(SVVisName.Name,SVVisName);
		D.Add(SVImageDefault.Name,SVImageDefault);
		D.Add(SVImage.Name,SVImage);
		D.Add(SVCube.Name,SVCube);
		D.Add(SVColor.Name,SVColor);
		D.Add(SVNumber.Name,SVNumber);
		D.Add(SVRange0.Name,SVRange0);
		D.Add(SVRange1.Name,SVRange1);
		D.Add(SVMainType.Name,SVMainType);
		D.Add(SVSpecialType.Name,SVSpecialType);
		D.Add(SVInEditor.Name,SVInEditor);
		D.Add(SVNormalMap.Name,SVNormalMap);
		return D;
	}