private void SpawnThisEnemyNow11111() { if (wasSpawned) { return; } if (_reactCalc.Result.Value < 0) { return; } if (_reactCalcDeact.Result.Value >= 0) { return; } wasSpawned = true; character = characterInfo.GetCharacter(startingPosition: transform.position); foreach (var each in startingItems.Select(_ => _.GetItem())) { character.Inventory.AddItem(each); } //character.ItemsToDrop = itemToDrop; character.dropProbability = dropProbability; character.speakProbability = 1f; if (startingWeapon != null) { var weapon = startingWeapon.GetItem(); character.Inventory.AddItem(weapon); weapon.Apply(); //if ( characterInfo.applyColor ) { character.Pawn.SetColor(startingWeapon.color); //} } if (cameraBehaviour != null) { var cameraBehaviourInstance = Instantiate(cameraBehaviour); cameraBehaviourInstance.transform.position = transform.position; cameraBehaviourInstance.SetTarget(character.Pawn); } }
public EMCharacter Spawn() { var result = _characterInfo.GetCharacter(_battleGrid); if (_startFromEnd) { result.SetPosition(_battleGrid.GetWidth() - 1, 0, updatePawnPosition: true); } result.MoveBy(_startOffsetX, _startOffsetY); _spawnedCharacter = result; var weapon = _startingWeaponInfo.GetItem(); weapon.SetCharacter(_spawnedCharacter); weapon.Apply(); //_spawnedCharacter.Inventory.SetArmSlotItem( ArmSlotType.Primary, _startingWeaponInfo.GetItem() ); return(result); }
private void Spawn() { Debug.Log(123124); foreach (var spawner in Spawners) { var character = characterInfo.GetCharacter(startingPosition: spawner.transform.position); //character.ItemsToDrop = default ( ItemInfo ); /* fixit */ if (startingWeapon != null) { var weapon = startingWeapon.GetItem(); character.Inventory.AddItem(weapon); weapon.Apply(); //if ( characterInfo.applyColor ) { character.Pawn.SetColor(startingWeapon.color); //} } } }