Exemple #1
0
        /// <summary>
        /// Vector based on characters current (aka last) facing direction
        /// </summary>
        /// <param name="multiplier"></param>
        /// <returns></returns>
        private Vector3 CalculateIsoForward(IsometricPlayerMovementController isoContoller)
        {
            Vector2 lastDirection = isoContoller.isoRenderer.lastDirectionAsVector;

            Vector3 isoDirectionalForward = new Vector3(1, 1, 0);

            if (lastDirection.x == 0)
            {
                isoDirectionalForward.x = 0;
            }

            if (lastDirection.x < 0)
            {
                isoDirectionalForward.x = -1;
            }

            if (lastDirection.y == 0)
            {
                isoDirectionalForward.y = 0;
            }

            if (lastDirection.y < 0)
            {
                isoDirectionalForward.y = -1;
            }

            return(isoDirectionalForward);
        }
Exemple #2
0
 private void Start()
 {
     _movementController = gameObject.GetComponent <IsometricPlayerMovementController>();
 }