void OnCombineObject(CombinationMap map, GameObject item01, GameObject itemDock, ObjectInGame dockManager) { dockManager.isBusy = true; FBPoolManager.instance.returnObjectToPool(item01); int itemFinal = map.ItemIdFinal; Item finalObj = GroupGameDatabase.instance.GetItemByID(itemFinal); this.itemDockPos = itemDock.transform.position; dockManager.finalObjectName = finalObj.prefabName; //display timer FBParticleManager.PlayEffect(FBParticleManager.EFFECT_COMBINE_OBJECT, 2, itemDockPos); FBSoundManager.Play(FBSoundManager.COMBINE_SOUND); GameObject timerDialog = PopupManager.ShowTimer("Group_Timer", map.Duration, itemDock); timerDialog.GetComponent <BasePopup>().eventCompleteTimer += dockManager.ObjectInGame_eventCompleteTimer; //fake collect display for another player PhotonView playerPhotonView = Player.instance.visualPlayer.GetPhotonView(); playerPhotonView.RPC("SendFakeCollectItem", PhotonTargets.AllViaServer, playerPhotonView.viewID, itemFinal, itemDock.gameObject.name); }
void OnTriggerEnterQuestObject(Collider other) { //update quest process data ObjectInGame obj = other.GetComponent <ObjectInGame>(); Transform pos = this.transform.findChildRecursively("wrong_marker"); if (obj && obj.isCombinableObject() && other.gameObject.GetPhotonView().viewID == 0) { SendTriggerQuestItem = true; other.gameObject.SetActive(false); Item otherData = other.gameObject.GetComponent <Item>(); QuestData q = listQuestData.Find(x => x.requireItemId == otherData.Id); if (q != null && !QuestManager.instance.isFinishQuest(q)) { FBPoolManager.instance.returnObjectToPool(other.gameObject); QuestManager.instance.UpdateQuestProcess(q, +1); FBParticleManager.PlayEffect(FBParticleManager.EFFECT_COMBINE_OBJECT, 2, pos ? pos.position : this.transform.position); FBSoundManager.Play(FBSoundManager.COMBINE_SOUND); Invoke("ResetSendTrigger", 2f); } else { if (pos) { PopupManager.ShowWrongSignal(pos.position); } else { PopupManager.ShowWrongSignal(this.transform.position); } } } else { FBPoolManager.instance.returnObjectToPool(other.gameObject); } }