74 lines
2.1 KiB
C#
74 lines
2.1 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using BigSpace.Logic;
|
||
using BigSpace.XRCore.Event;
|
||
using UnityEngine;
|
||
|
||
public class NengNiangQiuCtr : MonoBehaviour
|
||
{
|
||
public GameObject nengniangquObj_L;
|
||
public GameObject nengniangquObj_R;
|
||
int _handType;
|
||
int _fontIndex;
|
||
// Start is called before the first frame update
|
||
void Start()
|
||
{
|
||
|
||
GlobalEventMgr.Listen<bool, int, int>(GameEvent.EventRayQuadOk, GameDataManage_EventRayQuadOk);
|
||
GlobalEventMgr.Listen<int>(GameEvent.EventHandRelease, GameDataManage_EventHandRelease);
|
||
GlobalEventMgr.Listen(GameEvent.EventHideCatchFont, GameDataManage_EventHideCatchFont);
|
||
|
||
}
|
||
|
||
// Update is called once per frame
|
||
void GameDataManage_EventRayQuadOk(bool isCatchOk, int handType, int fontIndex)
|
||
{
|
||
if (!SceneMgr.Instance.isTrigger)
|
||
{
|
||
_handType = handType;
|
||
_fontIndex = fontIndex;
|
||
if (_handType == 1)
|
||
{
|
||
nengniangquObj_L.SetActive(true);
|
||
}
|
||
else
|
||
{
|
||
nengniangquObj_R.SetActive(true);
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
void GameDataManage_EventHandRelease(int handType)
|
||
{
|
||
if (!SceneMgr.Instance.isTrigger)
|
||
{
|
||
if (handType == 1)
|
||
{
|
||
if (nengniangquObj_L.activeSelf)
|
||
{
|
||
nengniangquObj_L.SetActive(false);
|
||
//<2F><><EFBFBD>ֵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>
|
||
GlobalEventMgr.Dispatch(GameEvent.EventShowCatchFont, true, _handType, _fontIndex);//1<><31><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
}
|
||
}
|
||
else
|
||
{
|
||
if (nengniangquObj_R.activeSelf)
|
||
{
|
||
nengniangquObj_R.SetActive(false);
|
||
//<2F><><EFBFBD>ֵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>
|
||
GlobalEventMgr.Dispatch(GameEvent.EventShowCatchFont, true, _handType, _fontIndex);//2:<3A><><EFBFBD><EFBFBD>
|
||
}
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
void GameDataManage_EventHideCatchFont()
|
||
{
|
||
nengniangquObj_R.SetActive(false);
|
||
nengniangquObj_L.SetActive(false);
|
||
}
|
||
}
|