Exemplo n.º 1
0
    public void Clap()
    {
        klapClip.PlayOnce(transform.position, 1, 1, 90, 1000);

        SenfController.e.senfticles.gameObject.SetActive(false);
        SenfController.e.senfticles.gameObject.SetActive(true);

        VirshlaCollision.e.Cleanup();
    }
Exemplo n.º 2
0
    public IEnumerator TimeD(string whatToSay)
    {
        EndSay();
        yield return(new WaitForSeconds(0.2f));

        panel.DOLocalMoveY(0, duration);

        angryClip.PlayOnce(Vector3.zero, 1, 1, 90, 1000);

        dialogueText.text = whatToSay;

        StartCoroutine(EndTimer());
    }
Exemplo n.º 3
0
    public void TakeDamage(int amount)
    {
        if (!isServer)
        {
            return;
        }

        currentHealth -= amount;
        if (currentHealth <= 0)
        {
            deathParticle = PoolingManager.e.explosionParticle;

            if (deathParticle)
            {
                deathParticle.transform.position = transform.position;
                deathParticle.Play();
            }

            if (deathClip)
            {
                deathClip.PlayOnce(transform.position, 1, 1, 90, 5);
            }

            if (destroyOnDeath)
            {
                Destroy(gameObject);



                return;
            }

            currentHealth = 0;
            Debug.Log("Dead!");

            currentHealth = maxHealth;

            if (gameObject.GetComponent <Renderer>())
            {
                StartCoroutine(HidePlayer());
            }

            RpcRespawn();
        }

        //healthBar.sizeDelta = new Vector2(currentHealth, healthBar.sizeDelta.y);
    }
Exemplo n.º 4
0
    public virtual void Fire()
    {
        if (cooldown > 0)
        {
            return;
        }

        cooldown = 1;

        if (!infiniteAmmo)
        {
            if (ammo <= 0)
            {
                if (fireNoAmmo)
                {
                    AudioSource.PlayClipAtPoint(fireNoAmmo, transform.position);
                }

                return;
            }

            ammo--;
        }

        if (fireFlash)
        {
            fireFlash.enabled = true;
            StartCoroutine(Flash());
        }

        if (fireShot)
        {
            fireShot.PlayOnce(transform.position);

            PoolingManager.e.PlayTail(transform.position);
        }

        if (fireParticles)
        {
            fireParticles.Emit(10);
        }
    }
Exemplo n.º 5
0
 public void PlayTail(Vector3 point)
 {
     tail.PlayOnce(point, 0.7f, 1, 150, 4);
 }