private void Callback_OnEnergySeedGathered(EnergySeed seed) { if (seed != null && _spawnedSeeds.Contains(seed)) { _spawnedSeeds.Remove(seed); } }
private void SpawnSeed(SeedController seedController, Vector3 pos) { EnergySeed spawnedSeed = Instantiate(_seedPrefab, transform).GetComponent <EnergySeed>(); spawnedSeed.transform.position = pos; spawnedSeed.Setup(seedController.PlayerType, seedController.SeedColor); }
private void Callback_OnEnergySeedGathered(EnergySeed seed) { if (seed != null) { float efficiency = 1f; if (seed.Type != _playerType) { efficiency = Mathf.Clamp(_sharedBoostEffiencyBasedOnRange.Evaluate(GetDistanceToLinkedController()), 0f, 1f); } AddLifetime(seed.AmountEnergy * efficiency); AddBoost(efficiency); StartCoroutine(SpawnBranchesFromSeed(efficiency)); } }