1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using ChivaXR;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public delegate void PreprocessEventHandler(PreprocessBase process);
- /// <summary>
- /// 流程预处理
- /// 语音/视角控制等
- /// </summary>
- public class PreprocessBase : MonoBehaviour
- {
- [HideInInspector]
- public ProcessElement currentProcessElement;
- public event PreprocessEventHandler Preprocess_EnterEvent;
- public event PreprocessEventHandler Preprocess_ExitEvent;
- public event PreprocessEventHandler Preprocess_HalfExitEvent;
- /// <summary>
- /// 进入流程
- /// </summary>
- /// <param name="p"></param>
- public virtual void Enter(ProcessElement p)
- {
- currentProcessElement = p;
- Preprocess_EnterEvent?.Invoke(this);
- }
- /// <summary>
- /// 完成离开
- /// </summary>
- public virtual void Exit()
- {
- Preprocess_ExitEvent?.Invoke(this);
- currentProcessElement.ProProcessFinished();
- }
- /// <summary>
- /// 中途退出流程
- /// </summary>
- public virtual void QuitHalfWay()
- {
- Preprocess_HalfExitEvent?.Invoke(this);
- }
- }
|