Пример #1
0
        public override void SetDirection(HighwayDirection direction)
        {
            if (direction == Direction)
            {
                return;
            }

            Direction             = direction;
            transform.eulerAngles = new Vector3(0, (int)direction);
        }
Пример #2
0
        public override void SetDirection(HighwayDirection direction)
        {
            if (direction == Direction || direction == HighwayDirection.UP)
            {
                return;
            }

            Direction             = direction;
            transform.eulerAngles = new Vector3(0, (int)direction * 0.5f);
            transform.ChangePositionWithChild("FinishPosition");
        }
Пример #3
0
        private T GenerateHighway <T>(HighwayDirection cornerDirection, HighwayBase highwayBase, bool rotate = true)
            where T : HighwayBase
        {
            var highway = _poolManager.GetAvailableHighWay <T>();

            highway.SetDirection(cornerDirection);
            if (highwayBase != null)
            {
                highway.transform.position = highwayBase.FinishPosition;
                if (rotate)
                {
                    highway.transform.Rotate(highwayBase.transform.eulerAngles.y * Vector3.up);
                }
            }

            _levelManager.AddLevel(_levelIndex, highway);
            return(highway);
        }
Пример #4
0
 public abstract void SetDirection(HighwayDirection direction);