Exemplo n.º 1
0
    public void Remake(short[] layout, int startIndex = 0)
    {
        int indexToBuild = startIndex;

        for (int i = 0; i < floors.Count; i++)
        {
            TunnelFloor floor = floors[indexToBuild];
            floor.ClearCube();

            if ((layout[i] & (short)FloorType.Bad) != 0)
            {
                floor.SetFirewall(firewallMaterial);
            }
            else
            {
                floor.SetToDefault();
            }

            if ((layout[i] & (short)FloorType.HasCube) != 0)
            {
                floor.MakeDataCube();
            }

            HelperMethods.CyclicalIncrement(ref indexToBuild, floors.Count);
        }
    }
Exemplo n.º 2
0
 void DetermineFloorIsFirewallRandom(TunnelFloor floor, float probability)
 {
     if (Random.Range(0f, 1f) < probability)
     {
         floor.SetFirewall(firewallMaterial);
     }
     else
     {
         floor.SetToDefault();
     }
 }