Пример #1
0
    // Use this for initialization
    void Start()
    {
        shapes [0] = new _Shape(PrimitiveType.Cube);
        shapes [0].ShowShape();
        shapes [1] = new _Shape(PrimitiveType.Sphere);
        CreateCone c = new CreateCone();

        c.OnWizardCreate();
        shapes [2] = new _Shape(c.getGameObject());
    }
Пример #2
0
 private int WhosActive()
 {
     for (int i = 0; i < shapes.Length; i++)
     {
         if (shapes[i].IsActive())
         {
             activeShape = shapes[i];
             return(i);
         }
     }
     return(-1);
 }
Пример #3
0
 void OnGUI()
 {
     if (GUI.Button(new Rect(350, 250, 70, 30), "Save"))
     {
         int        ac    = WhosActive();
         GameObject temp  = Instantiate(shapes[ac].getGameObject()) as GameObject;
         _Shape     saved = new _Shape(temp);
         saved.SetLastColor(color);
         if (x == 12)
         {
             y -= 2;
             saved.ChangePosition(new Vector3(x, y, 0));
             x = 2;
         }
         else
         {
             saved.ChangePosition(new Vector3(x, y, 0));
             x += 2;
         }
         saved.ShowShape();
     }
 }