public static void PrecacheWithSounds(GameObject_WRef asset) { var go = asset.Load(); if (go != null) { go.PrecacheSounds(); } }
public static void PrecacheWithSounds(GameObject_WRef asset, System.Action <GameObject> f) { var go = asset.Load(); if (go != null) { go.PrecacheSounds(); f(go); } }
public List <T> Spawn <T>(Server.GameMode gameMode, Vector3 pos, float yaw) where T : Actor { Team team; var spawns = new List <T>(); switch (_type) { default: team = null; break; case ESpawnPointType.Horse: case ESpawnPointType.Merchant: team = gameMode.players[0].team; break; case ESpawnPointType.Monster: team = gameMode.monsterTeam; break; } int entCount = 0; foreach (var s in _entities) { int count = s._spawnCountMin + (int)((((Server.BowheadGame)gameMode).GetWhiteNoise((int)pos.x, (int)pos.y, (int)pos.z)) * (s._spawnCountMax - s._spawnCountMin)); for (int i = 0; i < count; i++) { var spawnFn = (ISpawnPointSupport)s._entityData; if (spawnFn != null) { spawns.Add((T)spawnFn.Spawn(gameMode.world, pos + new Vector3((entCount++) * 0.1f, 0, 0), yaw, team)); } } } if (mapMarker != null) { var marker = GameManager.instance.clientWorld.gameState.hud.CreateMapMarker(mapMarker.Load(), mapMarkerStyle); marker.worldPosition = new Vector2(pos.x, pos.z); } return(spawns); }