Beispiel #1
0
        private void Awake()
        {
            // Get GameConfig reference via container.
            _gameConfig = Globals.Instance.GetData <GameConfigData>();

            _transform = transform;
        }
Beispiel #2
0
        private void Awake()
        {
            // Get GameConfigData reference via container.
            _gameConfig = Globals.Instance.GetData <GameConfigData>();

            // Get RelativeCoordinates reference via container.
            _relativeCoordinates = Globals.Instance.GetDependency <RelativeCoordinates>();

            // Required component.
            _roadSegment = GetComponent <RoadSegment>();

            // Get Transform reference.
            _transform = transform;

            _renderer = GetComponentInChildren <MeshRenderer>();

            // Clone material.
            Material originMaterial = _renderer.sharedMaterial;

            _material = Instantiate(originMaterial);
            _renderer.sharedMaterial = _material;

            _material.SetFloat("_PositionZ", _transform.position.z);
            _material.SetFloat("_Progress", 0);
        }
Beispiel #3
0
        private void Awake()
        {
            // Get GameConfigData reference via container.
            _gameConfig = Globals.Instance.GetData <GameConfigData>();

            // Required component.
            _playerCharacter = GetComponent <PlayerCharacter>();
        }
Beispiel #4
0
        private void Awake()
        {
            // Get GameConfig reference via container.
            _gameConfig = Globals.Instance.GetData <GameConfigData>();

            // Required component.
            _grid = GetComponent <Grid>();
        }
Beispiel #5
0
        private void Awake()
        {
            // Get GameConfig reference via container.
            _gameConfig = Globals.Instance.GetData <GameConfigData>();

            // Create generator instance.
            _generator = new GridGenerator(_gameConfig);
        }
Beispiel #6
0
        private void Awake()
        {
            // Get GameConfig reference via container.
            _gameConfig = Globals.Instance.GetData <GameConfigData>();

            // Get RelativeCoordinates reference via container.
            _relativeCoordinates = Globals.Instance.GetDependency <RelativeCoordinates>();

            _transform = transform;

            // Required component.
            _grid = GetComponent <Grid>();

            InitializeRows();
        }
        public GridGenerator(GameConfigData config)
        {
            // Get GameConfig referece from parent object.
            _gameConfig = config;

            // Init lead arrays.
            _lead     = new int[_gameConfig.GridSettings.LeadLinesCount];
            _lastLead = new int[_gameConfig.GridSettings.LeadLinesCount];

            // Set lead index is center.
            for (int i = 0; i < _gameConfig.GridSettings.LeadLinesCount; i++)
            {
                _lead[i]     = _gameConfig.GridSettings.TotalLinesCount / 2;
                _lastLead[i] = _lead[i];
            }
        }
Beispiel #8
0
 protected virtual void Awake()
 {
     // Get GameConfigData reference via container.
     _gameConfig = Globals.Instance.GetData <GameConfigData>();
 }