예제 #1
0
    //Create Santa GameObject
    void CreateSanta()
    {
        santa = GameObject.CreatePrimitive(PrimitiveType.Cube); //Create object
        santa.AddComponent <Santa>();                           //Add script to object
        Santa ss = santa.GetComponent <Santa>();                //Create instance of type Santa and assign it the class Santa from santa Gameobject

        ss.SetupSanta(0f, 4f, 1.0f, 1.0f, 0.2f, Color.red);     //Constructor variables
    }