Beispiel #1
0
    public void Destroy()
    {
        if (mIsBossChip && CanPick)
        {
            OnTouchExit();
        }

        mDropInfo        = null;
        mDropType        = EDropType.None;
        mCanPick         = false;
        CanNotPickReason = 0;
        mPickSqrRadius   = 0f;
        mIsTouching      = false;

        if (mTimer != null)
        {
            mTimer.Destroy();
            mTimer = null;
        }

        if (mDisappearTimer != null)
        {
            mDisappearTimer.Destroy();
            mDisappearTimer = null;
        }

        ClearCD();

        InstanceDropManager.GetInstance().RemoveDrop(this);

        if (mDropIconRes != null)
        {
            mDropIconRes.destroy();
            mDropIconRes = null;
        }

        if (mAutoPickCoroutine != null)
        {
            mAutoPickCoroutine.Stop();
            mAutoPickCoroutine = null;
        }

        mDropGoodsSubType = 0;
        mIsBossChip       = false;
        if (mBossChipEffectGameObject != null)
        {
            GameObject.DestroyImmediate(mBossChipEffectGameObject);
            mBossChipEffectGameObject = null;
        }

        mCurLoadEffectID = 0;
        mCurLoadIconID   = 0;

        m_IsDestory = true;
    }
Beispiel #2
0
    public void Init()
    {
        m_IsDestory = false;

        mPosition   = this.transform.parent.position;
        mPosition.y = 0f;

        if (mDropInfo != null)
        {
            if (DBInstanceTypeControl.Instance.AutoPickDrop(InstanceManager.Instance.InstanceType, InstanceManager.Instance.InstanceSubType) == true)
            {
                if ((mDropInfo.type == GameConst.GIVE_TYPE_GOODS || mDropInfo.type == GameConst.GIVE_TYPE_EQUIP) && ItemManager.Instance.BagIsFull(1) == true)
                {
                }
                else
                {
                    mAutoPickCoroutine = SafeCoroutine.CoroutineManager.StartCoroutine(AutoPickCoroutine());
                }
            }
        }

        InstanceDropManager.GetInstance().AddDrop(this);
    }
Beispiel #3
0
    /// <summary>
    /// 拾取
    /// </summary>
    public void Pick()
    {
        if (m_IsDestory == true)
        {
            return;
        }

        if (mAutoPickCoroutine != null)
        {
            mAutoPickCoroutine.Stop();
            mAutoPickCoroutine = null;
        }

        if (mCDTimer != null)
        {
            return;
        }

        if (mIsBossChip == false)
        {
            if ((mDropInfo.type == GameConst.GIVE_TYPE_GOODS || mDropInfo.type == GameConst.GIVE_TYPE_EQUIP) && ItemManager.Instance.BagIsFull(1) == true)
            {
                //UINotice.Instance.ShowMessage(DBConstText.GetText("BAG_IS_FULL"));
                ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_SHOW_PICK_DROP_FLOAT_TIPS, new CEventBaseArgs(DBConstText.GetText("BAG_IS_FULL")));

                StartCD();
                return;
            }
        }

        if (mCanPick == false)
        {
            if (mIsBossChip == false)
            {
                if (CanNotPickReason == 2)
                {
                    ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_SHOW_PICK_DROP_FLOAT_TIPS, new CEventBaseArgs(DBConstText.GetText("DROP_REACH_LIMIT")));
                }
                else
                {
                    ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_SHOW_PICK_DROP_FLOAT_TIPS, new CEventBaseArgs(DBConstText.GetText("DROP_NOT_BELONG_TO_YOU")));
                }

                StartCD();
            }
            return;
        }

        if (gameObject == null)
        {
            return;
        }
        if (enabled == false)
        {
            return;
        }
        Transform trans = transform;

        if (trans == null)
        {
            return;
        }

        Transform parentTrans = trans.parent;

        if (parentTrans == null)
        {
            return;
        }

        if (mDropType == 0)
        {
            return;
        }

        if (mIsBossChip)
        {//BOSS碎片不能主动拾取
            //显示主界面
            Actor local_player = Game.Instance.GetLocalPlayer();
            if (local_player != null && (local_player.IsShapeShift ||
                                         local_player.HasBattleState(BattleStatusType.BATTLE_STATUS_TYPE_DIZZY))) //变身和眩晕状态,不显示拾取BOSS按钮
            {
                ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_PICK_DROP_DISAPPEAR_BOSS_CHIP, new CEventBaseArgs(this.mDropInfo));
                return;
            }

            ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_PICK_DROP_SHOW_BOSS_CHIP, new CEventObjectArgs(mDropInfo, (uint)mDropType, parentTrans.gameObject));
            return;
        }

        ClientEventMgr.GetInstance().FireEvent((int)ClientEvent.CE_PICK_DROP, new CEventObjectArgs(mDropInfo, (uint)mDropType, parentTrans.gameObject));

        StartCD();
    }