UseUp() public method

public UseUp ( Vector3 originalScale ) : void
originalScale Vector3
return void
コード例 #1
0
ファイル: cauldron_nom.cs プロジェクト: mugwhump/IronicWizard
    IEnumerator shrink(float time, Edible toShrink)
    {
        isShrink = true;
        Vector3 originalScale = toShrink.transform.localScale;
        Vector3 destinationScale = new Vector3(0.1f,0.1f,0.1f);

        float currentTime = 0.0f;

        do
        {
            toShrink.transform.localScale = Vector3.Lerp(originalScale, destinationScale, currentTime / time);
            currentTime += Time.deltaTime;
            yield return null;
        } while (currentTime <= time);
        isShrink = false;
        toShrink.UseUp(originalScale);
    }