Exemplo n.º 1
0
    private IEnumerator CicleOfLog()
    {
        while (true)
        {
            var rand = Random.Range(2.2f, 5f);
            yield return(new WaitForSeconds(rand));


            var newLog = _mapManager.GetNewLog();

            if (_realSpawnPos == 0)
            {
                newLog.transform.position = _spanwPos1.position;
                newLog.move(-_moveTo);
            }
            else
            {
                newLog.transform.position = _spanwPos2.position;
                newLog.move(_moveTo);
            }
        }
    }