protected void Callback_SpawnCar(IntCD CD, IVoidParam spawnCarParam) { SpawnCarParam _spawnCarParam = spawnCarParam as SpawnCarParam; var car = EntityManager.GetInstance().GenEntityGameObject(1, EntityFuncType.CrossRoadCar) as EntityCrossRoadCar; //var car = EntityManager.GetInstance().GetRandomEntity(ResType.Car, EntityFuncType.CrossRoadCar) as EntityCrossRoadCar; car.Init(_spawnCarParam.startPos, _spawnCarParam.endPos, _spawnCarParam.speed); //重要:Entity取出后先设置位置,再把Collider设置成true,防止在未设置位置时触发碰撞 car.position = _spawnCarParam.startPos; try { car.GetTrans().Find("Collider").gameObject.SetActive(true); } catch (System.Exception e) { #if UNITY_EDITOR throw new System.Exception(string.Format("汽车 {0} 取Collider 失败", car.mainGameObject.name)); #endif } car.LookAt(_spawnCarParam.endPos); car.Active(); CrossRoadModelManager.GetInstance().entityModel.AddToEntityMovables(car); if (CD != null) { CD.Reset(); CD.Run(); } }
/// <summary> /// 刷新主界面的数据 /// </summary> /// <param name="arg1"></param> /// <param name="arg2"></param> private void RefreshUIShowData(int arg1, IntCD arg2) { incomeCoinMS = PlayerDataModule.CurrScenePerMinCoin(true); earningsText.text = MinerBigInt.ToDisplay(incomeCoinMS) + GetL10NString("Ui_Text_67"); arg2.Reset(); arg2.Run(); }
protected void Tick_CD(int deltaTimeMs) { if (CD == null) { return; } int realCDVal = CD.org; CD.Tick(deltaTimeMs); if (CD.IsRunning() && CD.IsFinish()) { if (CD.cd < 0) { realCDVal += (-CD.cd); } CD.Reset(); ZooAddCoin(realCDVal); } }
private void Test02(int arg1, IntCD arg2) { LogWarp.LogErrorFormat("BBBBBBBBBBBBBBBBB {0} {1}", arg1, arg2.org); arg2.Reset(); arg2.Run(); }