Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.