Beispiel #1
0
 private void DestroyWorkerRewardNode()
 {
     if (m_WorkerRewardNode != null)
     {
         Destroy(m_WorkerRewardNode.gameObject);
         m_WorkerRewardNode = null;
     }
 }
Beispiel #2
0
        public void FreshWorkerDrop()
        {
            NpcRedHeartItemDTO workerWorkItemDTO = Global.gApp.gSystemMgr.GetNpcMgr().GetRedHeartByIndex(m_TaskItem.lockWorkerIndex);

            if (workerWorkItemDTO != null && workerWorkItemDTO.dropDiamondNum > 0)
            {
                PlayIdle();
                if (m_WorkerRewardNode == null)
                {
                    GameObject go = Global.gApp.gResMgr.InstantiateObj(Wndid.WorkerRewardNode);
                    m_WorkerRewardNode = go.GetComponent <WorkerRewardNode>();
                    m_WorkerRewardNode.Init(this, GetTaskUINode(), workerWorkItemDTO.dropDiamondNum);
                }
            }
            else
            {
                DestroyWorkerRewardNode();
            }
        }