56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.EventSystems;
|
|
using System.Reflection;
|
|
using UnityEngine.Events;
|
|
[Serializable]
|
|
public class MobileDownEvent : UnityEvent<string>
|
|
{
|
|
|
|
}
|
|
public class MobileController : PermanentTriggerBase
|
|
{
|
|
[ReconnetAtrribute]
|
|
public int downIndex = 0;
|
|
[SerializeField]
|
|
public MobileDownEvent[] mobileOnDown;
|
|
|
|
protected override void OnStart()
|
|
{
|
|
base.OnStart();
|
|
|
|
}
|
|
protected override void OnMEnter()
|
|
{
|
|
if (!GameManager.RunModelMgr.isAniOver) return;
|
|
base.OnMEnter();
|
|
if (GameManager.RunModelMgr.ModeType != E_ModeType.Study)
|
|
{
|
|
_highlight.SetHighlighted(true);
|
|
}
|
|
}
|
|
protected override void OnMExit()
|
|
{
|
|
if (GameManager.RunModelMgr.ModeType != E_ModeType.Study)
|
|
_highlight.SetHighlighted(false);
|
|
base.OnMExit();
|
|
}
|
|
protected override void OnMDown()
|
|
{
|
|
if (!GameManager.RunModelMgr.isAniOver) return;
|
|
if (downIndex >= mobileOnDown.Length)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (ProcessManager.Instance.IsRightSubProcessStepsTriggerID(triggerName, false) == 0)
|
|
{
|
|
mobileOnDown[downIndex]?.Invoke(triggerName);
|
|
downIndex++;
|
|
_highlight.SetHighlighted(false);
|
|
}
|
|
}
|
|
}
|