Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Monday, March 11, 2019 |
| | | // [ Date ]: Thursday, March 14, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | public readonly string Img;
|
| | | public readonly int Quality;
|
| | | public readonly int FightPower;
|
| | | public readonly int specialProperty;
|
| | | public readonly string equipNameIcon;
|
| | | public readonly int effectId;
|
| | | public readonly int requireIconEffect; |
| | | |
| | |
| | |
|
| | | int.TryParse(tables[10],out FightPower);
|
| | |
|
| | | int.TryParse(tables[11],out specialProperty); |
| | | equipNameIcon = tables[11];
|
| | |
|
| | | int.TryParse(tables[12],out effectId);
|
| | |
|
| | |
| | | fileFormatVersion: 2 |
| | | guid: d49ca04ff4a91bc4fb645c417f9ef0b3 |
| | | timeCreated: 1552295065 |
| | | timeCreated: 1552531605 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "Img", _g_get_Img); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "Quality", _g_get_Quality); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "FightPower", _g_get_FightPower); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "specialProperty", _g_get_specialProperty); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "effectId", _g_get_effectId); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "requireIconEffect", _g_get_requireIconEffect); |
| | | |
| | |
| | | |
| | | RealmConfig gen_to_be_invoked = (RealmConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.FightPower); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_specialProperty(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | RealmConfig gen_to_be_invoked = (RealmConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.specialProperty); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | |
| | | public class RealmAnimationBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] float m_Radius = 100f;
|
| | | [SerializeField] float m_Duration = 1f;
|
| | | [SerializeField] TweenCurve m_TweenCurve;
|
| | | [SerializeField] Transform m_ContainerLine;
|
| | | [SerializeField] RealmStageBehaviour[] m_RealmStages;
|
| | |
|
| | | Coroutine m_RotateCoroutine = null;
|
| | |
| | |
|
| | | public void SetDefault()
|
| | | {
|
| | | m_ContainerLine.gameObject.SetActive(false);
|
| | | for (int i = 0; i < m_RealmStages.Length; i++)
|
| | | {
|
| | | m_RealmStages[i].transform.localPosition = GetPointPosition(i);
|
| | |
| | | return new Vector3(_x, _y, _z);
|
| | | }
|
| | |
|
| | | public void DisplayLevelUp(int level)
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | void StartRotate()
|
| | | {
|
| | | if (m_RotateCoroutine != null)
|
| | |
| | |
|
| | | IEnumerator Co_Rotate()
|
| | | {
|
| | | var angle = 0f;
|
| | | while (angle < 180f)
|
| | | var timer = 0f;
|
| | | m_ContainerLine.gameObject.SetActive(true);
|
| | | while (timer < m_Duration)
|
| | | {
|
| | | timer += Time.deltaTime;
|
| | | yield return null;
|
| | | angle += 1f;
|
| | | angle = Mathf.Min(180, angle);
|
| | | var t = Mathf.Clamp01(timer / m_Duration);
|
| | | var value = m_TweenCurve.Evaluate(t);
|
| | | var angle = Mathf.LerpUnclamped(0, 180, value);
|
| | | for (int i = 0; i < m_RealmStages.Length; i++)
|
| | | {
|
| | | var cacheAngle = GetPointAngle(i);
|
| | | var cacheAngle = GetPointAngle(m_RealmStages[i].animIndex);
|
| | | var position = GetPointPosition(cacheAngle - angle);
|
| | | m_RealmStages[i].transform.localPosition = position;
|
| | | }
|
| | | }
|
| | | m_ContainerLine.gameObject.SetActive(false);
|
| | | foreach (var realmStage in m_RealmStages)
|
| | | {
|
| | | realmStage.animIndex = (realmStage.animIndex + 4) % 8;
|
| | |
| | | [SerializeField] Transform m_PropertyRoot;
|
| | | [SerializeField] List<PropertyBehaviour> m_Properties;
|
| | | [SerializeField] Transform m_ContainerUnlockEquip;
|
| | | [SerializeField] Text m_UnlockEquip;
|
| | | [SerializeField] Image m_UnlockEquip;
|
| | | [SerializeField] Button m_Preview;
|
| | |
|
| | | int realmLevel = 0;
|
| | |
| | | if (model.IsUnlockEquipRealm(realmLevel, out level))
|
| | | {
|
| | | m_ContainerUnlockEquip.gameObject.SetActive(true);
|
| | | var config = RealmConfig.Get(realmLevel);
|
| | | m_UnlockEquip.SetSprite(config.equipNameIcon);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | m_RealmProperties.Add(config.Lv, dict);
|
| | | }
|
| | |
|
| | | if (stages.Contains(config.Lv))
|
| | | {
|
| | | stages = new List<int>();
|
| | | m_RealmStages.Add(stages);
|
| | | continue;
|
| | | }
|
| | |
|
| | | stages.Add(config.Lv);
|
| | |
|
| | | if (config.BossID != 0)
|
| | | {
|
| | | stages = new List<int>();
|
| | | m_RealmStages.Add(stages);
|
| | | var nextConfig = RealmConfig.Get(config.Lv + 1);
|
| | | if (nextConfig != null)
|
| | | {
|
| | | stages.Add(config.Lv + 1);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | RealmModel model { get { return ModelCenter.Instance.GetModel<RealmModel>(); } }
|
| | |
|
| | | private void Awake()
|
| | | {
|
| | | m_Select.AddListener(OnSelect);
|
| | | }
|
| | |
|
| | | public void Display(int _realmLv)
|
| | | {
|
| | | this.realmLevel = _realmLv;
|
| | |
| | | {
|
| | | DisplaySelect();
|
| | | }
|
| | |
|
| | | private void OnSelect()
|
| | | {
|
| | | model.selectRealm = realmLevel;
|
| | | }
|
| | | } |
| | | } |
| | |
| | | protected override void OnPreOpen()
|
| | | {
|
| | | PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefreshEvent;
|
| | | model.selectRealmRefresh += SelectRealmRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | Display();
|
| | | }
|
| | |
|
| | |
| | | protected override void OnPreClose()
|
| | | {
|
| | | PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefreshEvent;
|
| | | model.selectRealmRefresh -= SelectRealmRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | |
|
| | | void Display()
|
| | | {
|
| | | var realmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | if (realmLevel < model.realmMaxLevel)
|
| | | {
|
| | | model.selectRealm = realmLevel + 1;
|
| | | }
|
| | | else
|
| | | {
|
| | | model.selectRealm = realmLevel;
|
| | | }
|
| | |
|
| | | DisplayRealmLevelUp();
|
| | | DisplayRealmStages();
|
| | | DisplayRealmBrief();
|
| | | }
|
| | |
|
| | | void DisplayRealmStages()
|
| | | {
|
| | | var realmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | var stage = model.GetRealmStage(realmLevel < model.realmMaxLevel ? (realmLevel + 1) : realmLevel);
|
| | | var stage = model.GetRealmStage(model.selectRealm);
|
| | | m_RealmAnimation.SetDefault();
|
| | | List<int> realms = null;
|
| | | if (model.TryGetRealmStages(stage, out realms))
|
| | |
| | | void DisplayRealmLevelUp()
|
| | | {
|
| | | var realmLevel = PlayerDatas.Instance.baseData.realmLevel;
|
| | | var isMax = realmLevel >= model.realmMaxLevel;
|
| | | m_RealmLevelUp.gameObject.SetActive(!isMax);
|
| | | if (!isMax)
|
| | | var requireLevelUp = model.selectRealm < model.realmMaxLevel && model.selectRealm > realmLevel;
|
| | | m_RealmLevelUp.gameObject.SetActive(requireLevelUp);
|
| | | if (requireLevelUp)
|
| | | {
|
| | | m_RealmLevelUp.Display(realmLevel + 1);
|
| | | m_RealmLevelUp.Display(model.selectRealm);
|
| | | }
|
| | |
|
| | | var config = RealmConfig.Get(realmLevel);
|
| | | m_GotoBoss.gameObject.SetActive(config.BossID != 0);
|
| | | var config = RealmConfig.Get(model.selectRealm - 1);
|
| | | m_GotoBoss.gameObject.SetActive(requireLevelUp && config != null && config.BossID != 0);
|
| | | }
|
| | |
|
| | | void DisplayRealmBrief()
|
| | | {
|
| | | m_RealmBrief.Display(model.selectRealm);
|
| | | }
|
| | |
|
| | | private void PlayerDataRefreshEvent(PlayerDataType dataType)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void SelectRealmRefresh()
|
| | | {
|
| | | DisplayRealmBrief();
|
| | | DisplayRealmLevelUp();
|
| | | }
|
| | |
|
| | | private void GotoBoss()
|
| | | {
|
| | | dungeonModel.SingleChallenge(RealmModel.REALM_DUNGEON_ID, 0);
|