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.

该纹理将在每一面创建size大小带有或不带有mipmap的纹理。

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

通常会在创建之后设置纹理的颜色,使用SetPixel和Apply函数。

参见: SetPixel , Apply函数

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {void Start() {Cubemap texture = new Cubemap(128, TextureFormat.ARGB32, false);renderer.material.mainTexture = texture;}}
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;}


,