void OnClick() { if (_inCooldownProgress) { return; } _meatSystem.Purchase(_meat, () => { _spawner.Spawn(baseCharacter); _inCooldownProgress = true; }); }
private void HandleSpawnAiNetworkedCharacter(Message message) { using (DarkRiftReader reader = message.GetReader()) { while (reader.Position < reader.Length) { ushort id = reader.ReadUInt16(); float X = reader.ReadSingle(); float Y = reader.ReadSingle(); var itemCount = reader.ReadInt16(); var items = new List <short>(); for (short i = 0; i < itemCount; i++) { items.Add(reader.ReadInt16()); } var moduleCount = reader.ReadInt16(); var modules = new List <short>(); for (short i = 0; i < moduleCount; i++) { modules.Add(reader.ReadInt16()); } CharacterSpawnParameters spawnParameters = new CharacterSpawnParameters(); spawnParameters.Id = id; spawnParameters.X = X; spawnParameters.Y = Y; spawnParameters.CharacterType = CharacterType.AICharacter; spawnParameters.IsLocal = false; spawnParameters.items = items; spawnParameters.modules = modules; _characterSpawner.Spawn(spawnParameters); } _messageWithResponse.SendClientReady(); } }