/// <summary>
    /// 同步玩家进入宝藏区域
    /// </summary>
    /// <param name="buf"></param>
    private void OnSyncDiscoverPrecious(KProtoBuf buf)
    {
        S2C_SYNC_PLAYER_DISCOVER_PRECIOUS msg = buf as S2C_SYNC_PLAYER_DISCOVER_PRECIOUS;
        TreasureHuntProxy treasureHuntProxy   = GameFacade.Instance.RetrieveProxy(ProxyName.TreasureHuntProxy) as TreasureHuntProxy;

        treasureHuntProxy.SyncDiscoverPrecious(msg);
    }
Exemple #2
0
    public void SyncDiscoverPrecious(S2C_SYNC_PLAYER_DISCOVER_PRECIOUS msg)
    {
        int type = msg.discover_type;

        /// 发现信号 0是飞出
        if (type == (int)PlayerDiscoverPreciousType.DiscoverSignal)
        {
            if (msg.is_in != 0)
            {
                SpacecraftEntity main = m_GameplayProxy.GetEntityById <SpacecraftEntity>(m_GameplayProxy.GetMainPlayerUID());
                m_Effect = EffectManager.GetInstance().CreateEffect(m_CfgEternityProxy.GetGamingConfig(1).Value.Treasure.Value.Effect.Value.DiscoverCameraEffect, EffectManager.GetEffectGroupNameInSpace(true));
                m_Effect.transform.SetParent(main.GetSkinRootTransform(), false);
                m_Effect.SetCreateForMainPlayer(true);

                WwiseUtil.PlaySound((int)WwiseMusic.InTreasure_FX_Sound, false, null);
                WwiseUtil.PlaySound(WwiseManager.voiceComboID, WwiseMusicSpecialType.SpecialType_Voice_treasure_event1, WwiseMusicPalce.Palce_1st, false, null);
                MsgDetectorShow msgDetectorShow = new MsgDetectorShow();
                msgDetectorShow.Show = true;
                GameplayProxy gameplayProxy = Facade.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
                Vector3       pos           = gameplayProxy.ServerAreaOffsetToClientPosition(new Vector3(0, (float)msg.fY, 0));
                msgDetectorShow.Height    = pos.y;              //todo 宝藏的高度
                msgDetectorShow.MaxHeight = (float)msg.fR * 2f; //触发范围最大高度
                Facade.SendNotification(NotificationName.MSG_DETECTOR_SHOW, msgDetectorShow);
                Facade.SendNotification(NotificationName.MSG_INTERACTIVE_SHOWTIP, HudNpcInteractiveFlagPanel.InteractiveTipType.Precious);
            }
            else
            {
                MsgDetectorShow msgDetectorShow = new MsgDetectorShow();
                msgDetectorShow.Show = false;
                Facade.SendNotification(NotificationName.MSG_DETECTOR_SHOW, msgDetectorShow);
                Facade.SendNotification(NotificationName.MSG_INTERACTIVE_HIDETIP, HudNpcInteractiveFlagPanel.InteractiveTipType.Precious);
            }
        }
        /// 发现宝藏 0是飞出
        else if (msg.is_in != 0 && type == (int)PlayerDiscoverPreciousType.DiscoverPrecious)
        {
            MsgDetectorShow msgDetectorShow = new MsgDetectorShow();
            msgDetectorShow.Show = false;
            // WwiseUtil.PlaySound(WwiseManager.voiceComboID, WwiseMusicSpecialType.SpecialType_Voice_treasure_event2, WwiseMusicPalce.Palce_1st, false, null);
        }
    }