示例#1
0
        //-------------------------------------------------------------------------
        public void setLockFishByFishObjId(int lock_fish_obj_id)
        {
            CRenderFish fish = mScene.getLevel().getFishByObjId(lock_fish_obj_id);

            if (fish != null)
            {
                if (!mRenderBufferMgr.hasBuffer("BufLock"))
                {
                    List <object> param_list = new List <object>();
                    param_list.Add(lock_fish_obj_id);
                    mRenderBufferMgr.addBuffer("BufLock", param_list);
                }
                else if (mRenderBufferMgr.hasBuffer("BufLock"))
                {
                    CRenderBufferLock buf_lock = (CRenderBufferLock)mRenderBufferMgr.getBuffer("BufLock");
                    if (buf_lock.getLockFishObjId() != lock_fish_obj_id)
                    {
                        buf_lock.resetLockedFishObjId(lock_fish_obj_id);
                    }
                }
            }
            else
            {
                if (mRenderBufferMgr.hasBuffer("BufLock"))
                {
                    mRenderBufferMgr.removeBuffer("BufLock");
                }
            }
        }
示例#2
0
        //-------------------------------------------------------------------------
        int _getLockedFishIdFromLockedBuffer()
        {
            CRenderBufferLock lock_buffer = getBufferMgr().getBuffer("BufLock") as CRenderBufferLock;

            if (lock_buffer == null)
            {
                return(-1);
            }
            else
            {
                return(lock_buffer.getLockFishObjId());
            }
        }