public void SpawnPollen(Pollen pollen, PollenBehaviorData behaviorData) { _pollenSpawn.Spawn(pollen, Guid.NewGuid(), behaviorData); pollen.transform.SetParent(GameManager.Instance.PollenContainer.transform); pollen.Initialize(GameManager.Instance.GameGameData.PollenData); }
private bool DoSpawnPollen() { if (!_canSpawnPollen || ActorManager.Instance.ActorCount <Pollen>() >= FlowerBehaviorData.MaxPollen) { return(false); } Pollen pollen = ObjectPoolManager.Instance.GetPooledObject <Pollen>("pollen"); FlowerNPC.SpawnPollen(pollen, FlowerBehaviorData.PollenBehaviorData); return(true); }
public Flower(WorldSectionStateGenerator generator) { this.Id = generator.NextEntityId(); this.PositionX = generator.NextPosition(); this.PositionY = generator.NextPosition(); var lPollenCount = generator.NextValue(2, 10); var lPollenArray = new Pollen[lPollenCount]; this.Pollen = lPollenArray; for (var lIndex = 0; lIndex < lPollenCount; lIndex++) { lPollenArray[lIndex] = new Pollen(generator); } }
public void OnAddPollen(Pollen pollen) { _pollen.Add(pollen); }
public void AddPollen(Pollen pollen) { GamePlayerBehavior.OnAddPollen(pollen); }