Files
PrinceOfGlory/Assets/Scripts/Help/SelfCharacterControllCtr.cs
Sora丶kong 2f0862b382 修复报错
2026-03-03 11:32:30 +08:00

38 lines
899 B
C#

using System.Collections;
using System.Collections.Generic;
using BigSpace.Logic;
using BigSpace.XRCore.Event;
using RenderHeads.Media.AVProVideo;
using UnityEngine;
public class SelfCharacterControllCtr : MonoBehaviour
{
public GameObject bodyBox;
CharacterController characterCtr;
// Start is called before the first frame update
void Start()
{
GlobalEventMgr.Listen<bool>(GameEvent.EventSetReadyCatchAnimal, GameDataManage_EventSetReadyCatchAnimal);
characterCtr = GetComponent<CharacterController>();
}
void GameDataManage_EventSetReadyCatchAnimal(bool isShow)
{
if (isShow)
{
bodyBox.gameObject.SetActive(false);
characterCtr.enabled = true;
}
else
{
characterCtr.enabled = false;
bodyBox.gameObject.SetActive(true);
}
}
}