Exemple #1
0
 private void Callback_OnEnergySeedGathered(EnergySeed seed)
 {
     if (seed != null && _spawnedSeeds.Contains(seed))
     {
         _spawnedSeeds.Remove(seed);
     }
 }
Exemple #2
0
    private void SpawnSeed(SeedController seedController, Vector3 pos)
    {
        EnergySeed spawnedSeed = Instantiate(_seedPrefab, transform).GetComponent <EnergySeed>();

        spawnedSeed.transform.position = pos;

        spawnedSeed.Setup(seedController.PlayerType, seedController.SeedColor);
    }
Exemple #3
0
 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));
     }
 }