public override IEnumerator PlayInternal(CinematicDirector player)
    {
        Renderer[] renderers = GameObject.FindObjectsOfType <Renderer>();
        for (int i = 0; i < renderers.Length; ++i)
        {
            if (renderers[i].material.HasProperty("_Distance"))
            {
                CinematicHelpers.MakeMaterialInstancedIfNecessary(renderers[i]);
                renderers[i].material.SetFloat("_Distance", -1f);
            }
        }

#if USING_CREATIVESPORE
        STETilemap[] tileMaps = GameObject.FindObjectsOfType <STETilemap>();
        for (int i = 0; i < tileMaps.Length; ++i)
        {
            if (tileMaps[i].Material.HasProperty("_Distance"))
            {
                CinematicHelpers.MakeMaterialInstancedIfNecessary(tileMaps[i]);
                tileMaps[i].Material.SetFloat("_Distance", -1f);
            }
        }
#endif
        yield break;
    }
    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;
    }
示例#3
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;
    }