Exemplo n.º 1
0
    public void CC()
    {
        if (m_broom.enabled == true)
        {
            return;
        }

        if (isCCed == true)
        {
            return;
        }

        if (m_ccedParticle)
        {
            var hitobj = JEffectPool.CreateEffect(m_ccedParticle);
            hitobj.transform.position = transform.position + new Vector3(0, 5, 0);
            hitobj.transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z);

            hitobj.GetComponent <AudioSource>().Play();
            //hitobj.transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, hitobj.transform.rotation.eulerAngles.y, hitobj.transform.rotation.eulerAngles.z); //endast för 2D
        }

        for (int i = 0; i < rends.Length; i++)
        {
            rends[i].material.color = ccedColor;
        }

        m_animator.SetFloat("ExtraSpeed", 0.6f);
        StartCoroutine(GetCCed());
    }
Exemplo n.º 2
0
    public void M_Die()
    {
        if (m_deathParticle)
        {
            var hitobj = JEffectPool.CreateEffect(m_deathParticle);
            hitobj.transform.position = transform.position;
            hitobj.transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z);
            //hitobj.transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, hitobj.transform.rotation.eulerAngles.y, hitobj.transform.rotation.eulerAngles.z); //endast för 2D
        }

        Destroy(gameObject);
    }
Exemplo n.º 3
0
    public void M_Die(Vector3 vec)
    {
        if (m_deathParticle)
        {
            var hitobj             = JEffectPool.CreateEffect(m_deathParticle);
            ExplosionChildren expl = hitobj.GetComponent <ExplosionChildren>();
            if (expl)
            {
                expl.Explode(vec);
            }
            hitobj.transform.position = transform.position;
            hitobj.transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z);
            //hitobj.transform.rotation = Quaternion.Euler(transform.rotation.eulerAngles.x, hitobj.transform.rotation.eulerAngles.y, hitobj.transform.rotation.eulerAngles.z); //endast för 2D
        }

        if (m_killedbyPlayer)
        {
            killCount++;
            killCountText.text = killCount.ToString();
        }

        Destroy(gameObject);
    }