少年修仙传客户端代码仓库
client_Wu Xijin
2018-09-18 4e7dd603c96d5aedc1a0ca4c4c869c0c49b2af4e
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
2个文件已修改
2个文件已添加
156 ■■■■■ 已修改文件
System/MainInterfacePanel/FeatureNoticeTip.cs 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/FeatureNoticeTip.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/FeatureNoticeWin.cs 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/FunctionForecastTip.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/FeatureNoticeTip.cs
New file
@@ -0,0 +1,76 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Tuesday, September 18, 2018
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using TableConfig;
using System;
using System.Collections.Generic;
using DG.Tweening;
namespace Snxxz.UI {
    public class FeatureNoticeTip:MonoBehaviour {
        private int OpenTag = 0;
        [SerializeField] Image _FunctionIcon;//图标Icon
        [SerializeField] Text _NameText;//标题名
        [SerializeField] Text _Information;//信息内容
        [SerializeField] GameObject m_FeatureNoticeTipObj;
        public GameObject FeatureNoticeTipObj
        {
            get { return m_FeatureNoticeTipObj; }
            set { m_FeatureNoticeTipObj = value; }
        }
        public void Init()//初始化
        {
            DataAssignment();
        }
        void DataAssignment()
        {
            var configs = Config.Instance.GetAllValues<FunctionForecastConfig>();
            foreach (var config in configs)
            {
                if (!FuncOpen.Instance.IsFuncOpen(config.FuncId)
                    && PlayerDatas.Instance.baseData.LV >= config.OpenLevel && config.Display == 1)
                {
                    OpenTag = config.FuncId;
                    OpenPanel(OpenTag);
                    return;
                }
            }
            return;
        }
        void OpenPanel(int ID)
        {
            _FunctionIcon.SetSprite(Config.Instance.Get<FunctionForecastConfig>(ID).FuncIconKey);
            _NameText.text = Config.Instance.Get<FunctionForecastConfig>(ID).Describe;
            FuncOpenLVConfig funcoPenConfig = Config.Instance.Get<FuncOpenLVConfig>(ID);
            if (funcoPenConfig.LimitMagicWeapon != 0 || funcoPenConfig.LimitMissionID != 0)
            {
                if (funcoPenConfig.LimitMagicWeapon != 0)
                {
                    int faBaoID = funcoPenConfig.LimitMagicWeapon / 100;
                    TreasureConfig treasure = Config.Instance.Get<TreasureConfig>(faBaoID);
                    _Information.text = string.Format(Language.Get("FuncFBOpen"), treasure.Name);
                    return;
                }
                if (funcoPenConfig.LimitMissionID != 0)
                {
                    _Information.text = string.Format(Language.Get("TaskFuncOpen"), funcoPenConfig.LimitLV);
                    return;
                }
            }
            else
            {
                _Information.text = string.Format(Language.Get("FuncLevelOpen"), funcoPenConfig.LimitLV);
            }
        }
    }
}
System/MainInterfacePanel/FeatureNoticeTip.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: af6be847766546d448a74ba71b36526f
timeCreated: 1537257744
licenseType: Free
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/MainInterfacePanel/FeatureNoticeWin.cs
@@ -41,9 +41,13 @@
        [SerializeField] RawImage m_RawImage3;
        [SerializeField] RawImage m_RawImage4;
        [SerializeField] Text m_keyName;
        [SerializeField] FeatureNoticeTip m_FeatureNoticeTip;
        [SerializeField] ScaleTween m_ScaleTween;
        [SerializeField] Transform m_Tran;
        public int Offset = 0;//偏移
        TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
        FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } }
        FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } }
        private bool IsJump = false;
        #region Built-in
        private int ClickFuncID = 0;
        protected override void BindController()
@@ -52,16 +56,19 @@
        protected override void AddListeners()
        {
            m_CloseButton.AddListener(() => { Close(); });
            m_CloseButton.AddListener(OnClickBtn);
            m_ScrollerController.OnRefreshCell += OnRefreshGridCell;
        }
        protected override void OnPreOpen()
        {
            if (!WindowJumpMgr.Instance.IsJumpState)//是否经历跳转打开
            m_ScaleTween.SetStartState();
            IsJump = WindowJumpMgr.Instance.IsJumpState;
            if (!IsJump)//是否经历跳转打开
            {
                DefaultSelection();//获取默认选择
            }
            m_ScrollerController.OnRefreshCell += OnRefreshGridCell;
            m_FeatureNoticeTip.Init();
            OnCreateGridLineCell(m_ScrollerController);
            ContentDisplay();
          
@@ -77,7 +84,15 @@
            FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
            PlayerDatas.Instance.PlayerDataRefreshInfoEvent += OnPlayersUpLV;
            treasureModel.treasureStateChangeEvent += treasureStateChangeEvent;
            treasureModel.treasureStageUpEvent += treasureStageUpEvent;
            treasureModel.treasureStageUpEvent += treasureStageUpEvent;
            if (!IsJump)//是否经历跳转打开
            {
                m_ScaleTween.Play(false, IsOpen);
            }
            else
            {
                m_ScaleTween.SetEndState();
            }
        }
        protected override void OnPreClose()
        {
@@ -90,7 +105,6 @@
        {
            PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= OnPlayersUpLV;
            FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
            m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
            treasureModel.treasureStateChangeEvent -= treasureStateChangeEvent;
            treasureModel.treasureStageUpEvent -= treasureStageUpEvent;
            if (featureNoticeModel.redPointStre1.state == RedPointState.Simple)
@@ -433,6 +447,27 @@
                m_Textschedule.text = string.Format(Language.Get("YGNoFB"), _treasure.Name);
            }
        }
        private void OnClickBtn()
        {
            if (!WindowJumpMgr.Instance.IsJumpState)//是否经历跳
            {
                m_FeatureNoticeTip.FeatureNoticeTipObj.SetActive(true);
                m_ScaleTween.Play(true, IsClose);
            }
            else
            {
                Close();
            }
        }
        private void IsOpen()
        {
            m_FeatureNoticeTip.FeatureNoticeTipObj.SetActive(false);
        }
        private void IsClose()
        {
            Close();
        }
    }
}
System/MainInterfacePanel/FunctionForecastTip.cs
@@ -10,10 +10,12 @@
using System.Collections.Generic;
using DG.Tweening;
//主界面功能预告
namespace Snxxz.UI {
namespace Snxxz.UI
{
    public class FunctionForecastTip : MonoBehaviour {
        public static  int OpenTag = 0;
    public class FunctionForecastTip : MonoBehaviour
    {
        public static int OpenTag = 0;
        [SerializeField] Transform _FunctionForecastPanel;//切换面板 
        [SerializeField] Image _FunctionIcon;//图标Icon
        [SerializeField] Button _FunctionIconBtn;//面板开关按钮
@@ -34,7 +36,7 @@
            FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
            PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= OnPlayersUpLV;
        }
        private void Start()
        {
@@ -52,7 +54,7 @@
        private void OnPlayersUpLV(PlayerDataRefresh _type)
        {
            if (_type==PlayerDataRefresh.LV)
            if (_type == PlayerDataRefresh.LV)
            {
                DataAssignment();
            }
@@ -69,7 +71,7 @@
            foreach (var config in configs)
            {
                if (!FuncOpen.Instance.IsFuncOpen(config.FuncId)
                    && PlayerDatas.Instance.baseData.LV >= config.OpenLevel && config.Display==1)
                    && PlayerDatas.Instance.baseData.LV >= config.OpenLevel && config.Display == 1)
                {
                    OpenTag = config.FuncId;
                    if (FunctionOpenTagEvent != null)
@@ -90,7 +92,7 @@
            _FunctionIcon.SetSprite(Config.Instance.Get<FunctionForecastConfig>(ID).FuncIconKey);
            _NameText.text = Config.Instance.Get<FunctionForecastConfig>(ID).Describe;
            FuncOpenLVConfig funcoPenConfig = Config.Instance.Get<FuncOpenLVConfig>(ID);
            if (funcoPenConfig.LimitMagicWeapon != 0 || funcoPenConfig.LimitMissionID!=0)
            if (funcoPenConfig.LimitMagicWeapon != 0 || funcoPenConfig.LimitMissionID != 0)
            {
                if (funcoPenConfig.LimitMagicWeapon != 0)
                {
@@ -109,14 +111,15 @@
            {
                _Information.text = string.Format(Language.Get("FuncLevelOpen"), funcoPenConfig.LimitLV);
            }
        }
        void FunctionIconBtn()//面板开启
        {
            WindowCenter.Instance.Close<MainInterfaceWin>();
            WindowCenter.Instance.Open<FeatureNoticeWin>();
           // WindowCenter.Instance.Open<ZXWTestWin>();
        }
    }