Esempio n. 1
0
    public void Generate()
    {
        spriteRenderer = GetComponent <SpriteRenderer>();
        Vector3 pos =
            SpriteScrollUtility.FindNextElementPosition(DunesManager.instance.dunes);

        pos.y = transform.position.y;
        transform.position = pos;
        DunesManager.instance.dunes.Add(transform);
        transform.SetParent(DunesManager.instance.duneCollector);
        name = "Dune";
    }
Esempio n. 2
0
    void PoolDune()
    {
        if (!firstDunePool)
        {
            dunes.RemoveAt(0);
            firstDunePool = true;
        }

        Transform tempDune = dunes[0];

        dunes.RemoveAt(0);
        tempDune.position = SpriteScrollUtility.FindNextElementPosition(DunesManager.instance.dunes);
        dunes.Add(tempDune);
    }