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); }
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(); }