void CheckShader(){ if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel1/T4M 2 Textures Auto BeastLM 2DrawCall")){ MenuTextureSM1 = EnumShaderGLES1.T4M_2_Textures_Auto_BeastLM_2DrawCall ; ShaderModel = SM.ShaderModel1; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel1/T4M 2 Textures ManualAdd BeastLM_1DC")){ MenuTextureSM1 = EnumShaderGLES1.T4M_2_Textures_ManualAdd_BeastLM_1DC ; ShaderModel = SM.ShaderModel1; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel1/T4M 2 Textures ManualAdd CustoLM 1DC")){ MenuTextureSM1 = EnumShaderGLES1.T4M_2_Textures_ManualAdd_CustoLM_1DC ; ShaderModel = SM.ShaderModel1; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Unlit/T4M 2 Textures Unlit LM")){ MenuTextureSM2 = EnumShaderGLES2.T4M_2_Textures_Unlit_Lightmap_Compatible; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Unlit/T4M 3 Textures Unlit LM")){ MenuTextureSM2 = EnumShaderGLES2.T4M_3_Textures_Unlit_Lightmap_Compatible; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Unlit/T4M 4 Textures Unlit LM")){ MenuTextureSM2 = EnumShaderGLES2.T4M_4_Textures_Unlit_Lightmap_Compatible; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Unlit/T4M 5 Textures Unlit LM")){ MenuTextureSM2 = EnumShaderGLES2.T4M_5_Textures_Unlit_Lightmap_Compatible; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Unlit/T4M 6 Textures Unlit LM")){ MenuTextureSM2 = EnumShaderGLES2.T4M_6_Textures_Unlit_Lightmap_Compatible; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Unlit/T4M 6 Textures Unlit NoL")){ MenuTextureSM2 = EnumShaderGLES2.T4M_6_Textures_Unlit_No_Lightmap; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Unlit/T4M World Projection Shader + LM")){ MenuTextureSM2 = EnumShaderGLES2.T4M_World_Projection_Unlit_Lightmap_Compatible; ShaderModel = SM.ShaderModel2; UpSideTile = CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.GetVector ("_Tiling"); UpSideF = CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.GetFloat ("_UpSide"); BlendFac= CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.GetFloat ("_Blend"); }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Diffuse/T4M 2 Textures")){ MenuTextureSM2 = EnumShaderGLES2.T4M_2_Textures_HighSpec; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Diffuse/T4M 3 Textures")){ MenuTextureSM2 = EnumShaderGLES2.T4M_3_Textures_HighSpec; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Diffuse/T4M 4 Textures")){ MenuTextureSM2 = EnumShaderGLES2.T4M_4_Textures_HighSpec; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Diffuse/T4M 5 Textures")){ MenuTextureSM2 = EnumShaderGLES2.T4M_5_Textures_HighSpec; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Diffuse/T4M 6 Textures")){ MenuTextureSM2 = EnumShaderGLES2.T4M_6_Textures_HighSpec; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Diffuse/T4M World Projection Shader")){ MenuTextureSM2 = EnumShaderGLES2.T4M_World_Projection_HighSpec; ShaderModel = SM.ShaderModel2; UpSideTile = CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.GetVector ("_Tiling"); UpSideF = CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.GetFloat ("_UpSide"); BlendFac= CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.GetFloat ("_Blend"); }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Specular/T4M 2 Textures Spec")){ MenuTextureSM2 = EnumShaderGLES2.T4M_2_Textures_Specular; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Specular/T4M 3 Textures Spec")){ MenuTextureSM2 = EnumShaderGLES2.T4M_3_Textures_Specular; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Specular/T4M 4 Textures Spec")){ MenuTextureSM2 = EnumShaderGLES2.T4M_4_Textures_Specular; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/MobileLM/T4M 2 Textures for Mobile")){ MenuTextureSM2 = EnumShaderGLES2.T4M_2_Textures_4_Mobile; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/MobileLM/T4M 3 Textures for Mobile")){ MenuTextureSM2 = EnumShaderGLES2.T4M_3_Textures_4_Mobile; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/MobileLM/T4M 4 Textures for Mobile")){ MenuTextureSM2 = EnumShaderGLES2.T4M_4_Textures_4_Mobile; ShaderModel = SM.ShaderModel2; }//else //if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/MobileLM/T4M World Projection Shader_Mobile")){ // MenuTextureSM2 = EnumShaderGLES2.T4M_World_Projection_Mobile; // ShaderModel = SM.ShaderModel2; // UpSideTile = CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.GetVector ("_Tiling"); // UpSideF = CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.GetFloat ("_UpSide"); // BlendFac= CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.GetFloat ("_Blend"); //} else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Toon/T4M 2 Textures Toon")){ MenuTextureSM2 = EnumShaderGLES2.T4M_2_Textures_Toon; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Toon/T4M 3 Textures Toon")){ MenuTextureSM2 = EnumShaderGLES2.T4M_3_Textures_Toon; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Toon/T4M 4 Textures Toon")){ MenuTextureSM2 = EnumShaderGLES2.T4M_4_Textures_Toon; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Bump/T4M 2 Textures Bumped")){ MenuTextureSM2 = EnumShaderGLES2.T4M_2_Textures_Bumped; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Bump/T4M 3 Textures Bumped")){ MenuTextureSM2 = EnumShaderGLES2.T4M_3_Textures_Bumped; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Bump/T4M 4 Textures Bumped")){ MenuTextureSM2 = EnumShaderGLES2.T4M_4_Textures_Bumped; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Bump/T4M 2 Textures Bumped Mobile")){ MenuTextureSM2 = EnumShaderGLES2.T4M_2_Textures_Bumped_Mobile; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Bump/T4M 3 Textures Bumped Mobile")){ MenuTextureSM2 = EnumShaderGLES2.T4M_3_Textures_Bumped_Mobile; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Bump/T4M 2 Textures Bump Specular Mobile")){ MenuTextureSM2 = EnumShaderGLES2.T4M_2_Textures_Bumped_SPEC_Mobile; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/BumpDLM/T4M 2 Textures Bumped DLM Mobile")){ MenuTextureSM2 = EnumShaderGLES2.T4M_2_Textures_Bumped_DirectionalLM_Mobile; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Bump/T4M 2 Textures Bump Specular")){ MenuTextureSM2 = EnumShaderGLES2.T4M_2_Textures_Bumped_SPEC; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/Bump/T4M 3 Textures Bump Specular")){ MenuTextureSM2 = EnumShaderGLES2.T4M_3_Textures_Bumped_SPEC; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/BumpDLM/T4M 2 Textures Bumped DLM")){ MenuTextureSM2 = EnumShaderGLES2.T4M_2_Textures_Bumped_DirectionalLM; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel2/BumpDLM/T4M 3 Textures Bumped DLM")){ MenuTextureSM2 = EnumShaderGLES2.T4M_3_Textures_Bumped_DirectionalLM; ShaderModel = SM.ShaderModel2; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/Diffuse/T4M 2 Textures")){ MenuTextureSM3 = EnumShaderGLES3.T4M_2_Textures_Diffuse; ShaderModel = SM.ShaderModel3; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/Diffuse/T4M 3 Textures")){ MenuTextureSM3 = EnumShaderGLES3.T4M_3_Textures_Diffuse; ShaderModel = SM.ShaderModel3; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/Diffuse/T4M 3 Textures")){ MenuTextureSM3 = EnumShaderGLES3.T4M_3_Textures_Diffuse; ShaderModel = SM.ShaderModel3; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/Diffuse/T4M 4 Textures")){ MenuTextureSM3 = EnumShaderGLES3.T4M_4_Textures_Diffuse; ShaderModel = SM.ShaderModel3; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/Diffuse/T4M 5 Textures")){ MenuTextureSM3 = EnumShaderGLES3.T4M_5_Textures_Diffuse; ShaderModel = SM.ShaderModel3; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/Diffuse/T4M 6 Textures")){ MenuTextureSM3 = EnumShaderGLES3.T4M_6_Textures_Diffuse; ShaderModel = SM.ShaderModel3; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/Specular/T4M 2 Textures Spec")){ MenuTextureSM3 = EnumShaderGLES3.T4M_2_Textures_Specular; ShaderModel = SM.ShaderModel3; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/Specular/T4M 3 Textures Spec")){ MenuTextureSM3 = EnumShaderGLES3.T4M_3_Textures_Specular; ShaderModel = SM.ShaderModel3; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/Specular/T4M 4 Textures Spec")){ MenuTextureSM3 = EnumShaderGLES3.T4M_4_Textures_Specular; ShaderModel = SM.ShaderModel3; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/Bump/T4M 2 Textures Bump")){ MenuTextureSM3 = EnumShaderGLES3.T4M_2_Textures_Bumped; ShaderModel = SM.ShaderModel3; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/Bump/T4M 3 Textures Bump")){ MenuTextureSM3 = EnumShaderGLES3.T4M_3_Textures_Bumped; ShaderModel = SM.ShaderModel3; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/Bump/T4M 4 Textures Bump")){ MenuTextureSM3 = EnumShaderGLES3.T4M_4_Textures_Bumped; ShaderModel = SM.ShaderModel3; } else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/BumpSpec/T4M 2 Textures Bump Spec")){ MenuTextureSM3 = EnumShaderGLES3.T4M_2_Textures_Bumped_SPEC; ShaderModel = SM.ShaderModel3; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/BumpSpec/T4M 3 Textures Bump Spec")){ MenuTextureSM3 = EnumShaderGLES3.T4M_3_Textures_Bumped_SPEC; ShaderModel = SM.ShaderModel3; }else if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader == Shader.Find("T4MShaders/ShaderModel3/BumpSpec/T4M 4 Textures Bump Spec")){ MenuTextureSM3 = EnumShaderGLES3.T4M_4_Textures_Bumped_SPEC; ShaderModel = SM.ShaderModel3; }else{ ShaderModel = SM.CustomShader; CustomShader=CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.shader; if (CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.HasProperty("_Tiling")){ UpSideTile = CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.GetVector ("_Tiling"); UpSideF = CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.GetFloat ("_UpSide"); BlendFac= CurrentSelect.gameObject.GetComponent <T4MObjSC>().T4MMaterial.GetFloat ("_Blend"); } } }
void MyT4M() { if (CurrentSelect.GetComponent (typeof(T4MObjSC))) { GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); EnumMyT4MV = GUILayout.Toolbar(EnumMyT4MV, EnumMyT4M, GUILayout.Width(290), GUILayout.Height(20)); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); EditorGUILayout.Space(); switch (EnumMyT4MV) { case 0: GUILayout.Label("Shader Model", EditorStyles.boldLabel); ShaderModel =(SM) EditorGUILayout.EnumPopup ("Shader Model", ShaderModel, GUILayout.Width(340)); EditorGUILayout.Space(); if (ShaderModel == SM.ShaderModel1){ MenuTextureSM1 =(EnumShaderGLES1) EditorGUILayout.EnumPopup ("Shader", MenuTextureSM1, GUILayout.Width(340)); }else if (ShaderModel == SM.ShaderModel2){ MenuTextureSM2 =(EnumShaderGLES2) EditorGUILayout.EnumPopup ("Shader", MenuTextureSM2, GUILayout.Width(340)); }else if (ShaderModel == SM.ShaderModel3) MenuTextureSM3 =(EnumShaderGLES3) EditorGUILayout.EnumPopup ("Shader", MenuTextureSM3, GUILayout.Width(340)); else CustomShader=EditorGUILayout.ObjectField("Select your Shader",CustomShader, typeof(Shader),true, GUILayout.Width(350)) as Shader; EditorGUILayout.Space(); if (ShaderModel != SM.CustomShader){ GUILayout.Label("Shader Compatibility", EditorStyles.boldLabel); EditorGUILayout.Space(); EditorGUILayout.Space(); GUILayout.BeginHorizontal(); GUILayout.Label("GLES 1.1",GUILayout.Width(300)); if(ShaderModel != SM.ShaderModel3 && ShaderModel != SM.ShaderModel2) GUILayout.Label(Resources.LoadAssetAtPath(T4MEditorFolder+"Img/ok.png", typeof(Texture)) as Texture); else GUILayout.Label(Resources.LoadAssetAtPath(T4MEditorFolder+"Img/ko.png", typeof(Texture)) as Texture); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("GLES 2",GUILayout.Width(300)); if((ShaderModel == SM.ShaderModel1)|| (ShaderModel != SM.ShaderModel3) && (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_6_Textures_HighSpec)&& (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_4_Textures_Bumped) && (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_5_Textures_HighSpec )&& (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_3_Textures_Bumped_DirectionalLM)&& ( ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_6_Textures_Unlit_Lightmap_Compatible) && (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_World_Projection_HighSpec) && (ShaderModel == SM.ShaderModel2 &&MenuTextureSM2 != EnumShaderGLES2.T4M_World_Projection_Unlit_Lightmap_Compatible)){ GUILayout.Label(Resources.LoadAssetAtPath(T4MEditorFolder+"Img/ok.png", typeof(Texture)) as Texture); }else{ GUILayout.Label(Resources.LoadAssetAtPath(T4MEditorFolder+"Img/ko.png", typeof(Texture)) as Texture); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Desktop",GUILayout.Width(300)); GUILayout.Label(Resources.LoadAssetAtPath(T4MEditorFolder+"Img/ok.png", typeof(Texture)) as Texture); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Unity WebPlayer",GUILayout.Width(300)); GUILayout.Label(Resources.LoadAssetAtPath(T4MEditorFolder+"Img/ok.png", typeof(Texture)) as Texture); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Flash",GUILayout.Width(300)); if((ShaderModel == SM.ShaderModel1)|| (ShaderModel != SM.ShaderModel3) && (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_6_Textures_HighSpec) && (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_5_Textures_HighSpec) && (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_4_Textures_Bumped) && (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_3_Textures_Bumped) && (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_3_Textures_Bumped_SPEC) && (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_6_Textures_Unlit_Lightmap_Compatible) && (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_World_Projection_HighSpec) && (ShaderModel == SM.ShaderModel2 &&MenuTextureSM2 != EnumShaderGLES2.T4M_World_Projection_Unlit_Lightmap_Compatible) ) GUILayout.Label(Resources.LoadAssetAtPath(T4MEditorFolder+"Img/ok.png", typeof(Texture)) as Texture); else GUILayout.Label(Resources.LoadAssetAtPath(T4MEditorFolder+"Img/ko.png", typeof(Texture)) as Texture); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("NaCI",GUILayout.Width(300)); if((ShaderModel == SM.ShaderModel1)|| (ShaderModel != SM.ShaderModel3) && (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_6_Textures_HighSpec) && (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_5_Textures_HighSpec) && (ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_4_Textures_Bumped)&& ( ShaderModel == SM.ShaderModel2 && MenuTextureSM2 != EnumShaderGLES2.T4M_6_Textures_Unlit_Lightmap_Compatible)) GUILayout.Label(Resources.LoadAssetAtPath(T4MEditorFolder+"Img/ok.png", typeof(Texture)) as Texture); else GUILayout.Label(Resources.LoadAssetAtPath(T4MEditorFolder+"Img/ko.png", typeof(Texture)) as Texture); GUILayout.EndHorizontal(); } EditorGUILayout.Space(); GUILayout.BeginHorizontal(); GUILayout.Label("Master T4M Object", EditorStyles.boldLabel, GUILayout.Width(150)); T4MMaster = EditorGUILayout.Toggle(T4MMaster); GUILayout.EndHorizontal(); if(T4MMaster){ GUILayout.BeginVertical("box"); GUILayout.BeginHorizontal(); GUILayout.Label("Scene Camera", EditorStyles.boldLabel, GUILayout.Width(220)); PlayerCam= EditorGUILayout.ObjectField(PlayerCam, typeof(Transform),true) as Transform; GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Activate LOD System ", EditorStyles.boldLabel, GUILayout.Width(220)); ActivatedLOD = EditorGUILayout.Toggle(ActivatedLOD); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Activate Billboard System ", EditorStyles.boldLabel, GUILayout.Width(220)); ActivatedBillboard = EditorGUILayout.Toggle(ActivatedBillboard); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Activate LayerCullDistance ", EditorStyles.boldLabel, GUILayout.Width(220)); ActivatedLayerCul = EditorGUILayout.Toggle(ActivatedLayerCul); GUILayout.EndHorizontal(); EditorGUILayout.Space(); if (ActivatedLayerCul){ GUILayout.BeginVertical("box"); GUILayout.Label("Maximum distances of view", EditorStyles.boldLabel, GUILayout.Width(220)); EditorGUILayout.Space(); CloseDistMaxView = EditorGUILayout.Slider("Close Distance",CloseDistMaxView,0,500); NormalDistMaxView = EditorGUILayout.Slider("Middle Distance",NormalDistMaxView,0,500); FarDistMaxView = EditorGUILayout.Slider("Far Distance",FarDistMaxView,0,500); BGDistMaxView = EditorGUILayout.Slider("BackGround Distance",BGDistMaxView,0,10000); GUILayout.EndVertical(); } if (BGDistMaxView<FarDistMaxView) BGDistMaxView = FarDistMaxView; else if (FarDistMaxView<NormalDistMaxView) FarDistMaxView = NormalDistMaxView; else if (NormalDistMaxView<CloseDistMaxView) NormalDistMaxView = CloseDistMaxView; GUILayout.EndVertical(); } GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("UPDATE", GUILayout.Width(100), GUILayout.Height(30))) { MyT4MApplyChange(); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); break; case 1: EditorGUILayout.Space(); GUILayout.BeginHorizontal(); GUILayout.Label("ATS Foliage Wind Activation", EditorStyles.boldLabel, GUILayout.Width(220)); CurrentSelect.gameObject.GetComponent <T4MObjSC>().ActiveWind= EditorGUILayout.Toggle(CurrentSelect.gameObject.GetComponent <T4MObjSC>().ActiveWind); GUILayout.EndHorizontal(); EditorGUILayout.Space(); GUILayout.BeginVertical("box"); EditorGUILayout.Space(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Download The Package", GUILayout.Width(160), GUILayout.Height(15))) { Application.OpenURL ("http://u3d.as/content/forst/ats-mobile-foliage/2XM"); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.Space(); CurrentSelect.gameObject.GetComponent <T4MObjSC>().TranslucencyColor= EditorGUILayout.ColorField ("Translucency Color ",CurrentSelect.gameObject.GetComponent <T4MObjSC>().TranslucencyColor); EditorGUILayout.Space(); CurrentSelect.gameObject.GetComponent <T4MObjSC>().Wind = EditorGUILayout.Vector4Field("Wind Vector",CurrentSelect.gameObject.GetComponent <T4MObjSC>().Wind); EditorGUILayout.Space(); CurrentSelect.gameObject.GetComponent <T4MObjSC>().WindFrequency = EditorGUILayout.Slider("Wind Frequency",CurrentSelect.gameObject.GetComponent <T4MObjSC>().WindFrequency,0,5); EditorGUILayout.Space(); CurrentSelect.gameObject.GetComponent <T4MObjSC>().GrassWindFrequency = EditorGUILayout.Slider("Grass Wind Frequency",CurrentSelect.gameObject.GetComponent <T4MObjSC>().GrassWindFrequency,0,5); EditorGUILayout.Space(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Reset", GUILayout.Width(100), GUILayout.Height(15))) { CurrentSelect.gameObject.GetComponent <T4MObjSC>().TranslucencyColor= new Color(0.73f,0.85f,0.4f,1f); CurrentSelect.gameObject.GetComponent <T4MObjSC>().Wind = new Vector4(0.85f,0.075f,0.4f,0.5f); CurrentSelect.gameObject.GetComponent <T4MObjSC>().WindFrequency = 0.75f; CurrentSelect.gameObject.GetComponent <T4MObjSC>().GrassWindFrequency = 1.5f; } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("UPDATE", GUILayout.Width(100), GUILayout.Height(30))) { MyT4MApplyChange(); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("By Forst (Lars)", EditorStyles.boldLabel, GUILayout.Width(105), GUILayout.Height(15)); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Others Assets by Forst", "textarea", GUILayout.Width(140), GUILayout.Height(15))) { Application.OpenURL ("http://u3d.as/publisher/forst/1Lf"); } GUILayout.EndHorizontal(); EditorGUILayout.Space(); break; } }else{ GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("Please, select the T4M Object", EditorStyles.boldLabel); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }