Cubemap.Cubemap Manual     Reference     Scripting  
Scripting > Runtime Classes > Cubemap
Cubemap.Cubemap

static function Cubemap (size : int, format : TextureFormat, mipmap : bool) : Cubemap

Description

Create a new empty cubemap texture.

The texture will be size on each side and with or without mipmaps.

Usually you will want to set the colors of the texture after creating it, using SetPixel and Apply functions.

JavaScripts
function Start () {
// Create a new texture and assign it to the renderer's material
var texture : Cubemap = new Cubemap (128, TextureFormat.ARGB32, false);
renderer.material.mainTexture = texture;
}

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Start() {
Cubemap texture = new Cubemap(128, TextureFormat.ARGB32, false);
renderer.material.mainTexture = texture;
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Start():
texture as Cubemap = Cubemap(128, TextureFormat.ARGB32, false)
renderer.material.mainTexture = texture

See Also: SetPixel, Apply functions.