FlowManager.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. using WS;
  4. public class FlowManager : MonoBehaviour
  5. {
  6. public static FlowManager Inst;
  7. public List<FlowBase> flows;
  8. public int flowIndex;
  9. public FlowBase currFlowBase;
  10. void Start()
  11. {
  12. Inst = this;
  13. StartFlow();
  14. }
  15. // Update is called once per frame
  16. void Update()
  17. {
  18. if (currFlowBase != null)
  19. {
  20. currFlowBase.UpdateFlow();
  21. }
  22. }
  23. private void StartFlow()
  24. {
  25. FacadeComponent.Instance.CreateController<PointController>().OpenView();
  26. flowIndex = 0;
  27. currFlowBase = flows[flowIndex];
  28. }
  29. public void NextFlow()
  30. {
  31. flowIndex += 1;
  32. currFlowBase = flows[flowIndex];
  33. currFlowBase.StartFlow();
  34. }
  35. public void LastFlow() { }
  36. private void EndFlow() { }
  37. public void CheckCollider(Collider collider, bool isEnter)
  38. {
  39. if (currFlowBase.state == FlowBase.FlowState.Collider)
  40. {
  41. ((FlowCollider)currFlowBase).CheckPoint(collider, isEnter);
  42. }
  43. }
  44. }