Beispiel #1
0
    public void OpenDoor()
    {
        setColorValue(slimeMaterial, slimeColorID, color, Mathf.Max(0.1f, animationDuration - 0.3f));
        setColorValue(rubyGateMaterial, rubyGateMainColorID, color, animationDuration);
        setColorValue(rubyGateMaterial, rubyGateSecondaryColorID, color, animationDuration);
        setColorValue(portalMaterial, portalColorID, (mustWeakenPortalColor) ? weakenedColor : color, Mathf.Max(0.1f, animationDuration - 0.3f));
        setColorValue(portalMaterial, portalBackgroundColorID, (mustWeakenPortalColor) ? veryWeakenedColor : color, Mathf.Max(0.1f, animationDuration - 0.3f));
        setColorValue(portalMaterial, portalTransparencyID, Color.white, Mathf.Max(0.1f, animationDuration - 0.3f));
        setColorValue(gateMaterial, gateOutlineColorID, strongerColor, animationDuration);

        slimeRenderer.transform.LeanMoveLocal(slimeEndPosition, animationDuration).setEaseOutElastic();
        slimeRenderer.transform.LeanScale(slimeEndScale, animationDuration).setEaseOutElastic();
        portalRenderer.transform.LeanMoveLocal(portalEndPosition, animationDuration).setEaseOutElastic();
        portalRenderer.transform.LeanScale(portalEndScale, animationDuration).setEaseOutElastic();
        floatScript tmp = null;

        for (int i = 0; i < rocks.Length; i++)
        {
            tmp = rocks[i].GetComponent <floatScript>();
            if (tmp != null)
            {
                tmp.isPaused = true;
                tmp.enabled  = false;
            }
            rocks[i].transform.LeanMoveLocal(rockEndPositions[i], animationDuration + Random.Range(0f, 0.1f)).setEaseOutElastic();
            Invoke("EnableRocks", animationDuration + 0.1f);
        }
    }
Beispiel #2
0
    public void EnableRocks()
    {
        floatScript tmp = null;


        for (int i = 0; i < rocks.Length; i++)
        {
            if (tmp != null)
            {
                tmp.enabled = true;
                tmp.Reset();
                tmp.isPaused = false;
            }
        }
    }