Exemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (onCooldown == true)
        {
            return;
        }
        if (other.CompareTag("Player"))
        {
            GameObject pointCorn = PlayerInventory.GetUnicorn(type);

            if (pointCorn != null)
            {
                ParticleSpawner.SpawnParticleEffect(ParticleSpawner.Particles.Delivery, particlePoint.position);
                AudioController.Instance.GenerateAudio(AudioController.ClipName.GotBallon, transform.position, gotBalloon);
                onCooldown = true;
                SpawnSystem.AddSpawnPoint(pointCorn.GetComponent <UnicornStats>().GetSpawn(), pointCorn);
                PointHandeler.SuccessfulDelivery(this, successDelay, positivePoint);
                pointCorn.GetComponent <UnicornStats>().GetPooled();
                successfulDelivery = true;
                if (coroutineRunning == true)
                {
                    StopCoroutine(delivery);
                    coroutineRunning = false;
                }
                uiElement.EndTimer();
            }
            else
            {
                AudioController.Instance.GenerateAudio(AudioController.ClipName.WrongBallon, transform.position, wrongBalloon);
            }
        }
    }
Exemplo n.º 2
0
 //When instantiated call method sending coords as parameter
 private void Awake() => SpawnSystem.AddSpawnPoint(transform);