Beispiel #1
0
    protected void CreateIce(IceScript iceScript)
    {
        bool isMelange = iceScript.Get_attribute().isMelange;

        iceScript.Get_attribute().Combine(attribute);
        iceScript.Get_attribute().isMelange    = isMelange;
        iceScript.Get_attribute().life         = 1;
        iceScript.Get_attribute().life_current = 1;

        iceScript.ResetAttributes();
        iceScript.resetUpdateLife = true;
        iceScript.Get_rb().velocity        = Vector2.zero;
        iceScript.Get_transform().position = transform.position;
    }
Beispiel #2
0
    IEnumerator EatIce(IceScript iceScript)
    {
        if (iceScript != null)
        {
            if (iceScript.id > 0)
            {
                iceScript.Get_rb().constraints = RigidbodyConstraints2D.FreezeAll;
                iceScript.gameObject.GetComponent <Collider2D>().enabled = false;
                cone.RemoveIce(iceScript.id);
                iceScript.RemoveFromCone();

                yield return(new WaitForSeconds(.2f));
            }

            progressDisplay.UpdateProgressDisplay(iceScript.Get_attribute());
            anim.SetTrigger("squeesh");
        }
        if (iceScript != null)
        {
            Destroy(iceScript.gameObject);
        }
        yield break;
    }