protected void SetCollectedState() { CaiJiPeiZhi caiJiPeiZhi = DataReader <CaiJiPeiZhi> .Get(this.collectionDataID); if (caiJiPeiZhi == null) { return; } if (this.animator && this.animator.HasAction(caiJiPeiZhi.action2)) { base.CastAction(caiJiPeiZhi.action2); string[] array = caiJiPeiZhi.specialEffects.Split(new char[] { ';' }); if (array.Length > 1) { int start = int.Parse(array[1]); this.deleteCollectingFxTimer = TimerHeap.AddTimer((uint)start, 0, delegate { FXManager.Instance.DeleteFX(this.collectingFxID); }); } } else { this.CollectedActionEnd(); } }
protected void RefreshCollect() { bool flag = false; for (int i = 0; i < this.mGoodsList.get_Count(); i++) { if (i >= base.Task.count) { CaiJiPeiZhi caiJiPeiZhi = this.mGoodsList.get_Item(i); if (caiJiPeiZhi.scene == MySceneManager.Instance.CurSceneID && caiJiPeiZhi.model > 0 && base.Task.status == Package.Task.TaskStatus.TaskReceived) { if (MainTaskManager.Instance.GoodsModels.ContainsKey(caiJiPeiZhi.id)) { MainTaskManager.Instance.GoodsModels[caiJiPeiZhi.id] = 0; } else { MainTaskManager.Instance.GoodsModels.Add(caiJiPeiZhi.id, 0); } flag = true; } } } if (flag) { EventDispatcher.Broadcast(EventNames.RefreshCollect); } this.mCurGoods = this.GetGoodsData(); }
protected void SetCollectingState() { CaiJiPeiZhi caiJiPeiZhi = DataReader <CaiJiPeiZhi> .Get(this.collectionDataID); if (caiJiPeiZhi == null) { return; } if (caiJiPeiZhi.position2.get_Count() > 2) { string[] array = caiJiPeiZhi.specialEffects.Split(new char[] { ';' }); if (array.Length > 1) { int templateId = int.Parse(array[0]); this.collectingFxID = FXManager.Instance.PlayFX(templateId, null, new Vector3((float)caiJiPeiZhi.position2.get_Item(0) * 0.01f, (float)caiJiPeiZhi.position2.get_Item(1) * 0.01f, (float)caiJiPeiZhi.position2.get_Item(2) * 0.01f), this.transform.get_rotation(), 1f, 1f, 0, false, 0, null, null, 1f, FXClassification.Normal); } } if (caiJiPeiZhi.LockLookPoint.get_Count() > 2 && EntityWorld.Instance.EntSelf != null && EntityWorld.Instance.EntSelf.Actor) { EntityWorld.Instance.EntSelf.Actor.TurnToPos(new Vector3((float)int.Parse(caiJiPeiZhi.LockLookPoint.get_Item(0)) * 0.01f, (float)int.Parse(caiJiPeiZhi.LockLookPoint.get_Item(1)) * 0.01f, (float)int.Parse(caiJiPeiZhi.LockLookPoint.get_Item(2)) * 0.01f)); } }
public override void Init(int theID, int modelID, Transform root) { this.id = theID; this.transform = root; CaiJiPeiZhi caiJiPeiZhi = DataReader <CaiJiPeiZhi> .Get(this.collectionDataID); if (caiJiPeiZhi == null) { return; } this.SetCollider(root, caiJiPeiZhi.touchRange, caiJiPeiZhi.triggeredRange); this.ApplyDefaultState(); this.SetModel(root, modelID); }
public override void OnAnimationEnd(AnimationEndCmd cmd) { base.OnAnimationEnd(cmd); CaiJiPeiZhi caiJiPeiZhi = DataReader <CaiJiPeiZhi> .Get(this.collectionDataID); if (caiJiPeiZhi == null) { return; } if (this.collectionState == CollectionNPCBehavior.CollectionNPCStateType.Collected && cmd.actName == caiJiPeiZhi.action2) { this.CollectedActionEnd(); } }
protected void InitCollect() { if (base.Data != null && base.Targets != null) { this.mGoodsList.Clear(); for (int i = 0; i < base.Targets.get_Count() - 1; i++) { CaiJiPeiZhi caiJiPeiZhi = DataReader <CaiJiPeiZhi> .Get(base.Targets.get_Item(i)); if (caiJiPeiZhi != null) { this.mGoodsList.Add(caiJiPeiZhi); } } } }
protected void PlayCollect(CaiJiPeiZhi goods, string ActionName) { if (goods == null) { return; } this.IsCollecting = true; EntityWorld.Instance.EntSelf.Actor.GetComponentInChildren <Animator>().Play(ActionName); if (MainTaskManager.Instance.GoodsModels.ContainsKey(goods.id)) { MainTaskManager.Instance.GoodsModels[goods.id] = 1; EventDispatcher.Broadcast(EventNames.StartCollecting); } TownCountdownUI townCountdownUI = UIManagerControl.Instance.OpenUI("TownCountdownUI", null, false, UIType.NonPush) as TownCountdownUI; townCountdownUI.StartCountdown((float)goods.time / 1000f, GameDataUtils.GetChineseContent(goods.tips, false), base.Task.taskId, new Action(this.OnFinishCollect), new Action <bool>(this.OnStopCollect)); }
protected void SetPositionAndRotation() { CaiJiPeiZhi caiJiPeiZhi = DataReader <CaiJiPeiZhi> .Get(this.collectionDataID); if (caiJiPeiZhi == null) { return; } if (caiJiPeiZhi.position.get_Count() >= 3) { this.transform.set_position(PosDirUtility.ToTerrainPoint(caiJiPeiZhi.position)); } if (caiJiPeiZhi.face.get_Count() >= 3) { this.transform.set_eulerAngles(PosDirUtility.ToEulerAnglesFromErrorFormatData(caiJiPeiZhi.face)); } }
private void OnFinishTaskNty(BaseTask cell) { if (cell != null) { if (cell is CollectTask) { CaiJiPeiZhi curGoods = (cell as CollectTask).CurGoods; if (curGoods != null && curGoods.model == 1240) { return; } } DisplayItemManager.Instance.AddItemBubble(); if (cell.Data.finishEffect != 1) { this.PlayCommitEffect(); } } }
protected void SetModel(Transform root, int modelID) { base.GetAsyncModel(root, modelID, delegate { CaiJiPeiZhi caiJiPeiZhi = DataReader <CaiJiPeiZhi> .Get(this.collectionDataID); AvatarModel avatarModel = DataReader <AvatarModel> .Get(modelID); this.animator = root.GetComponentInChildren <Animator>(); if (this.animator) { AssetManager.AssetOfControllerManager.SetController(this.animator, modelID, false); this.ChangeAnimationSpeed(); } this.SetCharacterController(root); BillboardManager.Instance.AddBillboardsInfo(31, root, (float)avatarModel.height_HP, (long)this.id, false, true, true); if (caiJiPeiZhi.name != 0) { HeadInfoManager.Instance.SetName(31, (long)this.id, GameDataUtils.GetChineseContent(caiJiPeiZhi.name, false)); } ShadowController.ShowShadow((long)this.id, root, false, modelID); }); }
protected override void SetData(Package.Task task) { base.SetData(task); if (base.Data != null) { this.mGoodsList.Clear(); if (base.Targets != null && base.Targets.get_Count() > 0) { for (int i = 0; i < base.Targets.get_Count(); i++) { CaiJiPeiZhi caiJiPeiZhi = DataReader <CaiJiPeiZhi> .Get(base.Targets.get_Item(i)); if (caiJiPeiZhi != null) { this.mGoodsList.Add(caiJiPeiZhi); } } } else { Debug.LogError(string.Format("驯服任务[{0}]配置参数[{1}]有误!", base.Data.id, base.Data.target)); } } }