예제 #1
0
 public void CreateGem(int row, int c, SphereGem hgem)
 {
     if (!sphereAll.Contains(new Vector3(c, 0, row)))
     {
         Vector3 vectorgem = vector2position + (new Vector3(c, 0, row));
         sphereAll.Add(vectorgem);
         float     radiussphere = Random.Range(databaseTable.unitSpawnMinRadius, databaseTable.unitSpawnMaxRadius);
         SphereGem sphere       = ((GameObject)Instantiate(hgem.gameObject, vectorgem, Quaternion.identity)).GetComponent <SphereGem>();
         sphere.transform.localScale = new Vector3(
             sphere.transform.localScale.x * radiussphere,
             sphere.transform.localScale.y * radiussphere,
             sphere.transform.localScale.z * radiussphere
             );
         sphere.RotationNum = Random.Range(1, 4);
         if (sphere.name == "robot(Clone)")
         {
             blue += 1;
         }
         if (sphere.name == "robot2(Clone)")
         {
             red += 1;
         }
         //sphere.RotAll();
         GetSpheres.Add(sphere);
     }
     else
     {
         CreateGem(Random.Range(0, 100), Random.Range(0, 100), spherePrefab[Random.Range(0, spherePrefab.Length)]);
     }
 }
예제 #2
0
 public void LoadBasic()
 {
     basicManager.ClearSpheres(); basicManager.clearSphereVec();
     SphereGem[] spheres2 = new SphereGem[PlayerPrefs.GetInt("SavedCount")];
     FindObjectOfType <LevelManager>().query(spheres2);
     foreach (SphereGem gemsp in spheres2)
     {
         CreateGems2(gemsp.row, gemsp.col, basicManager.spheresPref()[gemsp.color], gemsp.RotationNum, gemsp.sradius);
     }
 }
예제 #3
0
 public void RemoveSphere(SphereGem sp)
 {
     if (sp.name == "robot(Clone)")
     {
         blue -= 1;
     }
     if (sp.name == "robot2(Clone)")
     {
         red -= 1;
     }
     GetSpheres.Remove(sp);
     Destroy(sp.gameObject);
 }
예제 #4
0
    public void CreateGems2(float row, float c, SphereGem hgem, int rotnum, float rad)
    {
        Vector3 vectorgem = vector2position + (new Vector3(c, 0, row));

        basicManager.AddSphereVec(vectorgem);
        SphereGem sphere = ((GameObject)Instantiate(hgem.gameObject, vectorgem, Quaternion.identity)).GetComponent <SphereGem>();

        sphere.RotationNum          = rotnum;
        sphere.transform.localScale = new Vector3(
            rad, rad, rad
            );
        sphere.RotAll();
        basicManager.AddSphere(sphere);
    }
예제 #5
0
 public void query(SphereGem[] spheres)
 {
     InstanceLoaded();
     for (int i = 0; i < PlayerPrefs.GetInt("SavedCount"); i++)
     {
         SphereGem sphereGem1 = new SphereGem();
         sphereGem1.color       = LoadedConfigs[i].color;
         sphereGem1.RotationNum = LoadedConfigs[i].RotationNum;
         sphereGem1.row         = LoadedConfigs[i].row;
         sphereGem1.col         = LoadedConfigs[i].c;
         sphereGem1.sradius     = LoadedConfigs[i].sradius;
         spheres[i]             = sphereGem1;
     }
 }
예제 #6
0
 public bool isequal(SphereGem hitCandy)
 {
     return(hitCandy != null && hitCandy.type == type && hitCandy.type != "ingredient" + 0 && hitCandy.type != "ingredient" + 1);
 }
예제 #7
0
 public void OnInit(SphereGem hitI)
 {
     hitGem = hitI;
     hitGem.isGem(this);
 }
예제 #8
0
 public void AddSphere(SphereGem sp)
 {
     GetSpheres.Add(sp);
 }