Esempio n. 1
0
    public void OnCatch(uint fishId, long reward, long leftCoin, FishType_Enum fishType = FishType_Enum.FishType_Init, byte getSkillId = 0, int specialId = 0)
    {
        UpdateInfoUI(leftCoin);
        Fishing_Fish fish = GameBase.FishMgr.GetFishById(fishId);

        if (fish != null)
        {
            fish.OnCatch(m_Cannon, IsLocal(), reward, fishType, getSkillId, specialId);
        }
    }
Esempio n. 2
0
    public void OnCatch(Fishing_Cannon cannon, bool bLocal, long reward, FishType_Enum fishType, byte getSkillId, int specialId)
    {
        if (m_CatchRole != null)
        {
            return;
        }

        m_CatchRole = cannon.BelongRole;
        m_Animator.SetTrigger("die");
        gameObject.layer = 0;//no collide
        m_SplineMove.Stop();
        m_CatchRole.GameBase.OnLockFishLost(new List <byte>(m_LockSitList));

        if (bLocal && fishType > FishType_Enum.FishType_Boss)
        {
            m_CatchRole.GameBase.StartLottery(fishType, specialId);
        }
        else
        {
            Canvas  cv  = m_CatchRole.GameBase.GameCanvas;
            Vector3 pos = GameFunction.WorldToLocalPointInRectangle(transform.position, Camera.main, cv, cv.worldCamera);
            if (fishType == FishType_Enum.FishType_Lottery)
            {
                getSkillId = RoomInfo.NoSit;
            }
            GameMain.SC(PopCoin(this, Fishing_Data.GetInstance().m_FishData[m_nTypeId],
                                bLocal, reward, pos, m_CatchRole.GetCoinPos(), getSkillId));
        }

        float deadTime = 3f;

        m_CatchRole.GameBase.m_AddItems.Add(gameObject);
        if (bLocal && m_DeadSound != null)
        {
            m_DeadSound.volume = AudioManager.Instance.SoundVolume;
            m_DeadSound.Play();
            deadTime = m_DeadSound.clip.length;
        }
        GameMain.WaitForCall(deadTime, () =>
        {
            m_CatchRole.GameBase.m_AddItems.Remove(gameObject);
            OnDeath(this);
        });
    }