public override IEnumerator PlayInternal(CinematicDirector player)
    {
#if USING_CREATIVESPORE
        GameObject target = player.objectMap.GetObjectByName(mTarget);

        STETilemap actualTilemap = target.GetComponent <STETilemap>();
        CinematicHelpers.MakeMaterialInstancedIfNecessary(actualTilemap);

        float distance = -1f;
        while (distance < 1f)
        {
            SetMaterialDistance(actualTilemap, distance);
            distance += Time.deltaTime * (1 / mSeconds) * 2f * player.playbackTimeScale;
            yield return(null);
        }

        SetMaterialDistance(actualTilemap, 1f);
#endif
        yield break;
    }
Exemplo n.º 2
0
    public override IEnumerator PlayInternal(CinematicDirector player)
    {
        GameObject target = player.objectMap.GetObjectByName(mTarget);

        Renderer renderer = target.GetComponentInChildren <Renderer>();

        CinematicHelpers.MakeMaterialInstancedIfNecessary(renderer);

        float distance = -1f;

        while (distance < 1f)
        {
            renderer.material.SetFloat("_Distance", distance);
            distance += Time.deltaTime * (1 / mSeconds) * 2f * player.playbackTimeScale;
            yield return(null);
        }

        renderer.material.SetFloat("_Distance", 1f);

        yield break;
    }