Files
PrinceOfGlory/Assets/Scripts/Help/SelfCharacterControllCtr.cs
kridoo 6e91a0c7f0 111
2025-09-15 17:32:08 +08:00

39 lines
930 B
C#

using System.Collections;
using System.Collections.Generic;
using BigSpace.Logic;
using BigSpace.XRCore.Event;
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>();
}
// Update is called once per frame
void Update()
{
}
void GameDataManage_EventSetReadyCatchAnimal(bool isShow)
{
if (isShow)
{
bodyBox.gameObject.SetActive(false);
characterCtr.enabled = true;
}
else
{
characterCtr.enabled = false;
bodyBox.gameObject.SetActive(true);
}
}
}