Beispiel #1
0
    public void putHazmat(HazmatStatus status = HazmatStatus.Hazmat)
    {
        int randX = rand.Next(1, 9);
        int randZ = rand.Next(1, 7);

        int[] key = new int[] { randX, randZ };

        while (containsKey(key[0], key[1], placedHazmat) || containsKey(key[0], key[1], placedHotspot) || gm.tileMap.tiles[randX, randZ] == 2)
        {
            randX = rand.Next(1, 9);
            randZ = rand.Next(1, 7);

            key = new int[] { randX, randZ };
        }

        Hazmat h = new Hazmat(this, status);

        if ((HazmatStatus)status == HazmatStatus.Hazmat)
        {
            placedHazmat.Add(key, h);
        }
        else
        {
            placedHotspot.Add(key, h);
        }

        GameObject go = gm.instantiateObject(h.prefab, new Vector3((float)(randX * 6 + 1.5), posY, (float)(randZ * 6 - 1.5)), Quaternion.identity);

        go.transform.Rotate(90, 0, 0);
        if (h.status == HazmatStatus.Hazmat)
        {
            lookUp.Add(key, go);
        }
        gm.AddHazmat(randX, randZ, (int)h.status);
    }
Beispiel #2
0
 public void setHazmatStatus(HazmatStatus status)
 {
     this.status = status;
     if (status == HazmatStatus.HotSpot)
     {
         prefab = hm.gm.hazPrefabs[1];
     }
 }
Beispiel #3
0
 public Hazmat(HazmatManager hm, HazmatStatus status = HazmatStatus.Hazmat)
 {
     this.hm     = hm;
     this.prefab = hm.gm.hazPrefabs[(int)status];
     this.status = status;
 }