Ejemplo n.º 1
0
    IEnumerator GrowPortal(float seconds)
    {
        portalGrowing = true;
        if (!warpParticleSystem.isPlaying)
        {
            warpParticleSystem.Play();
        }

        float   end   = Time.time + seconds;
        float   scale = 0f;
        Vector3 max   = new Vector3(PortalMaxScale, PortalMaxScale, PortalMaxScale);

        ParentJellySprite.SetPosition(warpParticleSystem.transform.position, false);
        yield return(null);

        while (Time.time < end && Warping)
        {
            scale = 1f - (end - Time.time) / seconds;
            warpParticleSystem.transform.localScale = max * scale;
            ParentJellySprite.CentralPoint.Body2D.MovePosition(warpParticleSystem.transform.position);
            yield return(null); //new WaitForSeconds(0.05f);
        }

        if (Warping)
        {
            StartCoroutine(ShrinkEverything(seconds));
        }

        portalGrowing = false;
    }
Ejemplo n.º 2
0
    public bool PlaceRigidbodyInCage(UnityJellySprite specimen)
    {
        for (int i = 0; i < specimens.Length; ++i)
        {
            if (specimens[i] == null)
            {
                specimen.SetPosition(Cages[i].position, true);
                specimens[i] = specimen;
                return(true);
            }
        }

        return(false);
    }