Exemple #1
0
        private IEnumerator Move(Int2 from, Int2 to)
        {
            Vector3 fromPosition = LevelAssistant.CoordsToPosition(from);
            Vector3 toPosition   = LevelAssistant.CoordsToPosition(to);

            float   step       = LevelAssistant.SLOT_SIZE / _framesCount;
            Vector3 stepVector = (toPosition - fromPosition).normalized * step;
            float   pathLength = 0;

            while (pathLength < LevelAssistant.SLOT_SIZE)
            {
                transform.position += stepVector;
                pathLength         += step;

                yield return(new WaitForSeconds(FramePeriod));
            }

            transform.position = toPosition;
        }
Exemple #2
0
 public void Initialize(LevelObject levelObject)
 {
     _levelObject       = levelObject;
     transform.position = LevelAssistant.CoordsToPosition(_levelObject.coords);
 }
Exemple #3
0
 private void ActualizeTransform()
 {
     transform.position    = LevelAssistant.CoordsToPosition(Coords);
     transform.eulerAngles = new Vector3(0, 0, _direction.ToAngle());
 }