コード例 #1
0
        protected override void Awake()
        {
            base.Awake();

            _levelController = GetComponent <ProceduralLevelController>();

            // build 4 pieces of same road for the game start
            Depth = 0;
            StartCoroutine("_Start");
        }
コード例 #2
0
        void Awake()
        {
            if (Instance == null)
            {
                Instance = this;
            }
            else if (!System.Object.ReferenceEquals(Instance, this))
            {
                Debug.LogError("Instância de ProceduralLevelController já existe");
            }

            if (trailLeft == null)
            {
                Debug.LogError("trailLeft não definido");
            }

            if (trailCenter == null)
            {
                Debug.LogError("trailCenter não definido");
            }

            if (trailRight == null)
            {
                Debug.LogError("trailRight não definido");
            }

            // full fill navigation properties (quadrant1Instance/quadrant2Instance) of quadrantCombinations
            quadrantCombinations = quadrantCombinations
                                   .Join(quadrantTrailsCombinations, qc => qc.quadrant1, qtc => qtc.Id, (qc, qtc) => {
                qc.quadrant1Instance = qtc;
                return(qc);
            })
                                   .Join(quadrantTrailsCombinations, qc => qc.quadrant2, qtc => qtc.Id, (qc, qtc) => {
                qc.quadrant2Instance = qtc;
                return(qc);
            })
                                   .ToArray();
        }