| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- namespace WildAttack
- {
- public class SmartBowController : MonoBehaviour
- {
- public static SmartBowController Instance;
- void Start()
- {
- Instance = this;
- SimulateMouseController.ins?.RemoveOpenLocker("NotGame");
- CameraToLook.ins.onParseRotation += OnRotationUpdate;
- StartCoroutine(SetOutBoundChecker());
- }
- IEnumerator SetOutBoundChecker()
- {
- yield return null;
- CrossHairOutBoundChecker1 outBoundChecker = Instantiate(Resources.Load<GameObject>("Prefabs/CrossHairOutBoundChecker1")).GetComponent<CrossHairOutBoundChecker1>();
- outBoundChecker.FetchOutBoundIndex = () => GameMananger.GetInstance().outBoundIndex;
- }
- void OnDestroy()
- {
- if (Instance == this) Instance = null;
- }
- public void OnRotationUpdate(Quaternion rotation)
- {
- if (SB_EventSystem.ins.simulateMouseIsAwaked) return;
- GameMananger.GetInstance().OnRotationUpdate(rotation);
- }
- public void OnShooting(float speed)
- {
- if (Time.time == 0) return;
- GameMananger.GetInstance().OnModuleShooting(speed);
- }
- public bool IsBluetoothModuleInited()
- {
- return BluetoothAim.ins && BluetoothAim.ins.status == BluetoothStatusEnum.ConnectSuccess;
- }
- }
- }
|