Created
April 3, 2014 10:48
-
-
Save kuetsuhara/9952286 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Change( Material skybx ){ | |
// 表示されているmeshを削除 | |
GameObject[] examples = GameObject.FindGameObjectsWithTag("SkyMesh"); | |
for( int i = 0; i < examples.Length; i++){ | |
Destroy(examples[i]); | |
} | |
// 新たにメッシュを設定 | |
this.material = null; | |
this.skybox = null; | |
skybox = skybx; | |
Debug.Log ("Hey" + skybox); | |
if( this.material == null ) { | |
this.material = new Material( _shaderText ); | |
} | |
if(mesh == null ){ | |
Debug.Log("mesh :: " + mesh); | |
mesh = _CreateMesh(); | |
} | |
_CreatePlane( mesh, "_FrontTex", Quaternion.identity ); | |
_CreatePlane( mesh, "_LeftTex", Quaternion.Euler( 0.0f, 90.0f, 0.0f ) ); | |
_CreatePlane( mesh, "_BackTex", Quaternion.Euler( 0.0f, 180.0f, 0.0f ) ); | |
_CreatePlane( mesh, "_RightTex", Quaternion.Euler( 0.0f, 270.0f, 0.0f ) ); | |
_CreatePlane( mesh, "_UpTex", Quaternion.Euler( -90.0f, 0.0f, 0.0f ) ); | |
_CreatePlane( mesh, "_DownTex", Quaternion.Euler( 90.0f, 0.0f, 0.0f ) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment