Esempio n. 1
0
    public void Load(byte[] bytes)
    {
        BinaryHelper helper = new BinaryHelper(bytes);
        int          length = helper.ReadInt();

        VocationInfoList = new List <VocationInfo>(length);
        for (int index = 0; index < length; ++index)
        {
            VocationInfo info = new VocationInfo();
            info.Load(helper);
            VocationInfoList.Add(info);
        }
    }
Esempio n. 2
0
    /// <summary>
    /// 随机播放一个音效
    /// </summary>
    /// <param name="index"></param>
    private void PlayRandomActorAudio(int index)
    {
        // 东南亚版非简体中文不播放语音
        if (Const.Region == RegionType.SEASIA && Const.Language != LanguageType.SIMPLE_CHINESE)
        {
            return;
        }

        //AudioManager.Instance.StopAuidoClip();
        AudioManager.Instance.StopBattleSFX(lastAudioID);
        VocationInfo vocationInfo = DBVocationInfo.Instance.GetVocationInfo((uint)index + 1);

        if (vocationInfo != null && vocationInfo.audios.Count > 0)
        {
            var audios     = vocationInfo.audios;
            var audioIndex = audioRandom.Next(0, audios.Count);
            lastAudioID = AudioManager.Instance.PlayBattleSFX(GlobalConst.ResPath + $"Sound/Skill/{audios[audioIndex]}.ogg", SoundType.NPC);
        }
    }
Esempio n. 3
0
    /// <summary>
    /// BOSS碎片特效加载完毕后的回调(手上特效)
    /// </summary>
    /// <param name="effect_object"></param>
    /// <param name="parent_trans"></param>
    /// <param name="bind_node"></param>
    void OnBossChipEffectResLoad_hand(GameObject effect_object, Vector3 start_position, Vector3 end_position)
    {
        if (effect_object != null)
        {
            if (mShowPickUpBossChip == false || IsDestroy)
            {
                GameObject.DestroyObject(effect_object);
                return;
            }
            VocationInfo vocation_info = DBVocationInfo.Instance.GetVocationInfo((uint)this.VocationID);
            string       slot_name     = AvatarCtrl.BOSS_CHIP_HAND_NAME;
            if (vocation_info != null && string.IsNullOrEmpty(vocation_info.boss_chip_slot_name) == false)
            {
                slot_name = vocation_info.boss_chip_slot_name;
            }
            Transform hand_root_transform = xc.ui.ugui.UIHelper.FindChildInHierarchy(transform, slot_name);
            if (hand_root_transform != null)
            {
                effect_object.transform.parent           = hand_root_transform;
                effect_object.transform.localPosition    = Vector3.zero;
                effect_object.transform.localEulerAngles = Vector3.zero;
                effect_object.transform.localScale       = Vector3.one;
            }
            mPickUpBossChipObj_hand = effect_object;
            effect_object.SetActive(true);

            var delay_destroy = effect_object.GetComponent <DelayDestroyComponent>();
            if (delay_destroy == null)
            {
                delay_destroy = effect_object.AddComponent <DelayDestroyComponent>();
            }

            delay_destroy.DelayTime = 10.0f;
            delay_destroy.Start();

            xc.ui.ugui.UIHelper.SetLayer(effect_object.transform, LayerMask.NameToLayer("Player"));
        }
    }
Esempio n. 4
0
    /// <summary>
    /// 技能装配信息发生改变
    /// </summary>
    void OnSkillUpdate(xc.ClientEventBaseArgs data)
    {
        if (mCacheTrans == null)
        {
            return;
        }

        uint skillId = SkillManager.GetInstance().GetFitSkillId(mFitPos);

        mSkillIdx       = skillId;
        mBasicSkillInfo = DBManager.Instance.GetDB <DBDataAllSkill>().GetOneAllSkillInfo_byActiveSkillId(skillId);
        mSkillInfo      = DBSkillSev.Instance.GetSkillInfo(skillId);
        DBSkillSev skill_db = DBManager.GetInstance().GetDB <DBSkillSev>();

        mHasCastingReadyStage = skill_db.HasCastingReadyStage(skillId);

        // 设置技能图标
        if (SkillHoleManager.Instance.IsHoleOpen(mFitPos) == false || SkillHoleManager.Instance.IsHoleWillOpen(mFitPos))
        {
            mSkillImage.color = Color.clear;
        }
        else
        {
            if (skillId != 0)// 设置技能图标
            {
                if (mBasicSkillInfo != null)
                {
                    if (mSpriteList != null)
                    {
                        string icon_str = mBasicSkillInfo.Icon;
                        if (mFitPos == (uint)DBCommandList.OPFlag.OP_A) //普攻
                        {
                            var localPlayer = Game.Instance.GetLocalPlayer();
                            if (localPlayer != null && localPlayer.IsShapeShift)// 变身状态下的图标需要特殊处理
                            {
                                icon_str = mBasicSkillInfo.Icon;

                                if (string.IsNullOrEmpty(icon_str))
                                {
                                    VocationInfo info = DBVocationInfo.Instance.GetVocationInfo(Game.Instance.LocalPlayerVocation);
                                    if (info != null && string.IsNullOrEmpty(info.common_skill_icon_main) == false)
                                    {
                                        icon_str = info.common_skill_icon_main;
                                    }
                                }
                            }
                            else
                            {
                                VocationInfo info = DBVocationInfo.Instance.GetVocationInfo(Game.Instance.LocalPlayerVocation);
                                if (info != null && string.IsNullOrEmpty(info.common_skill_icon_main) == false)
                                {
                                    icon_str = info.common_skill_icon_main;
                                }
                            }
                        }

                        Sprite sprite = mSpriteList.LoadSprite(icon_str);
                        if (sprite != null)
                        {
                            mSkillImage.color  = Color.white;
                            mSkillImage.sprite = sprite;
                        }
                        else
                        {
                            mSkillImage.color = Color.clear;
                        }
                    }
                    else
                    {
                        mSkillImage.color = Color.clear;
                    }
                }
                else
                {
                    mSkillImage.color = Color.clear;
                }
            }
            else// 技能未装配,不显示技能对应图片
            {
                mSkillImage.color = Color.clear;
            }
        }
    }