Ejemplo n.º 1
0
        private void onUpdates(float s)
        {
            this.times += s;
            bool flag = this.times >= 1f;

            if (flag)
            {
                this.i--;
                bool flag2 = this.i == 0;
                if (flag2)
                {
                    this.i = 0;
                    bool flag3 = this.isDes;
                    if (flag3)
                    {
                        return;
                    }
                    this.txtName.gameObject.SetActive(false);
                    TickMgr.instance.removeTick(this.showtime);
                    UnityEngine.Object.Destroy(base.gameObject);
                    this.isDes = true;
                    DropItemUIMgr.getInstance().removeDropItem(this);
                    this.showtime = null;
                }
                this.times = 0f;
            }
        }
Ejemplo n.º 2
0
        public void removeDropItm(uint dpid, bool isfake)
        {
            if (isfake)
            {
                if (dDropFakeItem.ContainsKey(dpid))
                {
                    dPickItem[dpid] = dDropFakeItem[dpid];

                    dDropFakeItem[dpid].dispose();
                    dDropFakeItem.Remove(dpid);
                }
            }
            else
            {
                if (dDropItem?.ContainsKey(dpid) ?? false)
                {
                    dPickItem[dpid] = dDropItem[dpid];

                    dDropItem[dpid].dispose();
                    DropItemUIMgr.getInstance().hideOne(dDropItem[dpid]);
                    dDropItem.Remove(dpid);
                    if (dDropItem_own.ContainsKey(dpid))
                    {
                        dDropItem_own.Remove(dpid);
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public void removeDropItm(uint dpid, bool isfake)
 {
     if (isfake)
     {
         bool flag = this.dDropFakeItem.ContainsKey(dpid);
         if (flag)
         {
             this.dDropFakeItem[dpid].dispose();
             this.dDropFakeItem.Remove(dpid);
         }
     }
     else
     {
         Dictionary <uint, DropItem> expr_42 = this.dDropItem;
         bool flag2 = expr_42 != null && expr_42.ContainsKey(dpid);
         if (flag2)
         {
             this.dDropItem[dpid].dispose();
             DropItemUIMgr.getInstance().hideOne(this.dDropItem[dpid]);
             this.dDropItem.Remove(dpid);
             bool flag3 = this.dDropItem_own.ContainsKey(dpid);
             if (flag3)
             {
                 this.dDropItem_own.Remove(dpid);
             }
         }
     }
 }
Ejemplo n.º 4
0
 public static DropItemUIMgr getInstance()
 {
     if (instance == null)
     {
         instance = new DropItemUIMgr();
     }
     return(instance);
 }
Ejemplo n.º 5
0
        public static DropItemUIMgr getInstance()
        {
            bool flag = DropItemUIMgr.instance == null;

            if (flag)
            {
                DropItemUIMgr.instance = new DropItemUIMgr();
            }
            return(DropItemUIMgr.instance);
        }
Ejemplo n.º 6
0
        public void clear()
        {
            bool flag = this.isDes;

            if (!flag)
            {
                this.txtName.gameObject.SetActive(false);
                TickMgr.instance.removeTick(this.showtime);
                this.showtime = null;
                UnityEngine.Object.Destroy(base.gameObject);
                this.isDes = true;
                DropItemUIMgr.getInstance().removeDropItem(this);
            }
        }
Ejemplo n.º 7
0
 public void clear()
 {
     //_dropObj = null;
     // GameObject.Destroy(this.gameObject);
     if (isDes)
     {
         return;
     }
     txtName.gameObject.SetActive(false);
     TickMgr.instance.removeTick(showtime);
     showtime = null;
     GameObject.Destroy(this.gameObject);
     isDes = true;
     DropItemUIMgr.getInstance().removeDropItem(this);
 }
Ejemplo n.º 8
0
 void onUpdates(float s)
 {
     times += s;
     if (times >= 1)
     {
         i--;
         if (i == 0)
         {
             i = 0;
             if (isDes)
             {
                 return;
             }
             txtName.gameObject.SetActive(false);
             TickMgr.instance.removeTick(showtime);
             GameObject.Destroy(this.gameObject);
             isDes = true;
             DropItemUIMgr.getInstance().removeDropItem(this);
             showtime = null;
         }
         times = 0;
     }
 }
Ejemplo n.º 9
0
        private int showDrop(Vector3 dropPos, int wrongcount, int idx, DropItemdta item, bool isfake = false)
        {
            if (lDropOffset.Count <= idx)
            {
                idx = 0;
            }
            Vector3 vec = dropPos + lDropOffset[idx];
            //  GameObject go = GameObject.Find("coin");
            Vector3 begin = vec;

            begin.y = -99;



            NavMeshHit hit;

            //if (NavMesh.Raycast(begin, vec, out hit, NavMesh.GetNavMeshLayerFromName("Default")))
            NavMesh.SamplePosition(vec, out hit, 100f, NavmeshUtils.allARE);
            Vector3 pos = hit.position;

            if (pos.x == vec.x && pos.z == vec.z)
            {
                vec.y = pos.y;
                DropItem itm = getDropItem(vec, Vector3.zero, item, isfake);

                DropItemUIMgr.getInstance().show(itm, itm.itemdta.getDropItemName());
                if (!isfake)
                {
                    dDropItem[item.dpid] = itm;
                    if (item.ownerId == PlayerModel.getInstance().cid || item.ownerId == 0 ||
                        (TeamProxy.getInstance().MyTeamData != null && item.ownerId == TeamProxy.getInstance().MyTeamData.teamId))
                    {
                        dDropItem_own[item.dpid] = itm;
                    }
                }
                else
                {
                    item.dpid = fakeItemIdx;
                    dDropFakeItem[item.dpid] = itm;
                    fakeItemIdx++;
                }

                return(idx + 1);
            }
            else if (wrongcount >= 3)
            {
                debug.Log(":" + item.dpid);
                DropItem itm = getDropItem(pos, Vector3.zero, item);
                DropItemUIMgr.getInstance().show(itm, itm.itemdta.getDropItemName());

                if (!isfake)
                {
                    dDropItem[item.dpid] = itm;
                    //if (item.ownerId == PlayerModel.getInstance().cid)
                    //{
                    //dDropItem_own[item.dpid] = itm;
                    if (item.ownerId == PlayerModel.getInstance().cid || item.ownerId == 0 ||
                        (TeamProxy.getInstance().MyTeamData != null && item.ownerId == TeamProxy.getInstance().MyTeamData.teamId))
                    {
                        dDropItem_own[item.dpid] = itm;
                    }
                    //}
                }
                else
                {
                    item.dpid = fakeItemIdx;
                    dDropFakeItem[item.dpid] = itm;
                    fakeItemIdx++;
                }
                return(idx + 1);
            }
            wrongcount++;
            return(showDrop(dropPos, wrongcount, idx + 1, item, isfake));
        }
Ejemplo n.º 10
0
        private int showDrop(Vector3 dropPos, int wrongcount, int idx, DropItemdta item, bool isfake = false)
        {
            bool flag = this.lDropOffset.Count <= idx;

            if (flag)
            {
                idx = 0;
            }
            Vector3 vector  = dropPos + this.lDropOffset[idx];
            Vector3 vector2 = vector;

            vector2.y = -99f;
            NavMeshHit navMeshHit;

            NavMesh.SamplePosition(vector, out navMeshHit, 100f, NavmeshUtils.allARE);
            Vector3 position = navMeshHit.position;
            bool    flag2    = position.x == vector.x && position.z == vector.z;
            int     result;

            if (flag2)
            {
                vector.y = position.y;
                DropItem dropItem = BaseRoomItem.getDropItem(vector, Vector3.zero, item, isfake);
                DropItemUIMgr.getInstance().show(dropItem, dropItem.itemdta.getDropItemName());
                bool flag3 = !isfake;
                if (flag3)
                {
                    this.dDropItem[item.dpid] = dropItem;
                    bool flag4 = item.ownerId == ModelBase <PlayerModel> .getInstance().cid || item.ownerId == 0u || (BaseProxy <TeamProxy> .getInstance().MyTeamData != null && item.ownerId == BaseProxy <TeamProxy> .getInstance().MyTeamData.teamId);

                    if (flag4)
                    {
                        this.dDropItem_own[item.dpid] = dropItem;
                    }
                }
                else
                {
                    item.dpid = this.fakeItemIdx;
                    this.dDropFakeItem[item.dpid] = dropItem;
                    this.fakeItemIdx += 1u;
                }
                result = idx + 1;
            }
            else
            {
                bool flag5 = wrongcount >= 3;
                if (flag5)
                {
                    debug.Log(":" + item.dpid);
                    DropItem dropItem2 = BaseRoomItem.getDropItem(position, Vector3.zero, item, false);
                    DropItemUIMgr.getInstance().show(dropItem2, dropItem2.itemdta.getDropItemName());
                    bool flag6 = !isfake;
                    if (flag6)
                    {
                        this.dDropItem[item.dpid] = dropItem2;
                        bool flag7 = item.ownerId == ModelBase <PlayerModel> .getInstance().cid || item.ownerId == 0u || (BaseProxy <TeamProxy> .getInstance().MyTeamData != null && item.ownerId == BaseProxy <TeamProxy> .getInstance().MyTeamData.teamId);

                        if (flag7)
                        {
                            this.dDropItem_own[item.dpid] = dropItem2;
                        }
                    }
                    else
                    {
                        item.dpid = this.fakeItemIdx;
                        this.dDropFakeItem[item.dpid] = dropItem2;
                        this.fakeItemIdx += 1u;
                    }
                    result = idx + 1;
                }
                else
                {
                    wrongcount++;
                    result = this.showDrop(dropPos, wrongcount, idx + 1, item, isfake);
                }
            }
            return(result);
        }