FlowManager.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. if (FacadeComponent.Instance.GetController<PointController>() == null)
  26. FacadeComponent.Instance.CreateController<PointController>().OpenView();
  27. flowIndex = 0;
  28. currFlowBase = flows[flowIndex];
  29. }
  30. public void NextFlow()
  31. {
  32. flowIndex += 1;
  33. if (flowIndex < flows.Count)
  34. {
  35. currFlowBase = flows[flowIndex];
  36. currFlowBase.StartFlow();
  37. }
  38. else
  39. {
  40. Debug.Log("Á÷³Ì½áÊø");
  41. }
  42. }
  43. public void LastFlow() { }
  44. private void EndFlow() { }
  45. public void CheckCollider(Collider collider, bool isEnter)
  46. {
  47. if (currFlowBase.state == FlowBase.FlowState.Collider)
  48. {
  49. ((FlowCollider)currFlowBase).CheckPoint(collider, isEnter);
  50. }
  51. }
  52. }