Commit 9c803572 authored by Sebastian's avatar Sebastian

Merge remote-tracking branch 'origin/master'

parents 11eb3c59 7230b287
......@@ -13,7 +13,7 @@ MonoBehaviour:
m_Name: HealthInitialVariable
m_EditorClassIdentifier:
DeveloperDescription:
value: 10
value: 2
oldValue: 10
Changed: {fileID: 0}
ChangedWithHistory: {fileID: 0}
......@@ -56,7 +56,7 @@ CapsuleCollider:
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 1
m_Radius: 1.2
m_Height: 3.7
m_Direction: 1
m_Center: {x: -0, y: 1.9, z: -0}
......
......@@ -1973,17 +1973,17 @@ RectTransform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5638002898429637794}
m_LocalRotation: {x: -0, y: -0, z: -0.16791996, w: 0.9858006}
m_LocalRotation: {x: -0, y: -0, z: -0.20987998, w: 0.9777272}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 2943840638048515376}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -19.334002}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 107, y: 134}
m_SizeDelta: {x: 701.7, y: 350.9}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: -24.231}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 92, y: 140}
m_SizeDelta: {x: -253.79999, y: 313.5}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &9194969150082210956
CanvasRenderer:
......
......@@ -1273,7 +1273,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -253, y: 135}
m_AnchoredPosition: {x: -253, y: 157}
m_SizeDelta: {x: 647.9, y: 415.3}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &904270023
......@@ -1808,8 +1808,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -294.4, y: -53}
m_SizeDelta: {x: -725.9, y: -214.9}
m_AnchoredPosition: {x: -300.3, y: -75.143}
m_SizeDelta: {x: -714.2, y: -170.61}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1255162963
GameObject:
......
......@@ -15,6 +15,9 @@ public class CustomerBehaviour : MonoBehaviour
[SerializeField] private float orderPopUpTime = 5;
[SerializeField] private float waitingTime = 90;
private bool _percOne = false;
private bool _percTwo = false;
private bool _percThree = false;
private GameObject _cameraObject;
private NavMeshAgent _agent;
......@@ -100,6 +103,25 @@ public class CustomerBehaviour : MonoBehaviour
_state = CustomerState.Leaving;
}
if (_customerBar.getPercentage() >= 0.25 && !_percOne)
{
StartCoroutine(OrderAgain(orderPopUpTime));
_percOne = true;
}
if (_customerBar.getPercentage() >= 0.50 && !_percTwo)
{
StartCoroutine(OrderAgain(orderPopUpTime));
_percTwo = true;
}
if (_customerBar.getPercentage() >= 0.75 && !_percThree)
{
StartCoroutine(OrderAgain(orderPopUpTime));
_percThree = true;
}
_playerActor.gameObject.transform.LookAt(_playerActor.gameObject.transform.position + _agent.velocity);
Vector3 trans = _customerBar.transform.position;
......@@ -107,16 +129,27 @@ public class CustomerBehaviour : MonoBehaviour
_orderPopUp.transform.LookAt(_cameraObject.transform);
}
private IEnumerator OrderAndWait(float orderDuration)
private IEnumerator OrderAgain(float orderDuration)
{
//_customerBar.gameObject.SetActive(false);
_orderPopUp.SetActive(true);
yield return new WaitForSeconds(orderDuration);
_orderPopUp.SetActive(false);
//_customerBar.gameObject.SetActive(true);
_state = CustomerState.Random;
}
private IEnumerator OrderAndWait(float orderDuration)
{
_orderPopUp.SetActive(true);
yield return new WaitForSeconds(orderDuration);
_orderPopUp.SetActive(false);
_customerBar.gameObject.SetActive(true);
_customerBar.initializeBar(90f);
_customerBar.initializeBar(90f);
_state = CustomerState.Random;
......@@ -175,17 +208,18 @@ public class CustomerBehaviour : MonoBehaviour
_agent.SetDestination(transform.parent.position);
_customerBar.gameObject.SetActive(false);
_state = CustomerState.Leaving;
Destroy(other.gameObject);
}
else
{
// Wrong Beer
_playerActor.AudioSource.PlayOneShot(_customerSounds.GetHappyClip(), 0.2f);
_customerBar.addPercentageOfSlider(-0.3f);
Destroy(other.gameObject);
}
}
}else if (other.collider.gameObject.CompareTag("Projectile"))
Destroy(other.gameObject);
}
else if (other.collider.gameObject.CompareTag("Projectile"))
{
_playerActor.AudioSource.PlayOneShot(_customerSounds.GetSadClip(), 0.2f);
_customerBar.addPercentageOfSlider(0.3f);
......
......@@ -45,7 +45,7 @@ public class PlayerBazookaAiming : MonoBehaviour
_playerActor.LineRenderer.SetPosition(0, bazookaPos);
List<Vector3> bezierCurve;
if (Physics.Raycast(aimRay, out RaycastHit raycastHit, 0, LayerMask.GetMask("Environment")) && raycastHit.distance <= dashSize)
if (Physics.Raycast(aimRay, out RaycastHit raycastHit, 0, LayerMask.GetMask("Environment", "Customer")) && raycastHit.distance <= dashSize)
{
Vector3 pos2 = bazookaPos + (raycastHit.point - bazookaPos) / 2;
......
......@@ -77,7 +77,7 @@ public class PlayerInputSystemManager : MonoBehaviour, IInputManager
return false;
if (GetGamePadCount() >= playerNumber)
result = _gamepads[playerNumber - 1].xButton.isPressed;
result = _gamepads[playerNumber - 1].leftTrigger.isPressed;
if (GetGamePadCount() == 0)
result = Keyboard.current.spaceKey.isPressed;
......@@ -94,10 +94,10 @@ public class PlayerInputSystemManager : MonoBehaviour, IInputManager
return false;
if (GetGamePadCount() >= playerNumber)
result = _gamepads[playerNumber - 1].rightTrigger.wasPressedThisFrame || _gamepads[playerNumber - 1].leftTrigger.wasPressedThisFrame;
result = _gamepads[playerNumber - 1].rightTrigger.isPressed;
if (GetGamePadCount() == 0)
result = Keyboard.current.fKey.wasPressedThisFrame;
result = Keyboard.current.fKey.isPressed;
return result;
}
......
......@@ -27,7 +27,7 @@ public class PlayerRotate : MonoBehaviour
if (_playerActor.PlayerMovement != null)
{
if (_playerActor.PlayerMovement.MoveDirection.sqrMagnitude > 0.1)
if (_playerActor.PlayerMovement.MoveDirection.sqrMagnitude > 0)
direction = _playerActor.PlayerMovement.MoveDirection.normalized;
if (!_playerActor.PlayerMovement.MoveDirection.Equals(Vector3.zero))
......
......@@ -70,5 +70,10 @@ public class CustomerBar : MonoBehaviour
{
return (customerSlider.value >= 100);
}
public float getPercentage()
{
return _currentTime / durationTime;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment