Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: Fish |
| | | // [ Date ]: Thursday, February 14, 2019 |
| | | // [ Date ]: Thursday, April 11, 2019 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | |
| | | public readonly string selectIcon; |
| | | public readonly string unselectIcon; |
| | | public readonly int skillid; |
| | | public readonly string desc; |
| | | public readonly string description; |
| | | public readonly string jobName; |
| | | public readonly string jobSign; |
| | | |
| | | public CreateRoleConfig() |
| | | { |
| | |
| | | |
| | | int.TryParse(tables[3],out skillid); |
| | | |
| | | desc = tables[4]; |
| | | description = tables[4]; |
| | | |
| | | jobName = tables[5]; |
| | | |
| | | jobSign = tables[6]; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 0a16c879bf3b127479edd80ebc3b6b35 |
| | | timeCreated: 1550121231 |
| | | timeCreated: 1554980817 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_desc(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | CreateRoleConfig gen_to_be_invoked = (CreateRoleConfig)translator.FastGetCSObj(L, 1); |
| | | LuaAPI.lua_pushstring(L, gen_to_be_invoked.desc); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | |
| | | public class CreateRoleBehaviour : MonoBehaviour |
| | | { |
| | | [SerializeField] int m_Job; |
| | | [SerializeField] float m_Scale = 1; |
| | | [SerializeField] EnterPictureType m_EnterPictureType; |
| | | |
| | | [SerializeField] ShowAnimation m_EnterShowAnimation; |
| | |
| | | if (ok) |
| | | { |
| | | var model = @object as GameObject; |
| | | model.transform.SetParentEx(m_Platform.transform, Vector3.zero, Quaternion.identity, Vector3.one); |
| | | model.transform.SetParentEx(m_Platform.transform, Vector3.zero, Quaternion.identity, Vector3.one * m_Scale); |
| | | m_Shadow.Cast(model.transform); |
| | | model.SetActive(true); |
| | | |
| | |
| | | if (ok) |
| | | { |
| | | var model = @object as GameObject; |
| | | model.transform.SetParentEx(m_Platform.transform, Vector3.zero, Quaternion.identity, Vector3.one); |
| | | model.transform.SetParentEx(m_Platform.transform, Vector3.zero, Quaternion.identity, Vector3.one * m_Scale); |
| | | |
| | | switch (m_EnterPictureType) |
| | | { |
| | |
| | | {5,new LogicString () }, |
| | | }; |
| | | |
| | | public readonly LogicList<Star> stars = new LogicList<Star>(); |
| | | |
| | | public readonly LogicInt specialMaterial = new LogicInt(); |
| | | public readonly LogicInt starResultEffect = new LogicInt(); |
| | | |
| | |
| | | |
| | | public void UpdateStarLevels(HA3B1_tagMCEquipPartStarInfo info) |
| | | { |
| | | var selectedEquipOldStar = GetEquipStarLevel(new Int2(selectedLevel.value, selectedPlace.value)); |
| | | for (var i = 0; i < info.InfoList.Length; i++) |
| | | { |
| | | var equipPosition = EquipSet.ServerPlaceToClientPlace(info.InfoList[i].EquipPackIndex); |
| | |
| | | } |
| | | } |
| | | |
| | | equipStarLevel.value = GetEquipStarLevel(new Int2(selectedLevel.value, selectedPlace.value)); |
| | | var starLevel = GetEquipStarLevel(new Int2(selectedLevel.value, selectedPlace.value)); |
| | | equipStarLevel.value = starLevel; |
| | | selectedPlace.dirty = true; |
| | | |
| | | var maxStarLevel = GetMaxStarLevel(selectedLevel.value); |
| | | UpdateSelelctedEquipStars(selectedEquipOldStar, starLevel, maxStarLevel); |
| | | |
| | | foreach (var candidate in candidatePlaces.Values) |
| | | { |
| | |
| | | { |
| | | item.value = string.Empty; |
| | | } |
| | | |
| | | stars.Clear(); |
| | | } |
| | | |
| | | public void SelectLevel(int level) |
| | |
| | | candidate.selected.value = candidate.equipPosition == equipPosition; |
| | | } |
| | | |
| | | equipStarLevel.value = GetEquipStarLevel(equipPosition); |
| | | equipMaxStarLevel.value = GetMaxStarLevel(equipPosition.x); |
| | | var starLevel = GetEquipStarLevel(equipPosition); |
| | | var maxStarLevel = GetMaxStarLevel(equipPosition.x); |
| | | equipStarLevel.value = starLevel; |
| | | equipMaxStarLevel.value = maxStarLevel; |
| | | |
| | | UpdateSelelctedEquipStars(starLevel, starLevel, maxStarLevel); |
| | | AutoAddMaterials(equipPosition); |
| | | CalculateStarUpgradeProbability(equipPosition); |
| | | } |
| | |
| | | return materials.ContainsKey(index) ? materials[index] : null; |
| | | } |
| | | |
| | | private void UpdateSelelctedEquipStars(int oldStarLevel, int newStarLevel, int maxStarLevel) |
| | | { |
| | | stars.Clear(); |
| | | for (var i = 1; i <= maxStarLevel; i++) |
| | | { |
| | | stars.Add(new Star() |
| | | { |
| | | actived = i <= newStarLevel, |
| | | newGet = i <= newStarLevel && i > oldStarLevel, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | private void ParseConfig() |
| | | { |
| | | var configs = EquipStarConfig.GetValues(); |
| | |
| | | } |
| | | } |
| | | |
| | | public struct Star |
| | | { |
| | | public bool actived; |
| | | public bool newGet; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | public class EquipStarWin : Window |
| | | { |
| | | [SerializeField] RectTransform m_LevelContainer; |
| | | [SerializeField] ImageCouple[] m_Stars; |
| | | [SerializeField] Star[] m_Stars; |
| | | [SerializeField] ItemCell m_TargetEquip; |
| | | [SerializeField] Text m_EquipStar; |
| | | [SerializeField] Materials m_Materials; |
| | |
| | | } |
| | | |
| | | DisplayBaseInfo(); |
| | | DisplayDynamicInfo(true); |
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | |
| | | protected override void OnAfterClose() |
| | | { |
| | | model.ResetOperateParams(); |
| | | } |
| | | |
| | | protected override void OnActived() |
| | | { |
| | | base.OnActived(); |
| | | DisplayDynamicInfo(true); |
| | | } |
| | | |
| | | protected override void LateUpdate() |
| | |
| | | var equipPosition = new Int2(model.selectedLevel.value, model.selectedPlace.value); |
| | | var starLevel = model.equipStarLevel.Fetch(); |
| | | var maxStar = model.equipMaxStarLevel.Fetch(); |
| | | DisplayStars(equipPosition, starLevel, maxStar); |
| | | DisplayPropertyPreview(equipPosition, starLevel, EquipStarModel.GetMaxStarLevel(equipPosition.x)); |
| | | DisplayStarUpgradeButton(equipPosition, starLevel); |
| | | } |
| | | |
| | | if (force || model.stars.dirty) |
| | | { |
| | | DisplayStars(model.stars.Fetch()); |
| | | } |
| | | |
| | | if (force || model.starUpgradeProbability.dirty) |
| | |
| | | } |
| | | } |
| | | |
| | | private void DisplayStars(Int2 equipPosition, int currentStar, int maxStar) |
| | | private void DisplayStars(List<EquipStarModel.Star> stars) |
| | | { |
| | | if (equipPosition.y == 0) |
| | | { |
| | | foreach (var behaviour in m_Stars) |
| | | { |
| | | behaviour.Hide(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (var i = 0; i < m_Stars.Length; i++) |
| | | { |
| | | if (i < maxStar) |
| | | { |
| | | m_Stars[i].Display(i < currentStar); |
| | | } |
| | | else |
| | | { |
| | | m_Stars[i].Hide(); |
| | | } |
| | | } |
| | | } |
| | | StopCoroutine("Co_DisplayStars"); |
| | | StartCoroutine("Co_DisplayStars", stars); |
| | | } |
| | | |
| | | private void DisplayMaterialSlots(Int2 equipPosition, int currentStarLevel) |
| | |
| | | m_EffectFailed.Play(); |
| | | } |
| | | |
| | | IEnumerator Co_DisplayStars(List<EquipStarModel.Star> stars) |
| | | { |
| | | var hasNewStar = stars.FindIndex(x => { return x.newGet; }) != -1; |
| | | if (hasNewStar) |
| | | { |
| | | yield return WaitingForSecondConst.WaitMS2000; |
| | | } |
| | | |
| | | for (var i = 0; i < m_Stars.Length; i++) |
| | | { |
| | | if (i < stars.Count) |
| | | { |
| | | var star = stars[i]; |
| | | m_Stars[i].Display(star.actived); |
| | | if (star.newGet) |
| | | { |
| | | m_Stars[i].PlayEffect(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | m_Stars[i].Hide(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void ViewEquipTip() |
| | | { |
| | | var level = model.selectedLevel.value; |
| | |
| | | } |
| | | |
| | | [System.Serializable] |
| | | public class ImageCouple |
| | | public class Star |
| | | { |
| | | public RectTransform container; |
| | | public Image imageBase; |
| | | public Image imageStar; |
| | | public UIEffect newStarEffect; |
| | | |
| | | public void Display(bool active) |
| | | { |
| | |
| | | { |
| | | container.gameObject.SetActive(false); |
| | | } |
| | | |
| | | public void PlayEffect() |
| | | { |
| | | newStarEffect.Play(); |
| | | } |
| | | } |
| | | |
| | | [System.Serializable] |
| | |
| | | {
|
| | | [SerializeField] RectTransform m_StaticBackGround;
|
| | | [SerializeField] Image m_BackGroundImage;
|
| | | [SerializeField] RectTransform m_DynamicBackGround;
|
| | | [SerializeField] SkeletonGraphic m_SkeletonGraphic;
|
| | | [SerializeField] UIAlphaTween m_AlphaTween;
|
| | |
|
| | | GameObject loginEffect;
|
| | |
|
| | | bool useStaticBackGround = false;
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | loginEffect = this.transform.Find("Pivot/Effect_DengLu").gameObject;
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | |
| | | protected override void OnPreOpen()
|
| | | {
|
| | | var sprite = BuiltInLoader.LoadSprite("LoginBackGround");
|
| | | useStaticBackGround = sprite != null;
|
| | |
|
| | | if (useStaticBackGround)
|
| | | {
|
| | | m_BackGroundImage.overrideSprite = sprite;
|
| | | m_StaticBackGround.gameObject.SetActive(true);
|
| | | m_DynamicBackGround.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_StaticBackGround.gameObject.SetActive(false);
|
| | | m_DynamicBackGround.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | if (loginEffect != null)
|
| | | {
|
| | | loginEffect.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | this.transform.SetAsFirstSibling();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | StageLoad.Instance.onStageLoadFinish += ShowLoginEffect;
|
| | | if (StageLoad.Instance.currentStage is LoginStage)
|
| | | {
|
| | | ShowLoginEffect();
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | StageLoad.Instance.onStageLoadFinish -= ShowLoginEffect;
|
| | | Resources.UnloadAsset(m_SkeletonGraphic.material);
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | }
|
| | |
|
| | | if (!useStaticBackGround)
|
| | | private void Start()
|
| | | {
|
| | | if (m_SkeletonGraphic != null)
|
| | | {
|
| | | m_SkeletonGraphic.AnimationState.SetEmptyAnimations(0);
|
| | | m_AlphaTween.Play();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | void ShowLoginEffect()
|
| | | {
|
| | | if (!useStaticBackGround)
|
| | | {
|
| | | if (loginEffect != null)
|
| | | {
|
| | | loginEffect.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | if (m_SkeletonGraphic != null)
|
| | | {
|
| | | m_SkeletonGraphic.AnimationState.SetAnimation(0, "animation2", true);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] Button m_Back;
|
| | |
|
| | | [SerializeField] InputField m_NameInput;
|
| | |
|
| | | [SerializeField] Image m_Description;
|
| | | [SerializeField] Image m_JobName;
|
| | | [SerializeField] Image m_JobSign;
|
| | |
|
| | | [SerializeField] PositionTween m_LeftPostionTween;
|
| | | [SerializeField] PositionTween m_RightPositionTween;
|
| | | [SerializeField] UIAlphaTween m_AlphaTween;
|
| | |
|
| | | LoginModel model { get { return ModelCenter.Instance.GetModel<LoginModel>(); } }
|
| | |
|
| | |
| | | base.OnActived();
|
| | | m_LeftPostionTween.Play();
|
| | | m_RightPositionTween.Play();
|
| | | m_AlphaTween.Play();
|
| | |
|
| | | ChangeUserName(CreateRoleManager.Instance.selectedJob.value, true);
|
| | | DisplayDynamicInfo(true);
|
| | |
| | | m_JobSelect2.SetSelected(job == 2);
|
| | |
|
| | | var config = CreateRoleConfig.Get(job);
|
| | | m_Description.SetSprite(config.desc);
|
| | | m_Description.SetSprite(config.description);
|
| | | m_JobName.SetSprite(config.jobName);
|
| | | m_JobSign.SetSprite(config.jobSign);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public void SetSelected(bool selected)
|
| | | {
|
| | | var config = CreateRoleConfig.Get(job);
|
| | | backGround.SetSprite(selected ? config.selectIcon : config.unselectIcon);
|
| | | icon.SetSprite(selected ? "CreateRole_Job1_Select" : "CreateRole_Job1_UnSelect");
|
| | | backGround.SetSprite(selected ? "CreateRole_ChoosenBottom_a" : "CreateRole_UnChoosenBottom_a");
|
| | | icon.SetSprite(selected ? config.selectIcon : config.unselectIcon);
|
| | | icon.SetNativeSize();
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | [SerializeField] Text m_PlayerLevel;
|
| | |
|
| | | [SerializeField] Button m_Begin;
|
| | | [SerializeField] Image m_Description;
|
| | | [SerializeField] Button m_Back;
|
| | |
|
| | | [SerializeField] Image m_Description;
|
| | | [SerializeField] Image m_JobName;
|
| | | [SerializeField] Image m_JobSign;
|
| | |
|
| | | SelectRoleProcessor m_SelectRoleProcessor;
|
| | | SelectRoleProcessor selectRoleProcessor {
|
| | |
| | | m_PlayerName.text = PlayerDatas.Instance.loginInfo.PlayerName.ToString();//玩家昵称
|
| | | m_PlayerLevel.text = Language.Get("Z1024", PlayerDatas.Instance.loginInfo.LV);//玩家等级
|
| | | var config = CreateRoleConfig.Get(PlayerDatas.Instance.loginInfo.Job);
|
| | | m_Description.SetSprite(config.desc);
|
| | | m_Description.SetSprite(config.description);
|
| | | m_JobName.SetSprite(config.jobName);
|
| | | m_JobSign.SetSprite(config.jobSign);
|
| | |
|
| | | selectRoleProcessor.Show(PlayerDatas.Instance.loginInfo.Job);
|
| | | }
|
| | |
| | | PetZhuXian = 38, //宠物诛仙
|
| | | EnemyZhuXian = 39, //敌人诛仙
|
| | |
|
| | | PlayerDeadlyHit = 43, //玩家致死一击
|
| | | PetDeadlyHit = 44, //宠物致死一击 |
| | | EnemyDeadlyHit = 45, //敌人致死一击
|
| | |
|
| | | BuffAddDefense = 101,//+防御buff
|
| | | BuffAddAttack = 102,//+攻击buff
|
| | | BuffAddAttackSpeed = 103,//+攻速buff
|
| | |
| | | ZhuXianAtk,
|
| | | /** 终极斩杀 */
|
| | | FinalKill,
|
| | | /*致命一击*/
|
| | | DeadlyHit
|
| | | }
|
| | |
|
| | | public enum DungeonTargetType
|