void Awake() { try{ DontDestroyOnLoad(this); s_GameMaim = this; s_Root = this.gameObject; FrameHandle.UF_AddHandle(Debugger.UF_GetInstance()); //System FrameHandle.UF_AddHandle(MessageSystem.UF_GetInstance()); FrameHandle.UF_AddHandle(UpgradeSystem.UF_GetInstance()); //FrameHandle.UF_AddHandle(NetworkSystem.UF_GetInstance()); FrameHandle.UF_AddHandle(AssetSystem.UF_GetInstance()); FrameHandle.UF_AddHandle(CEntitySystem.UF_GetInstance()); //FrameHandle.UF_AddHandle(LuaFramework.UF_GetInstance()); //manager FrameHandle.UF_AddHandle(PDataManager.UF_GetInstance()); FrameHandle.UF_AddHandle(ShaderManager.UF_GetInstance()); FrameHandle.UF_AddHandle(AudioManager.UF_GetInstance()); FrameHandle.UF_AddHandle(UIManager.UF_GetInstance()); FrameHandle.UF_AddHandle(FXManager.UF_GetInstance()); FrameHandle.UF_AddHandle(NavigateManager.UF_GetInstance()); FrameHandle.UF_AddHandle(MotionManager.UF_GetInstance()); //FrameHandle.UF_AddHandle(PerformActionManager.UF_GetInstance()); FrameHandle.UF_AddHandle(RaycastManager.UF_GetInstance()); FrameHandle.UF_AddHandle(VoiceManager.UF_GetInstance()); FrameHandle.UF_AddHandle(RenderPreviewManager.UF_GetInstance()); FrameHandle.UF_AddHandle(RefObjectManager.UF_GetInstance()); FrameHandle.UF_AddHandle(CheckPointManager.UF_GetInstance()); FrameHandle.UF_AddHandle(SimulationManager.Instance); //setting GTime.FrameRate = 60; GTime.FixedTimeRate = 0.016f; GTime.RunDeltaTime = 0.016f; Screen.sleepTimeout = SleepTimeout.NeverSleep; VendorSDK.UF_Init(); //VestBinder.Bind(); } catch (System.Exception e) { Debugger.UF_Exception(e); } }
public int UF_NavigateTo(GameObject gameObject, SceneMap map, Vector3 tarPosition, float duration, DelegateVoid callback) { int ret = 0; Vector2 sorPoint = map.UF_GetGridPoint(gameObject.transform.position); Vector2 tarPoint = map.UF_GetGridPoint(tarPosition); float curdiatance = Vector3.Distance(sorPoint, tarPosition); var listGridPosition = ListCache <Vector3> .Acquire(); UF_FindingPath(map, listGridPosition, (int)sorPoint.x, (int)sorPoint.y, (int)tarPoint.x, (int)tarPoint.y); if (listGridPosition.Count > 1) { //替换起始点为当前点 listGridPosition[0] = sorPoint; //替换尾部点为目标点 listGridPosition[listGridPosition.Count - 1] = tarPoint; ret = MotionManager.UF_GetInstance().UF_AddPathPoint(gameObject.transform, listGridPosition, duration, false, 0, true, Vector3.zero, true, callback); } ListCache <Vector3> .Release(listGridPosition); return(ret); }
public void UF_NavigateStop(int handle) { MotionManager.UF_GetInstance().UF_Remove(handle); }