// Token: 0x060025B9 RID: 9657 RVA: 0x000DCC18 File Offset: 0x000DB018
 public static void load()
 {
     LevelPlayers._models                 = new GameObject().transform;
     LevelPlayers.models.name             = "Players";
     LevelPlayers.models.parent           = Level.spawns;
     LevelPlayers.models.tag              = "Logic";
     LevelPlayers.models.gameObject.layer = LayerMasks.LOGIC;
     LevelPlayers._spawns                 = new List <PlayerSpawnpoint>();
     if (ReadWrite.fileExists(Level.info.path + "/Spawns/Players.dat", false, false))
     {
         River river = new River(Level.info.path + "/Spawns/Players.dat", false);
         byte  b     = river.readByte();
         if (b > 1 && b < 3)
         {
             river.readSteamID();
         }
         int  num  = 0;
         int  num2 = 0;
         byte b2   = river.readByte();
         for (int i = 0; i < (int)b2; i++)
         {
             Vector3 point = river.readSingleVector3();
             float   angle = (float)(river.readByte() * 2);
             bool    flag  = false;
             if (b > 3)
             {
                 flag = river.readBoolean();
             }
             if (flag)
             {
                 num2++;
             }
             else
             {
                 num++;
             }
             LevelPlayers.addSpawn(point, angle, flag);
         }
         river.closeRiver();
     }
 }
Beispiel #2
0
 private void Update()
 {
     if (!EditorSpawns.isSpawning)
     {
         return;
     }
     if (!EditorInteract.isFlying && GUIUtility.hotControl == 0)
     {
         if (Input.GetKeyDown(ControlsSettings.tool_0))
         {
             if (EditorSpawns.spawnMode == ESpawnMode.REMOVE_RESOURCE)
             {
                 EditorSpawns.spawnMode = ESpawnMode.ADD_RESOURCE;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.REMOVE_ITEM)
             {
                 EditorSpawns.spawnMode = ESpawnMode.ADD_ITEM;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.REMOVE_PLAYER)
             {
                 EditorSpawns.spawnMode = ESpawnMode.ADD_PLAYER;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.REMOVE_ZOMBIE)
             {
                 EditorSpawns.spawnMode = ESpawnMode.ADD_ZOMBIE;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.REMOVE_VEHICLE)
             {
                 EditorSpawns.spawnMode = ESpawnMode.ADD_VEHICLE;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.REMOVE_ANIMAL)
             {
                 EditorSpawns.spawnMode = ESpawnMode.ADD_ANIMAL;
             }
         }
         if (Input.GetKeyDown(ControlsSettings.tool_1))
         {
             if (EditorSpawns.spawnMode == ESpawnMode.ADD_RESOURCE)
             {
                 EditorSpawns.spawnMode = ESpawnMode.REMOVE_RESOURCE;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_ITEM)
             {
                 EditorSpawns.spawnMode = ESpawnMode.REMOVE_ITEM;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_PLAYER)
             {
                 EditorSpawns.spawnMode = ESpawnMode.REMOVE_PLAYER;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_ZOMBIE)
             {
                 EditorSpawns.spawnMode = ESpawnMode.REMOVE_ZOMBIE;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_VEHICLE)
             {
                 EditorSpawns.spawnMode = ESpawnMode.REMOVE_VEHICLE;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_ANIMAL)
             {
                 EditorSpawns.spawnMode = ESpawnMode.REMOVE_ANIMAL;
             }
         }
         if (EditorInteract.worldHit.transform != null)
         {
             if (EditorSpawns.spawnMode == ESpawnMode.ADD_ITEM)
             {
                 EditorSpawns.itemSpawn.position = EditorInteract.worldHit.point;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_PLAYER)
             {
                 EditorSpawns.playerSpawn.position    = EditorInteract.worldHit.point;
                 EditorSpawns.playerSpawnAlt.position = EditorInteract.worldHit.point;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_ZOMBIE)
             {
                 EditorSpawns.zombieSpawn.position = EditorInteract.worldHit.point + Vector3.up;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_VEHICLE)
             {
                 EditorSpawns.vehicleSpawn.position = EditorInteract.worldHit.point;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_ANIMAL)
             {
                 EditorSpawns.animalSpawn.position = EditorInteract.worldHit.point;
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.REMOVE_RESOURCE || EditorSpawns.spawnMode == ESpawnMode.REMOVE_ITEM || EditorSpawns.spawnMode == ESpawnMode.REMOVE_PLAYER || EditorSpawns.spawnMode == ESpawnMode.REMOVE_ZOMBIE || EditorSpawns.spawnMode == ESpawnMode.REMOVE_VEHICLE || EditorSpawns.spawnMode == ESpawnMode.REMOVE_ANIMAL)
             {
                 EditorSpawns.remove.position = EditorInteract.worldHit.point;
             }
         }
         if (Input.GetKeyDown(ControlsSettings.primary) && EditorInteract.worldHit.transform != null)
         {
             Vector3 point = EditorInteract.worldHit.point;
             if (EditorSpawns.spawnMode == ESpawnMode.ADD_RESOURCE)
             {
                 if ((int)EditorSpawns.selectedResource < LevelGround.resources.Length)
                 {
                     LevelGround.addSpawn(point, EditorSpawns.selectedResource, false);
                 }
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.REMOVE_RESOURCE)
             {
                 LevelGround.removeSpawn(point, (float)EditorSpawns.radius);
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_ITEM)
             {
                 if ((int)EditorSpawns.selectedItem < LevelItems.tables.Count)
                 {
                     LevelItems.addSpawn(point);
                 }
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.REMOVE_ITEM)
             {
                 LevelItems.removeSpawn(point, (float)EditorSpawns.radius);
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_PLAYER)
             {
                 LevelPlayers.addSpawn(point, EditorSpawns.rotation, EditorSpawns.selectedAlt);
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.REMOVE_PLAYER)
             {
                 LevelPlayers.removeSpawn(point, (float)EditorSpawns.radius);
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_ZOMBIE)
             {
                 if ((int)EditorSpawns.selectedZombie < LevelZombies.tables.Count)
                 {
                     LevelZombies.addSpawn(point);
                 }
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.REMOVE_ZOMBIE)
             {
                 LevelZombies.removeSpawn(point, (float)EditorSpawns.radius);
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_VEHICLE)
             {
                 LevelVehicles.addSpawn(point, EditorSpawns.rotation);
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.REMOVE_VEHICLE)
             {
                 LevelVehicles.removeSpawn(point, (float)EditorSpawns.radius);
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.ADD_ANIMAL)
             {
                 LevelAnimals.addSpawn(point);
             }
             else if (EditorSpawns.spawnMode == ESpawnMode.REMOVE_ANIMAL)
             {
                 LevelAnimals.removeSpawn(point, (float)EditorSpawns.radius);
             }
         }
     }
 }