using HighlightPlus; using UnityEngine; using UnityEngine.Playables; public class RayClliderManager : MonoBehaviour { public PlayableDirector TuoChe_PlayableDirector; public Animator Gengtian_animator; public HighlightEffect TuoChe_highlightEffect; public bool TuoChe_enabled; // Start is called before the first frame update void Start() { Gengtian_animator.enabled = false; if (Bootstrap.Instance != null) Bootstrap.Instance.eventCenter.AddEventListener(Enum_EventType.ΝΟ³΅, TuoCheEnabled); } private void TuoCheEnabled(bool value) { TuoChe_enabled = value; } // Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0) && TuoChe_enabled) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; bool raycast = Physics.Raycast(ray, out hit); if (raycast) { if (hit.collider.gameObject.name.Equals("ΝΟ³΅")) { Gengtian_animator.enabled = true; TuoChe_highlightEffect.highlighted = false; TuoChe_PlayableDirector.Play(); } } } } private void OnDisable() { if (Bootstrap.Instance != null) Bootstrap.Instance.eventCenter.RemoveEventListener(Enum_EventType.ΝΟ³΅, TuoCheEnabled); } }