|
@ -148,8 +148,8 @@ public class Character : MonoBehaviour |
|
|
IEnumerator PushLeftCoroutine(Transform Current, float time) |
|
|
IEnumerator PushLeftCoroutine(Transform Current, float time) |
|
|
{ |
|
|
{ |
|
|
float elapsedTime = 0; |
|
|
float elapsedTime = 0; |
|
|
Vector3 startPosition = Current.position; |
|
|
|
|
|
Vector3 endPosition = new Vector3(Current.position.x - 1, Current.position.y, Current.position.z); |
|
|
|
|
|
|
|
|
Vector3 startPosition = Current.transform.position; |
|
|
|
|
|
Vector3 endPosition = new Vector3(Current.position.x, Current.position.y, Current.position.z - 10); |
|
|
time *= 0.8f; |
|
|
time *= 0.8f; |
|
|
yield return new WaitForSeconds(0.05f); |
|
|
yield return new WaitForSeconds(0.05f); |
|
|
while (elapsedTime < time) |
|
|
while (elapsedTime < time) |
|
@ -164,8 +164,8 @@ public class Character : MonoBehaviour |
|
|
IEnumerator PushRightCoroutine(Transform Current, float time) |
|
|
IEnumerator PushRightCoroutine(Transform Current, float time) |
|
|
{ |
|
|
{ |
|
|
float elapsedTime = 0; |
|
|
float elapsedTime = 0; |
|
|
Vector3 startPosition = Current.position; |
|
|
|
|
|
Vector3 endPosition = new Vector3(Current.position.x + 1, Current.position.y, Current.position.z); |
|
|
|
|
|
|
|
|
Vector3 startPosition = Current.transform.position; |
|
|
|
|
|
Vector3 endPosition = new Vector3(Current.position.x, Current.position.y, Current.position.z + 10); |
|
|
time *= 0.8f; |
|
|
time *= 0.8f; |
|
|
yield return new WaitForSeconds(0.05f); |
|
|
yield return new WaitForSeconds(0.05f); |
|
|
while (elapsedTime < time) |
|
|
while (elapsedTime < time) |
|
@ -253,11 +253,11 @@ public class Character : MonoBehaviour |
|
|
Vector3 position = _currentBlock.position + direction.ToVector(transform); // position wanted
|
|
|
Vector3 position = _currentBlock.position + direction.ToVector(transform); // position wanted
|
|
|
StartCoroutine(MoveConveyorCoroutine(_currentBlock, transform, speed, 0.3f)); |
|
|
StartCoroutine(MoveConveyorCoroutine(_currentBlock, transform, speed, 0.3f)); |
|
|
} |
|
|
} |
|
|
public void CannonRMove(Direction direction, float speed) |
|
|
|
|
|
|
|
|
public void CannonRMove(float speed) |
|
|
{ |
|
|
{ |
|
|
StartCoroutine(PushRightCoroutine(transform, speed)); |
|
|
StartCoroutine(PushRightCoroutine(transform, speed)); |
|
|
} |
|
|
} |
|
|
public void CannonLMove(Direction direction, float speed) |
|
|
|
|
|
|
|
|
public void CannonLMove(float speed) |
|
|
{ |
|
|
{ |
|
|
StartCoroutine(PushLeftCoroutine(transform, speed)); |
|
|
StartCoroutine(PushLeftCoroutine(transform, speed)); |
|
|
} |
|
|
} |
|
|