Example #1
0
    void GlobeGenerate(int x, int y)
    {
        GlobeColor color = (GlobeColor)Random.Range(0, 4);
        int        value = Random.Range(1, 10);

        globeArray[x, y] = new Globe(generator.GlobeGenerate(color, value, x, y), color, value);
    }
Example #2
0
 public Globe(GameObject g, GlobeColor c, int v)
 {
     gobject = g;
     color   = c;
     value   = v;
     isTouch = false;
 }
 public GameObject GlobeGenerate(GlobeColor color, int value, int width, int height)
 {
     if (width < 0 || width >= 9)
     {
         print("Error: GlobeGenerator.GlobeGenerate() out of range!(width=" + width + ")");
     }
     if (height < 0 || height >= 9)
     {
         print("Error: GlobeGenerator.GlobeGenerate() out of range!(height=" + height + ")");
     }
     if (value < 0 || value >= 10)
     {
         print("Error: GlobeGenerator.GlobeGenerate() out of range!(value=" + value + ")");
     }
     return(Instantiate(globePrefabs[(int)color, value], GlobePosition(width, height), Quaternion.identity) as GameObject);
 }