Begin  »  Cube

Powenko, Unity Tutorial b0-1, Add cube

December 29, 2011   ·   0 Comments

Screen Shot 2011-12-29 at 11.38.32 AM

below code is demo how to add a cube

sample code: b00_1_add_cube

using UnityEngine;
using System.Collections;

public class addcube : MonoBehaviour {

	 void Start() {
        GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);

    }
}

add info:

http://unity3d.com/support/documentation/ScriptReference/PrimitiveType.html

PrimitiveType Enumeration

The various primitives that can be created using the GameObject.CreatePrimitive function.

See Also: GameObject.CreatePrimitive

Values
Sphere A sphere primitive
Capsule A capsule primitive
Cylinder A cylinder primitive
Cube A cube primitive
Plane A plane primitive 
shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Unity3D4

Amazon

adsbygoogle

Recent Posts

Categories

Amazon