Merge branch 'master' into 1871天赋功能
| | |
| | | originalRotX = rotationX;
|
| | | originalRotY = rotationY;
|
| | | DontDestroyOnLoad(this);
|
| | |
|
| | | SystemSetting.Instance.qualityLevelChangeEvent += QualityLevelChanged;
|
| | | }
|
| | |
|
| | | public void QualityLevelChanged()
|
| | | {
|
| | | if (CameraObject == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | {
|
| | | CameraObject.cullingMask |= LayerUtility.BattleEffectLowMask;
|
| | | CameraObject.cullingMask &= ~LayerUtility.BattleEffectMidMask;
|
| | | CameraObject.cullingMask &= ~LayerUtility.BattleEffectHighMask;
|
| | | }
|
| | | else if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Medium)
|
| | | {
|
| | | CameraObject.cullingMask |= LayerUtility.BattleEffectLowMask;
|
| | | CameraObject.cullingMask |= LayerUtility.BattleEffectMidMask;
|
| | | CameraObject.cullingMask &= ~LayerUtility.BattleEffectHighMask;
|
| | | }
|
| | | else if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.High)
|
| | | {
|
| | | CameraObject.cullingMask |= LayerUtility.BattleEffectLowMask;
|
| | | CameraObject.cullingMask |= LayerUtility.BattleEffectMidMask;
|
| | | CameraObject.cullingMask |= LayerUtility.BattleEffectHighMask;
|
| | | }
|
| | | }
|
| | |
|
| | | public void PlayAnimationClip(string name)
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Friday, August 17, 2018 |
| | | // [ Date ]: Friday, September 21, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | |
| | | public int[] BaseAttrTypes;
|
| | | public int[] BaseAttrValues;
|
| | | public int[] HelpBattleSkills;
|
| | | public int FightPowerEx { get ; private set ; }
|
| | | public int[] EquipPlaceColorList; |
| | | |
| | | public override string getKey() |
| | |
| | | int.TryParse(HelpBattleSkillsStringArray[i],out HelpBattleSkills[i]); |
| | | }
|
| | |
|
| | | string[] EquipPlaceColorListStringArray = rawContents[6].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | FightPowerEx=IsNumeric(rawContents[6]) ? int.Parse(rawContents[6]):0; |
| | | |
| | | string[] EquipPlaceColorListStringArray = rawContents[7].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | EquipPlaceColorList = new int[EquipPlaceColorListStringArray.Length]; |
| | | for (int i=0;i<EquipPlaceColorListStringArray.Length;i++) |
| | | { |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 940b0f1e335cf3749bb18fbee7090526 |
| | | timeCreated: 1534489434 |
| | | timeCreated: 1537530330 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Friday, August 10, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | namespace TableConfig { |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Friday, September 21, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using UnityEngine;
|
| | | using System;
|
| | |
|
| | | namespace TableConfig {
|
| | |
|
| | | |
| | | public partial class RuneTowerFloorConfig : ConfigBase {
|
| | |
|
| | | public int ID { get ; private set ; }
|
| | |
| | | public int UnLockCompose { get ; private set ; }
|
| | | public int RuneDrop { get ; private set ; }
|
| | | public int Fixed { get ; private set ; }
|
| | | |
| | | public int AutoExit { get ; private set ; }
|
| | |
|
| | | public override string getKey()
|
| | | {
|
| | | return ID.ToString();
|
| | | } |
| | | |
| | | public override void Parse() { |
| | | }
|
| | |
|
| | | public override void Parse() {
|
| | | try
|
| | | {
|
| | | ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0;
|
| | |
| | | RuneDrop=IsNumeric(rawContents[11]) ? int.Parse(rawContents[11]):0;
|
| | |
|
| | | Fixed=IsNumeric(rawContents[12]) ? int.Parse(rawContents[12]):0;
|
| | | |
| | | AutoExit=IsNumeric(rawContents[13]) ? int.Parse(rawContents[13]):0; |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | fileFormatVersion: 2 |
| | | guid: eb8552f7e3b6ad843878daecebc9eb01 |
| | | timeCreated: 1533871891 |
| | | timeCreated: 1537535813 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Friday, September 21, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | namespace TableConfig { |
| | | |
| | | |
| | | public partial class WHYJRewardConfig : ConfigBase { |
| | | |
| | | public int ID { get ; private set ; }
|
| | | public string Reward { get ; private set; } |
| | | public string Quantity { get ; private set; } |
| | | |
| | | public override string getKey() |
| | | { |
| | | return ID.ToString(); |
| | | } |
| | | |
| | | public override void Parse() { |
| | | try |
| | | { |
| | | ID=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | | |
| | | Reward = rawContents[1].Trim();
|
| | | |
| | | Quantity = rawContents[2].Trim(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | DebugEx.Log(ex); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 00dab7d472dcc5644902b144de22ce01 |
| | | timeCreated: 1537529264 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | AddAsyncTask<FairyGrabBossConfig>();
|
| | | AddAsyncTask<DungeonSpecialStateTimeConfig>();
|
| | | AddAsyncTask<DailyQuestSpecialOpenTimeConfig>();
|
| | |
|
| | | AddAsyncTask<WHYJRewardConfig>();
|
| | | while (!AllCompleted())
|
| | | {
|
| | | var completedCount = 0;
|
| | |
| | | lines = File.ReadAllLines(path, Encoding.UTF8);
|
| | | break;
|
| | | case AssetPath.External:
|
| | | var assetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact("config/", fileName, ".txt"));
|
| | | path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, assetVersion.relativePath);
|
| | | path = AssetVersionUtility.GetAssetFilePath(StringUtility.Contact("config/", fileName, ".txt"));
|
| | | lines = File.ReadAllLines(path, Encoding.UTF8);
|
| | | break;
|
| | | }
|
| | |
| | | public byte IsDouble; //是否双倍强化
|
| | |
|
| | | public CA5C4_tagCMDogzEquipPlus () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA5C4;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | H0102_tagCDBPlayer vNetData = vNetPack as H0102_tagCDBPlayer;
|
| | |
|
| | | SDKUtility.Instance.RoleLogin(vNetData.PlayerID.ToString(),
|
| | | vNetData.PlayerName,
|
| | | vNetData.LV.ToString(),
|
| | | vNetData.VIPLv.ToString());
|
| | |
|
| | | DEBUG_0102 = true;
|
| | | DTC0403_tagPlayerLoginLoadOK.finishedLogin = false;
|
| | | DEBUG_STEP = 0;
|
| | |
| | | }
|
| | |
|
| | | PlayerDatas.Instance.InitPlayerData(vNetData);
|
| | |
|
| | | SDKUtility.Instance.RoleLogin(vNetData.PlayerID.ToString(),
|
| | | vNetData.PlayerName,
|
| | | vNetData.LV.ToString(),
|
| | | vNetData.VIPLv.ToString());
|
| | |
|
| | | var _mapConfig = Config.Instance.Get<MapConfig>(vNetData.MapID);
|
| | |
|
| | | DTCA127_tagMCStartChangeMap.LineID = 0;
|
| | |
| | | UnityEngine.Object.Instantiate(Resources.Load<GameObject>("Prefabs/GameCamera"));
|
| | | CameraController.Instance.AcceptInput = false;
|
| | | CameraController.Instance.CameraObject.enabled = false;
|
| | | CameraController.Instance.QualityLevelChanged();
|
| | | }
|
| | |
|
| | | var hudRoot = HUDCenter.hudRoot;
|
| | |
| | |
|
| | | for (int i = 0; i < vNetData.Players.Length; ++i)
|
| | | {
|
| | | if (BattleEffectPlayRule.Instance.sortPlayerList.Contains(vNetData.Players[i]))
|
| | | {
|
| | | BattleEffectPlayRule.Instance.sortPlayerList.Remove(vNetData.Players[i]);
|
| | | }
|
| | |
|
| | | _actor = GAMgr.Instance.GetBySID(vNetData.Players[i]);
|
| | |
|
| | | if (_actor != null)
|
| | |
| | | // 异常
|
| | | }
|
| | |
|
| | | if (!BattleEffectPlayRule.Instance.sortPlayerList.Contains(vNetData.PlayerID))
|
| | | {
|
| | | BattleEffectPlayRule.Instance.sortPlayerList.Add(vNetData.PlayerID);
|
| | | }
|
| | |
|
| | | // 离线玩家
|
| | | if (vNetData.State == 1)
|
| | | {
|
| | |
| | | StatusMgr.Instance.GetBuffIds(vNetData.ObjID, ref _skill.cacheBuffList);
|
| | | _skill.OnRecv_SkillCast();
|
| | |
|
| | | // 这里播放配置的技能特效
|
| | | if (_skill.skillInfo.config.EffectName > 0)
|
| | | if (!(_attacker is GA_Player) || BattleEffectPlayRule.Instance.CanPlay(vNetData.ObjID))
|
| | | {
|
| | | bool _playEffect = true;
|
| | |
|
| | | if (vNetData.ObjID != PlayerDatas.Instance.PlayerId)
|
| | | // 这里播放配置的技能特效
|
| | | if (_skill.skillInfo.config.EffectName > 0)
|
| | | {
|
| | | if (!_attacker.ShowOrHide
|
| | | || SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | {
|
| | | _playEffect = false;
|
| | | }
|
| | | }
|
| | | bool _playEffect = true;
|
| | |
|
| | | if (_playEffect)
|
| | | {
|
| | | if (_skill.warnPosList.Count > 1)
|
| | | if (vNetData.ObjID != PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | for (int i = 0; i < _skill.warnPosList.Count; ++i)
|
| | | if (!_attacker.ShowOrHide
|
| | | || SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | {
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName, _skill.warnPosList[i], Vector3.forward);
|
| | | _playEffect = false;
|
| | | }
|
| | | }
|
| | | else
|
| | |
|
| | | if (_playEffect)
|
| | | {
|
| | | if ((_skill.skillInfo.config.Tag % 10) == 0 || (_skill.skillInfo.config.Tag % 10) == 1 || _attacker is GActorNpcFight)
|
| | | if (_skill.warnPosList.Count > 1)
|
| | | {
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName, _attacker);
|
| | | for (int i = 0; i < _skill.warnPosList.Count; ++i)
|
| | | {
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName, _skill.warnPosList[i], Vector3.forward);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | Vector3 _pos = new Vector3((vNetData.PosX - GA_Hero.MapOffset.x) * .5f,
|
| | | _attacker.Pos.y,
|
| | | (vNetData.PosY - GA_Hero.MapOffset.z) * .5f);
|
| | | if ((_skill.skillInfo.config.Tag % 10) == 0 || (_skill.skillInfo.config.Tag % 10) == 1 || _attacker is GActorNpcFight)
|
| | | {
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName, _attacker);
|
| | | }
|
| | | else
|
| | | {
|
| | | Vector3 _pos = new Vector3((vNetData.PosX - GA_Hero.MapOffset.x) * .5f,
|
| | | _attacker.Pos.y,
|
| | | (vNetData.PosY - GA_Hero.MapOffset.z) * .5f);
|
| | |
|
| | | Vector3 _dir = MathUtility.ForwardXZ(_pos, _attacker.Pos);
|
| | | Vector3 _dir = MathUtility.ForwardXZ(_pos, _attacker.Pos);
|
| | |
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName,
|
| | | _pos,
|
| | | _dir);
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName,
|
| | | _pos,
|
| | | _dir);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (_skill.skillInfo.config.EffectName != 0)
|
| | | if (!(_attacker is GA_Player) || BattleEffectPlayRule.Instance.CanPlay(vNetData.ObjID))
|
| | | {
|
| | | bool _playEffect = true;
|
| | |
|
| | | if (vNetData.ObjID != PlayerDatas.Instance.PlayerId)
|
| | | if (_skill.skillInfo.config.EffectName != 0)
|
| | | {
|
| | | if (!_attacker.ShowOrHide
|
| | | || SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | bool _playEffect = true;
|
| | |
|
| | | if (vNetData.ObjID != PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | _playEffect = false;
|
| | | if (!_attacker.ShowOrHide
|
| | | || SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | {
|
| | | _playEffect = false;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | if (_playEffect)
|
| | | {
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName, _attacker);
|
| | | if (_playEffect)
|
| | | {
|
| | | SFXPlayUtility.Instance.PlayBattleEffect(_skill.skillInfo.config.EffectName, _attacker);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | //A0 05 同步开服天数 #tagOpenServerDay
|
| | |
|
| | | public class HA005_tagOpenServerDay : GameNetPackBasic
|
| | | {
|
| | | public ushort Day; // 已开服天数,从0开始
|
| | | public byte IsMixServer; //是否是合服服务器
|
| | | public ushort MixDay; // 已合服天数,从0开始
|
| | | public string OpenServerTime; //开服时间yyyy-MM-dd HH:mm:ss
|
| | |
|
| | | public HA005_tagOpenServerDay()
|
| | | {
|
| | | _cmd = (ushort)0xA005;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes(byte[] vBytes)
|
| | | {
|
| | | TransBytes(out Day, vBytes, NetDataType.WORD);
|
| | | TransBytes(out IsMixServer, vBytes, NetDataType.BYTE);
|
| | | TransBytes(out MixDay, vBytes, NetDataType.WORD);
|
| | | TransBytes(out OpenServerTime, vBytes, NetDataType.Chars, 19);
|
| | | }
|
| | |
|
| | | } |
| | | //A0 05 同步开服天数 #tagOpenServerDay
|
| | |
|
| | | public class HA005_tagOpenServerDay : GameNetPackBasic {
|
| | | public ushort Day; // 已开服天数,从0开始
|
| | | public byte IsMixServer; //是否是合服服务器
|
| | | public ushort MixDay; // 已合服天数,从0开始
|
| | | public byte OpenWeekday; //开服是周几,1代表周一
|
| | | public ushort NowYear; //服务器当前时间 - 年
|
| | | public byte NowMonth;
|
| | | public byte NowDay;
|
| | | public byte NowHour;
|
| | | public byte NowMinute;
|
| | | public byte NowSecond;
|
| | | public uint NowMicSecond;
|
| | |
|
| | | public HA005_tagOpenServerDay () {
|
| | | _cmd = (ushort)0xA005;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Day, vBytes, NetDataType.WORD);
|
| | | TransBytes (out IsMixServer, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out MixDay, vBytes, NetDataType.WORD);
|
| | | TransBytes (out OpenWeekday, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out NowYear, vBytes, NetDataType.WORD);
|
| | | TransBytes (out NowMonth, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out NowDay, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out NowHour, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out NowMinute, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out NowSecond, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out NowMicSecond, vBytes, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | {
|
| | | m_PaymentTable["RechargeChannel"] = "1";
|
| | | }
|
| | | else if (ChannelPlatform == E_ChannelPlatform.Sp)
|
| | | {
|
| | | m_PaymentTable["RechargeChannel"] = "2";
|
| | | }
|
| | |
|
| | | var _stringBuilder = new System.Text.StringBuilder();
|
| | | var _md5Body = _stringBuilder.Append(m_PaymentTable["AppID"]).
|
| | |
| | | {
|
| | | m_Json.Clear();
|
| | | m_Json["code"] = CodeU2A.RoleLogin;
|
| | |
|
| | | m_Json["roleID"] = roleID;
|
| | | m_Json["roleName"] = roleName;
|
| | | m_Json["sid"] = "s" + ServerListCenter.Instance.currentServer.region_flag;
|
| | | m_Json["level"] = lv;
|
| | | m_Json["vipLevel"] = vipLV;
|
| | | m_Json["serverName"] = ServerListCenter.Instance.currentServer.name;
|
| | | m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName;
|
| | | m_Json["level"] = PlayerDatas.Instance.baseData.LV;
|
| | | m_Json["job"] = PlayerDatas.Instance.baseData.Job.ToString();
|
| | | m_Json["money"] = PlayerDatas.Instance.baseData.Gold.ToString();
|
| | | m_Json["gameName"] = VersionConfig.Get().productName;
|
| | | m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString();
|
| | |
|
| | | SendMessageToSDK(m_Json);
|
| | | }
|
| | |
|
| | | public void RoleLevelUp()
|
| | | {
|
| | | m_Json.Clear();
|
| | | m_Json["code"] = CodeU2A.RoleLevelUp;
|
| | |
|
| | | m_Json["roleID"] = PlayerDatas.Instance.PlayerId.ToString();
|
| | | m_Json["roleName"] = PlayerDatas.Instance.baseData.PlayerName;
|
| | | m_Json["sid"] = "s" + ServerListCenter.Instance.currentServer.region_flag;
|
| | | m_Json["serverName"] = ServerListCenter.Instance.currentServer.name;
|
| | | m_Json["familyName"] = PlayerDatas.Instance.baseData.FamilyName;
|
| | | m_Json["level"] = PlayerDatas.Instance.baseData.LV;
|
| | | m_Json["job"] = PlayerDatas.Instance.baseData.Job.ToString();
|
| | | m_Json["money"] = PlayerDatas.Instance.baseData.Gold.ToString();
|
| | | m_Json["gameName"] = VersionConfig.Get().productName;
|
| | | m_Json["vipLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString();
|
| | |
|
| | | SendMessageToSDK(m_Json);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | SFXController _controller = Play(id, parent, scale);
|
| | |
|
| | | if (_controller != null)
|
| | | {
|
| | | _controller.gameObject.SetLayer(LayerUtility.BattleEffect, true);
|
| | | }
|
| | |
|
| | | return _controller;
|
| | | }
|
| | |
|
| | |
| | | public SFXController PlayBattleEffect(int id, Vector3 position, Vector3 forward, float scale = 1f)
|
| | | {
|
| | | SFXController _controller = Play(id, position, forward, scale);
|
| | |
|
| | | if (_controller != null)
|
| | | {
|
| | | _controller.gameObject.SetLayer(LayerUtility.BattleEffect, true);
|
| | | }
|
| | |
|
| | | return _controller;
|
| | | }
|
| | |
| | |
|
| | | Transform _temp1 = WindowCenter.Instance.uiRoot.baseCanvas.Find("MainInterfaceWin/JoyStick");
|
| | | _temp1.gameObject.SetActive(true);
|
| | |
|
| | | WindowCenter.Instance.Close<NewGuideWin>();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | |
| | | if (m_FoTransMit.ammoEffectId > 0) |
| | | { |
| | | SFXController _sfx = SFXPlayUtility.Instance.PlayBattleEffect(m_FoTransMit.ammoEffectId, _fight); |
| | | if (_sfx) |
| | | if (BattleEffectPlayRule.Instance.CanPlay(m_InitInfo.casterServerObjID)) |
| | | { |
| | | _sfx.duration = m_FoTransMit.eachLastTime; |
| | | FoTransmitController _controller = _sfx.AddMissingComponent<FoTransmitController>(); |
| | | _controller.start = _start; |
| | | _controller.end = _end; |
| | | _controller.transmit = _sfx; |
| | | _controller.enabled = true; |
| | | _sfx.m_OnFinished += OnSFXDisable; |
| | | SFXController _sfx = SFXPlayUtility.Instance.PlayBattleEffect(m_FoTransMit.ammoEffectId, _fight); |
| | | if (_sfx) |
| | | { |
| | | _sfx.duration = m_FoTransMit.eachLastTime; |
| | | FoTransmitController _controller = _sfx.AddMissingComponent<FoTransmitController>(); |
| | | _controller.start = _start; |
| | | _controller.end = _end; |
| | | _controller.transmit = _sfx; |
| | | _controller.enabled = true; |
| | | _sfx.m_OnFinished += OnSFXDisable; |
| | | |
| | | m_CacheAllEffect.Add(_sfx); |
| | | m_CacheAllEffect.Add(_sfx); |
| | | } |
| | | //Debug.LogFormat("播放特效: 开始: {0}, 结束: {1}", _start, _end); |
| | | } |
| | | |
| | | //Debug.LogFormat("播放特效: 开始: {0}, 结束: {1}", _start, _end); |
| | | } |
| | | |
| | | if (_target2 != null) |
| | |
| | | _xayShadow.transform.localScale = requester.transform.localScale; |
| | | _xayShadow.transform.position = requester.transform.position; |
| | | _xayShadow.transform.rotation = requester.transform.rotation; |
| | | _xayShadow.layer = LayerUtility.BattleEffect; |
| | | _xayShadow.layer = LayerUtility.BattleEffectLow; |
| | | |
| | | XRayShadowController _controller = _xayShadow.AddComponent<XRayShadowController>(); |
| | | _controller.duration = lastTime; |
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (owner is GA_Player && !BattleEffectPlayRule.Instance.CanPlay(owner.ServerInstID))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | SFXController _controller = SFXPlayUtility.Instance.PlayBattleEffect(id, owner);
|
| | | if (_controller)
|
| | | {
|
| | |
| | | { |
| | | if (_player.SelectTarget != null) |
| | | { |
| | | m_StartHeadEffect = SFXPlayUtility.Instance.PlayBattleEffect(m_CacheSkill.skillInfo.soFile.effectOnTargetHead, _player.SelectTarget); |
| | | if (BattleEffectPlayRule.Instance.CanPlay(_player.ServerInstID)) |
| | | { |
| | | m_StartHeadEffect = SFXPlayUtility.Instance.PlayBattleEffect(m_CacheSkill.skillInfo.soFile.effectOnTargetHead, _player.SelectTarget); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | |
|
| | | GActorFight _target = GAMgr.Instance.GetBySID(data.ObjID) as GActorFight;
|
| | |
|
| | | if (_target != null)
|
| | | if (!(_target is GA_Player) || BattleEffectPlayRule.Instance.CanPlay(data.ObjID))
|
| | | {
|
| | | if (m_SkillConfig.BuffEffectID > 0)
|
| | | if (_target != null)
|
| | | {
|
| | | if (m_Effect)
|
| | | if (m_SkillConfig.BuffEffectID > 0)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_Effect);
|
| | | }
|
| | |
|
| | | bool _playEffect = true;
|
| | |
|
| | | if (h0605.ObjID != PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | if (!_target.ShowOrHide
|
| | | || SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | {
|
| | | _playEffect = false;
|
| | | }
|
| | | }
|
| | |
|
| | | if (_playEffect)
|
| | | {
|
| | | m_Effect = SFXPlayUtility.Instance.PlayBattleEffect(m_SkillConfig.BuffEffectID, _target);
|
| | | if (m_Effect)
|
| | | {
|
| | | m_Effect.m_OnFinished += OnEffectOver;
|
| | | SFXPlayUtility.Instance.Release(m_Effect);
|
| | | }
|
| | |
|
| | | bool _playEffect = true;
|
| | |
|
| | | if (h0605.ObjID != PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | if (!_target.ShowOrHide
|
| | | || SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Low)
|
| | | {
|
| | | _playEffect = false;
|
| | | }
|
| | | }
|
| | |
|
| | | if (_playEffect)
|
| | | {
|
| | | m_Effect = SFXPlayUtility.Instance.PlayBattleEffect(m_SkillConfig.BuffEffectID, _target);
|
| | | if (m_Effect)
|
| | | {
|
| | | m_Effect.m_OnFinished += OnEffectOver;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class BattleEffectPlayRule : Singleton<BattleEffectPlayRule> |
| | | { |
| | | public List<uint> sortPlayerList = new List<uint>(); |
| | | |
| | | private int limit |
| | | { |
| | | get |
| | | { |
| | | if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.High) |
| | | { |
| | | return 7; |
| | | } |
| | | else if (SystemSetting.Instance.GetCurrentQualityLevel() == GameQuality.Medium) |
| | | { |
| | | return 3; |
| | | } |
| | | else |
| | | { |
| | | return 0; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public float timeEscape; |
| | | |
| | | public void Update() |
| | | { |
| | | if (Time.realtimeSinceStartup - timeEscape > .5f) |
| | | { |
| | | GA_Hero _hero = PlayerDatas.Instance.hero; |
| | | if (_hero == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | sortPlayerList.Sort((id1, id2) => |
| | | { |
| | | GActor _actor1 = GAMgr.Instance.GetBySID(id1); |
| | | GActor _actor2 = GAMgr.Instance.GetBySID(id2); |
| | | |
| | | float _dis1 = 0f; |
| | | float _dis2 = 0f; |
| | | |
| | | if (_actor1 != null) |
| | | { |
| | | _dis1 = MathUtility.DistanceSqrtXZ(_hero.Pos, _actor1.Pos); |
| | | } |
| | | |
| | | if (_actor2 != null) |
| | | { |
| | | _dis2 = MathUtility.DistanceSqrtXZ(_hero.Pos, _actor2.Pos); |
| | | } |
| | | |
| | | return _dis2 > _dis1 ? -1 : 1; |
| | | }); |
| | | |
| | | timeEscape = Time.realtimeSinceStartup; |
| | | } |
| | | } |
| | | |
| | | public bool CanPlay(uint sid) |
| | | { |
| | | GA_Hero _hero = PlayerDatas.Instance.hero; |
| | | if (_hero == null) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | // 选中英雄必显示 |
| | | if (_hero.SelectTarget != null) |
| | | { |
| | | if (_hero.SelectTarget.ServerInstID == sid) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | if (_hero.LockTarget != null) |
| | | { |
| | | if (_hero.LockTarget.ServerInstID == sid) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | // 获取传入的玩家在排序后的队列中的索引 |
| | | int _index = sortPlayerList.IndexOf(sid); |
| | | |
| | | // 不存在可能是异常,不播放 |
| | | if (_index < 0) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | // 在限定的数量内,允许播放 |
| | | if (_index < limit) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 52c66c7311d7af341b7bdb32f3cd7096 |
| | | timeCreated: 1537445788 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | public Dictionary<int, string> s_NpcID2BundleName = new Dictionary<int, string>();
|
| | | public Dictionary<int, string> s_NpcID2Assetname = new Dictionary<int, string>();
|
| | |
|
| | |
|
| | |
|
| | | public event UnityAction<uint> OnGActorRequest;
|
| | | public event UnityAction<uint> OnGActorServerDie;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | UpdateOffLinePlayer();
|
| | |
|
| | | BattleEffectPlayRule.Instance.Update();
|
| | | }
|
| | |
|
| | | public void DoLateUpdate()
|
| | |
| | | Object.Destroy(m_Dig.gameObject);
|
| | | m_Dig = null;
|
| | | }
|
| | |
|
| | | if(Root)
|
| | | {
|
| | | Root.localScale = Vector3.one;
|
| | | }
|
| | | }
|
| | |
|
| | | public override void Destroy()
|
| | |
| | | SetAnimatorSpeed(JobSetup.RushAnimatorSpeed * Constants.F_DELTA);
|
| | | m_LastRushTime = Time.time;
|
| | |
|
| | | if (m_RushEffect == null)
|
| | | if (this is GA_Hero || BattleEffectPlayRule.Instance.CanPlay(ServerInstID))
|
| | | {
|
| | | m_RushEffect = SFXPlayUtility.Instance.PlayBattleEffect(50401, this);
|
| | | m_RushEffect.duration = 0;
|
| | | if (m_RushEffect == null)
|
| | | {
|
| | | m_RushEffect = SFXPlayUtility.Instance.PlayBattleEffect(50401, this);
|
| | | m_RushEffect.duration = 0;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(mapId, 0);
|
| | | var assetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
|
| | |
|
| | | if (!assetVersion.IsPriorAsset())
|
| | | if (assetVersion != null && !assetVersion.IsPriorAsset())
|
| | | {
|
| | | InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.Whole);
|
| | | return false;
|
| | |
| | |
|
| | | if (GA_Hero.s_MapSwitching)
|
| | | {
|
| | | if (PlayerDatas.Instance.hero.IsRun())
|
| | | if (PlayerDatas.Instance.hero != null
|
| | | && PlayerDatas.Instance.hero.IsRun())
|
| | | {
|
| | | PlayerDatas.Instance.hero.IdleImmediate();
|
| | | }
|
| | |
| | | {
|
| | | yield break;
|
| | | }
|
| | |
|
| | | |
| | | CameraController.Instance.MaskCamera.gameObject.SetActive(false);
|
| | | |
| | | if (m_MoveToEffect)
|
| | | {
|
| | | SFXPlayUtility.Instance.Release(m_MoveToEffect);
|
| | |
| | | playerName.text = PlayerDatas.Instance.baseData.PlayerName;
|
| | | playerContent.text = m_DialogConfig.content;
|
| | |
|
| | | UI3DModelExhibition.Instance.BeginShowPlayer(playerIcon, PlayerDatas.Instance.baseData.Job, true);
|
| | | UI3DModelExhibition.Instance.ShowPlayer(playerIcon, PlayerDatas.Instance.baseData.Job, true);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | npcContent.text = m_DialogConfig.content;
|
| | |
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(m_DialogConfig.npcId);
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(m_DialogConfig.npcId, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, npcIcon, false, true);
|
| | | UI3DModelExhibition.Instance.ShowNPC(m_DialogConfig.npcId, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, npcIcon, false, true);
|
| | | }
|
| | |
|
| | | if (m_DialogConfig.TalkID != 0)
|
| | |
| | | public event Action<float> loadingProgressEvent;
|
| | |
|
| | | bool m_IsServerPreparing = false;
|
| | | public bool isServerPreparing
|
| | | {
|
| | | public bool isServerPreparing {
|
| | | get { return m_IsServerPreparing; }
|
| | | set { m_IsServerPreparing = value; }
|
| | | }
|
| | |
|
| | | public Stage.E_StageType StageType
|
| | | {
|
| | | get
|
| | | {
|
| | | public Stage.E_StageType StageType {
|
| | | get {
|
| | | return m_StageType;
|
| | | }
|
| | | }
|
| | |
|
| | | public Stage CurrentStage
|
| | | {
|
| | | get
|
| | | {
|
| | | public Stage CurrentStage {
|
| | | get {
|
| | | return m_CurrentStage;
|
| | | }
|
| | | }
|
| | |
|
| | | int m_CurrentMapId;
|
| | | public int currentMapId
|
| | | {
|
| | | public int currentMapId {
|
| | | get { return m_CurrentMapId; }
|
| | | private set { m_CurrentMapId = value; }
|
| | | }
|
| | |
|
| | | int m_CurrentMapResID;
|
| | | public int currentMapResId
|
| | | {
|
| | | get
|
| | | {
|
| | | public int currentMapResId {
|
| | | get {
|
| | | return m_CurrentMapResID;
|
| | | }
|
| | | private set { m_CurrentMapResID = value; }
|
| | |
| | |
|
| | |
|
| | | float m_LoadingProgress = 0f;
|
| | | float loadingProgress
|
| | | {
|
| | | float loadingProgress {
|
| | | get { return m_LoadingProgress; }
|
| | | set
|
| | | {
|
| | | set {
|
| | | m_LoadingProgress = value;
|
| | | if (loadingProgressEvent != null)
|
| | | {
|
| | |
| | | else
|
| | | {
|
| | | var assetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
|
| | | if (assetVersion.IsPriorAsset())
|
| | | if (assetVersion != null && assetVersion.IsPriorAsset())
|
| | | {
|
| | | SnxxzGame.Instance.StartCoroutine(LoadCoroutine<T>(stageId, mapResConfig.ID, mapResConfig.MapResources, true));
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: d463e02633381cd46902c21b8d51f83e |
| | | folderAsset: yes |
| | | timeCreated: 1537519875 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 77d1032b5eb62ce4da86e600bc8884c8 |
| | | folderAsset: yes |
| | | timeCreated: 1537519883 |
| | | licenseType: Pro |
| | | DefaultImporter: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace PigeonCoopToolkit.Utillities |
| | | { |
| | | public class CircularBuffer<T> : IList<T>, ICollection<T>, |
| | | IEnumerable<T>, IEnumerable |
| | | { |
| | | /// <summary> |
| | | /// Creates a new instance of a <see cref="RingBuffer<T>"/> with a |
| | | /// specified cache size. |
| | | // http://florianreischl.blogspot.com/2010/01/generic-c-ringbuffer.html |
| | | /// </summary> |
| | | /// <param name="capacity">The maximal count of items to be stored within |
| | | /// the ring buffer.</param> |
| | | public CircularBuffer(int capacity) |
| | | { |
| | | // validate capacity |
| | | if (capacity <= 0) |
| | | throw new ArgumentException("Must be greater than zero", "capacity"); |
| | | // set capacity and init the cache |
| | | Capacity = capacity; |
| | | _buffer = new T[capacity]; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// the internal buffer |
| | | /// </summary> |
| | | T[] _buffer; |
| | | /// <summary> |
| | | /// The all-over position within the ring buffer. The position |
| | | /// increases continously by adding new items to the buffer. This |
| | | /// value is needed to calculate the current relative position within the |
| | | /// buffer. |
| | | /// </summary> |
| | | int _position; |
| | | /// <summary> |
| | | /// The current version of the buffer, this is required for a correct |
| | | /// exception handling while enumerating over the items of the buffer. |
| | | /// </summary> |
| | | long _version; |
| | | |
| | | /// <summary> |
| | | /// Gets or sets an item for a specified position within the ring buffer. |
| | | /// </summary> |
| | | /// <param name="index">The position to get or set an item.</param> |
| | | /// <returns>The fond item at the specified position within the ring buffer. |
| | | /// </returns> |
| | | /// <exception cref="IndexOutOfRangeException"></exception> |
| | | public T this[int index] { |
| | | get { |
| | | // validate the index |
| | | if (index < 0 || index >= Count) |
| | | throw new IndexOutOfRangeException(); |
| | | // calculate the relative position within the rolling base array |
| | | int index2 = (_position - Count + index) % Capacity; |
| | | return _buffer[index2]; |
| | | } |
| | | set { Insert(index, value); } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Gets the maximal count of items within the ring buffer. |
| | | /// </summary> |
| | | public int Capacity { get; private set; } |
| | | /// <summary> |
| | | /// Get the current count of items within the ring buffer. |
| | | /// </summary> |
| | | public int Count { get; private set; } |
| | | |
| | | /// <summary> |
| | | /// Adds a new item to the buffer. |
| | | /// </summary> |
| | | /// <param name="item">The item to be added to the buffer.</param> |
| | | public void Add(T item) { |
| | | // add a new item to the current relative position within the |
| | | // buffer and increase the position |
| | | _buffer[_position++ % Capacity] = item; |
| | | // increase the count if capacity is not yet reached |
| | | if (Count < Capacity) Count++; |
| | | // buffer changed; next version |
| | | _version++; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Clears the whole buffer and releases all referenced objects |
| | | /// currently stored within the buffer. |
| | | /// </summary> |
| | | public void Clear() { |
| | | for (int i = 0; i < Count; i++) |
| | | _buffer[i] = default(T); |
| | | _position = 0; |
| | | Count = 0; |
| | | _version++; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Determines if a specified item is currently present within |
| | | /// the buffer. |
| | | /// </summary> |
| | | /// <param name="item">The item to search for within the current |
| | | /// buffer.</param> |
| | | /// <returns>True if the specified item is currently present within |
| | | /// the buffer; otherwise false.</returns> |
| | | public bool Contains(T item) { |
| | | int index = IndexOf(item); |
| | | return index != -1; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Copies the current items within the buffer to a specified array. |
| | | /// </summary> |
| | | /// <param name="array">The target array to copy the items of |
| | | /// the buffer to.</param> |
| | | /// <param name="arrayIndex">The start position witihn the target |
| | | /// array to start copying.</param> |
| | | public void CopyTo(T[] array, int arrayIndex) { |
| | | for (int i = 0; i < Count; i++) { |
| | | array[i + arrayIndex] = _buffer[(_position - Count + i) % Capacity]; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Gets an enumerator over the current items within the buffer. |
| | | /// </summary> |
| | | /// <returns>An enumerator over the current items within the buffer. |
| | | /// </returns> |
| | | public IEnumerator<T> GetEnumerator() { |
| | | long version = _version; |
| | | for (int i = 0; i < Count; i++) { |
| | | if (version != _version) |
| | | throw new InvalidOperationException("Collection changed"); |
| | | yield return this[i]; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Gets the position of a specied item within the ring buffer. |
| | | /// </summary> |
| | | /// <param name="item">The item to get the current position for.</param> |
| | | /// <returns>The zero based index of the found item within the |
| | | /// buffer. If the item was not present within the buffer, this |
| | | /// method returns -1.</returns> |
| | | public int IndexOf(T item) { |
| | | // loop over the current count of items |
| | | for (int i = 0; i < Count; i++) { |
| | | // get the item at the relative position within the internal array |
| | | T item2 = _buffer[(_position - Count + i) % Capacity]; |
| | | // if both items are null, return true |
| | | if (null == item && null == item2) |
| | | return i; |
| | | // if equal return the position |
| | | if (item != null && item.Equals(item2)) |
| | | return i; |
| | | } |
| | | // nothing found |
| | | return -1; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Inserts an item at a specified position into the buffer. |
| | | /// </summary> |
| | | /// <param name="index">The position within the buffer to add |
| | | /// the new item.</param> |
| | | /// <param name="item">The new item to be added to the buffer.</param> |
| | | /// <exception cref="IndexOutOfRangeException"></exception> |
| | | /// <remarks> |
| | | /// If the specified index is equal to the current count of items |
| | | /// within the buffer, the specified item will be added. |
| | | /// |
| | | /// <b>Warning</b> |
| | | /// Frequent usage of this method might become a bad idea if you are |
| | | /// working with a large buffer capacity. The insertion of an item |
| | | /// at a specified position within the buffer causes causes all present |
| | | /// items below the specified position to be moved one position. |
| | | /// </remarks> |
| | | public void Insert(int index, T item) { |
| | | // validate index |
| | | if (index < 0 || index > Count) |
| | | throw new IndexOutOfRangeException(); |
| | | // add if index equals to count |
| | | if (index == Count) { |
| | | Add(item); |
| | | return; |
| | | } |
| | | |
| | | // get the maximal count of items to be moved |
| | | int count = Math.Min(Count, Capacity - 1) - index; |
| | | // get the relative position of the new item within the buffer |
| | | int index2 = (_position - Count + index) % Capacity; |
| | | |
| | | // move all items below the specified position |
| | | for (int i = index2 + count; i > index2; i--) { |
| | | int to = i % Capacity; |
| | | int from = (i - 1) % Capacity; |
| | | _buffer[to] = _buffer[from]; |
| | | } |
| | | |
| | | // set the new item |
| | | _buffer[index2] = item; |
| | | |
| | | // adjust storage information |
| | | if (Count < Capacity) { |
| | | Count++; |
| | | _position++; |
| | | } |
| | | // buffer changed; next version |
| | | _version++; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Removes a specified item from the current buffer. |
| | | /// </summary> |
| | | /// <param name="item">The item to be removed.</param> |
| | | /// <returns>True if the specified item was successfully removed |
| | | /// from the buffer; otherwise false.</returns> |
| | | /// <remarks> |
| | | /// <b>Warning</b> |
| | | /// Frequent usage of this method might become a bad idea if you are |
| | | /// working with a large buffer capacity. The removing of an item |
| | | /// requires a scan of the buffer to get the position of the specified |
| | | /// item. If the item was found, the deletion requires a move of all |
| | | /// items stored abouve the found position. |
| | | /// </remarks> |
| | | public bool Remove(T item) { |
| | | // find the position of the specified item |
| | | int index = IndexOf(item); |
| | | // item was not found; return false |
| | | if (index == -1) |
| | | return false; |
| | | // remove the item at the specified position |
| | | RemoveAt(index); |
| | | return true; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Removes an item at a specified position within the buffer. |
| | | /// </summary> |
| | | /// <param name="index">The position of the item to be removed.</param> |
| | | /// <exception cref="IndexOutOfRangeException"></exception> |
| | | /// <remarks> |
| | | /// <b>Warning</b> |
| | | /// Frequent usage of this method might become a bad idea if you are |
| | | /// working with a large buffer capacity. The deletion requires a move |
| | | /// of all items stored abouve the found position. |
| | | /// </remarks> |
| | | public void RemoveAt(int index) { |
| | | // validate the index |
| | | if (index < 0 || index >= Count) |
| | | throw new IndexOutOfRangeException(); |
| | | // move all items above the specified position one step |
| | | // closer to zeri |
| | | for (int i = index; i < Count - 1; i++) { |
| | | // get the next relative target position of the item |
| | | int to = (_position - Count + i) % Capacity; |
| | | // get the next relative source position of the item |
| | | int from = (_position - Count + i + 1) % Capacity; |
| | | // move the item |
| | | _buffer[to] = _buffer[from]; |
| | | } |
| | | // get the relative position of the last item, which becomes empty |
| | | // after deletion and set the item as empty |
| | | int last = (_position - 1) % Capacity; |
| | | _buffer[last] = default(T); |
| | | // adjust storage information |
| | | _position--; |
| | | Count--; |
| | | // buffer changed; next version |
| | | _version++; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Gets if the buffer is read-only. This method always returns false. |
| | | /// </summary> |
| | | bool ICollection<T>.IsReadOnly { get { return false; } } |
| | | |
| | | /// <summary> |
| | | /// See generic implementation of <see cref="GetEnumerator"/>. |
| | | /// </summary> |
| | | /// <returns>See generic implementation of <see cref="GetEnumerator"/>. |
| | | /// </returns> |
| | | IEnumerator IEnumerable.GetEnumerator() { |
| | | return this.GetEnumerator(); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 51a19be087405654c8b4b50c67fa9200 |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | namespace PigeonCoopToolkit.Utillities |
| | | { |
| | | public static class GizmosExtra |
| | | { |
| | | |
| | | public static void GizmosDrawCircle(Vector3 position, Vector3 up, float size, int divisions) |
| | | { |
| | | Vector3 offset = (Quaternion.Euler(90,0,0) * (up* size)) ; |
| | | |
| | | for (int i = 0; i < divisions; i++) |
| | | { |
| | | |
| | | Vector3 newOffset = Quaternion.AngleAxis(360f / divisions, up) * offset; |
| | | Gizmos.DrawLine(position + offset, position + newOffset); |
| | | offset = newOffset; |
| | | } |
| | | } |
| | | |
| | | public static void GizmosDrawArrow(Vector3 from, Vector3 to, float arrowSize) |
| | | { |
| | | Gizmos.DrawLine(from, to); |
| | | |
| | | Vector3 dir = to - from; |
| | | dir = dir.normalized*arrowSize; |
| | | |
| | | Gizmos.DrawLine(to, to - Quaternion.Euler(0, 0, 45)*dir); |
| | | Gizmos.DrawLine(to, to - Quaternion.Euler(0, 0, -45)*dir); |
| | | |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: ac8be081485ba1141bd28334fe9eabec |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| New file |
| | |
| | | namespace PigeonCoopToolkit.Utillities |
| | | { |
| | | [System.Serializable] |
| | | public class Range |
| | | { |
| | | public float Min; |
| | | public float Max; |
| | | |
| | | public bool WithinRange(float value) |
| | | { |
| | | return Min <= value && Max >= value; |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: db4c92c149ebf004a83b3776345ca8d4 |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | namespace PigeonCoopToolkit.Effects.Trails |
| | | { |
| | | [AddComponentMenu("Pigeon Coop Toolkit/Effects/Smoke Plume")] |
| | | public class SmokePlume : TrailRenderer_Base |
| | | { |
| | | public float TimeBetweenPoints = 0.1f; |
| | | public Vector3 ConstantForce = Vector3.up * 0.5f; |
| | | public float RandomForceScale = 0.05f; |
| | | public int MaxNumberOfPoints = 50; |
| | | private float _timeSincePoint; |
| | | |
| | | protected override void Start() |
| | | { |
| | | base.Start(); |
| | | _timeSincePoint = 0; |
| | | } |
| | | |
| | | protected override void OnStartEmit() |
| | | { |
| | | _timeSincePoint = 0; |
| | | } |
| | | |
| | | protected override void Reset() |
| | | { |
| | | base.Reset(); |
| | | TrailData.SizeOverLife = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.5f, 0.2f), new Keyframe(1, 0.2f)); |
| | | TrailData.Lifetime = 6f; |
| | | ConstantForce = Vector3.up*0.5f; |
| | | TimeBetweenPoints = 0.1f; |
| | | RandomForceScale = 0.05f; |
| | | MaxNumberOfPoints = 50; |
| | | } |
| | | |
| | | protected override void Update() |
| | | { |
| | | if (_emit) |
| | | { |
| | | _timeSincePoint += _noDecay ? 0 : Time.deltaTime; |
| | | |
| | | if (_timeSincePoint >= TimeBetweenPoints) |
| | | { |
| | | AddPoint(new SmokeTrailPoint(), _t.position); |
| | | _timeSincePoint = 0; |
| | | } |
| | | } |
| | | |
| | | base.Update(); |
| | | } |
| | | |
| | | protected override void InitialiseNewPoint(PCTrailPoint newPoint) |
| | | { |
| | | ((SmokeTrailPoint)newPoint).RandomVec = Random.onUnitSphere * RandomForceScale; |
| | | } |
| | | |
| | | protected override void UpdateTrail(PCTrail trail, float deltaTime) |
| | | { |
| | | if (_noDecay) |
| | | return; |
| | | |
| | | foreach (PCTrailPoint point in trail.Points) |
| | | { |
| | | point.Position += ConstantForce * deltaTime; |
| | | } |
| | | } |
| | | protected override int GetMaxNumberOfPoints() |
| | | { |
| | | return MaxNumberOfPoints; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: b5748bb800508004a81afe3d7526bcb1 |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 1000 |
| | | icon: {fileID: 2800000, guid: 9c8d55a9e91d98e4e925cd09f877adc5, type: 3} |
| | | userData: |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | namespace PigeonCoopToolkit.Effects.Trails |
| | | { |
| | | [AddComponentMenu("Pigeon Coop Toolkit/Effects/Smoke Trail")] |
| | | public class SmokeTrail : TrailRenderer_Base |
| | | { |
| | | public float MinVertexDistance = 0.1f; |
| | | public int MaxNumberOfPoints = 50; |
| | | private Vector3 _lastPosition; |
| | | private float _distanceMoved; |
| | | public float RandomForceScale = 1; |
| | | |
| | | protected override void Start() |
| | | { |
| | | base.Start(); |
| | | _lastPosition = _t.position; |
| | | } |
| | | |
| | | protected override void Update() |
| | | { |
| | | if (_emit) |
| | | { |
| | | _distanceMoved += Vector3.Distance(_t.position, _lastPosition); |
| | | |
| | | if (_distanceMoved != 0 && _distanceMoved >= MinVertexDistance) |
| | | { |
| | | AddPoint(new SmokeTrailPoint(), _t.position); |
| | | _distanceMoved = 0; |
| | | } |
| | | _lastPosition = _t.position; |
| | | |
| | | } |
| | | |
| | | base.Update(); |
| | | } |
| | | |
| | | protected override void OnStartEmit() |
| | | { |
| | | _lastPosition = _t.position; |
| | | _distanceMoved = 0; |
| | | } |
| | | |
| | | protected override void Reset() |
| | | { |
| | | base.Reset(); |
| | | MinVertexDistance = 0.1f; |
| | | RandomForceScale = 1; |
| | | } |
| | | |
| | | protected override void InitialiseNewPoint(PCTrailPoint newPoint) |
| | | { |
| | | ((SmokeTrailPoint)newPoint).RandomVec = Random.onUnitSphere * RandomForceScale; |
| | | } |
| | | protected override void OnTranslate(Vector3 t) |
| | | { |
| | | _lastPosition += t; |
| | | } |
| | | |
| | | protected override int GetMaxNumberOfPoints() |
| | | { |
| | | return MaxNumberOfPoints; |
| | | } |
| | | } |
| | | |
| | | public class SmokeTrailPoint : PCTrailPoint |
| | | { |
| | | public Vector3 RandomVec; |
| | | |
| | | public override void Update(float deltaTime) |
| | | { |
| | | base.Update(deltaTime); |
| | | Position += RandomVec * deltaTime; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 98335f20237e3de42a9f0b6415312e23 |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 1000 |
| | | icon: {fileID: 2800000, guid: f99224b2104474d47b91284e88f8af87, type: 3} |
| | | userData: |
| New file |
| | |
| | | using PigeonCoopToolkit.Utillities; |
| | | using UnityEngine; |
| | | |
| | | namespace PigeonCoopToolkit.Effects.Trails |
| | | { |
| | | [AddComponentMenu("Pigeon Coop Toolkit/Effects/Smooth Trail")] |
| | | public class SmoothTrail : TrailRenderer_Base |
| | | { |
| | | public float MinControlPointDistance = 0.1f; |
| | | public int MaxControlPoints = 15; |
| | | public int PointsBetweenControlPoints = 4; |
| | | |
| | | private Vector3 _lastPosition; |
| | | private float _distanceMoved; |
| | | private CircularBuffer<ControlPoint> _controlPoints; |
| | | |
| | | private class ControlPoint |
| | | { |
| | | public Vector3 p; |
| | | public Vector3 forward; |
| | | } |
| | | |
| | | protected override void Start() |
| | | { |
| | | base.Start(); |
| | | _lastPosition = _t.position; |
| | | } |
| | | |
| | | protected override void Update() |
| | | { |
| | | if (_emit) |
| | | { |
| | | _distanceMoved += Vector3.Distance(_t.position, _lastPosition); |
| | | |
| | | if (!Mathf.Approximately(_distanceMoved, 0) && _distanceMoved >= MinControlPointDistance) |
| | | { |
| | | AddControlPoint(_t.position); |
| | | _distanceMoved = 0; |
| | | } |
| | | else |
| | | { |
| | | _controlPoints[_controlPoints.Count - 1].p = _t.position; |
| | | |
| | | if (TrailData.UseForwardOverride) |
| | | { |
| | | _controlPoints[_controlPoints.Count - 1].forward = TrailData.ForwardOverrideRelative |
| | | ? _t.TransformDirection(TrailData.ForwardOverride.normalized) |
| | | : TrailData.ForwardOverride.normalized; |
| | | } |
| | | |
| | | } |
| | | |
| | | _lastPosition = _t.position; |
| | | } |
| | | |
| | | base.Update(); |
| | | } |
| | | |
| | | protected override void OnStartEmit() |
| | | { |
| | | _lastPosition = _t.position; |
| | | _distanceMoved = 0; |
| | | _controlPoints = new CircularBuffer<ControlPoint>(MaxControlPoints); |
| | | |
| | | _controlPoints.Add(new ControlPoint { p = _lastPosition }); |
| | | |
| | | if (TrailData.UseForwardOverride) |
| | | { |
| | | _controlPoints[0].forward = TrailData.ForwardOverrideRelative |
| | | ? _t.TransformDirection(TrailData.ForwardOverride.normalized) |
| | | : TrailData.ForwardOverride.normalized; |
| | | } |
| | | |
| | | AddPoint(new PCTrailPoint(), _lastPosition); |
| | | |
| | | AddControlPoint(_lastPosition); |
| | | } |
| | | |
| | | protected override void UpdateTrail(PCTrail trail, float deltaTime) |
| | | { |
| | | if (trail.IsActiveTrail == false) |
| | | return; |
| | | |
| | | //TODO Must optimize this further, I don't need to keep recalculating point positions unless we are |
| | | //dealng with the points between the last and 2nd last CP (+ the last CP itself) |
| | | int trailPointIndex = 0; |
| | | for (int i = 0; i < _controlPoints.Count; i++) |
| | | { |
| | | trail.Points[trailPointIndex].Position = _controlPoints[i].p; |
| | | |
| | | if (TrailData.UseForwardOverride) |
| | | { |
| | | trail.Points[trailPointIndex].Forward = _controlPoints[i].forward; |
| | | } |
| | | |
| | | trailPointIndex++; |
| | | |
| | | if (i < _controlPoints.Count - 1) |
| | | { |
| | | Vector3 Handle1, Handle2; |
| | | float distanceBetween = Vector3.Distance(_controlPoints[i].p, _controlPoints[i + 1].p) / 2; |
| | | if (i == 0) |
| | | { |
| | | Handle1 = _controlPoints[i].p + (_controlPoints[i + 1].p - _controlPoints[i].p).normalized * distanceBetween; |
| | | } |
| | | else |
| | | { |
| | | Handle1 = _controlPoints[i].p + (_controlPoints[i + 1].p - _controlPoints[i - 1].p).normalized * distanceBetween; |
| | | } |
| | | |
| | | int nextI = i + 1; |
| | | |
| | | if (nextI == _controlPoints.Count - 1) |
| | | { |
| | | Handle2 = _controlPoints[nextI].p + (_controlPoints[nextI - 1].p - _controlPoints[nextI].p).normalized * distanceBetween; |
| | | } |
| | | else |
| | | { |
| | | Handle2 = _controlPoints[nextI].p + (_controlPoints[nextI - 1].p - _controlPoints[nextI + 1].p).normalized * distanceBetween; |
| | | } |
| | | |
| | | PCTrailPoint currentHandle = trail.Points[trailPointIndex-1]; |
| | | PCTrailPoint nextHandle = trail.Points[(trailPointIndex-1) + PointsBetweenControlPoints+1]; |
| | | |
| | | |
| | | for (int pointBetween = 0; pointBetween < PointsBetweenControlPoints; pointBetween++) |
| | | { |
| | | float t= (((float)pointBetween + 1f) / ((float)PointsBetweenControlPoints + 1f)); |
| | | trail.Points[trailPointIndex].Position = GetPointAlongCurve(_controlPoints[i].p, Handle1, _controlPoints[i + 1].p, Handle2, t, 0.3f); |
| | | trail.Points[trailPointIndex].SetTimeActive(Mathf.Lerp(currentHandle.TimeActive(), nextHandle.TimeActive(), t)); |
| | | |
| | | if (TrailData.UseForwardOverride) |
| | | { |
| | | trail.Points[trailPointIndex].Forward = Vector3.Lerp(currentHandle.Forward, nextHandle.Forward, t); |
| | | } |
| | | |
| | | |
| | | trailPointIndex++; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | int lastControlPointPointIndex = ((_controlPoints.Count - 1) + ((_controlPoints.Count - 1) * PointsBetweenControlPoints)); |
| | | int prevControlPointPointIndex = lastControlPointPointIndex - PointsBetweenControlPoints - 1; |
| | | int activePointCount = lastControlPointPointIndex + 1; |
| | | |
| | | float distanceFromStart = trail.Points[prevControlPointPointIndex].GetDistanceFromStart(); |
| | | for (int i = prevControlPointPointIndex + 1; i < activePointCount; i++) |
| | | { |
| | | distanceFromStart += Vector3.Distance(trail.Points[i - 1].Position, trail.Points[i].Position); |
| | | trail.Points[i].SetDistanceFromStart(distanceFromStart); |
| | | } |
| | | |
| | | } |
| | | |
| | | protected override void Reset() |
| | | { |
| | | base.Reset(); |
| | | MinControlPointDistance = 0.1f; |
| | | MaxControlPoints = 15; |
| | | PointsBetweenControlPoints = 4; |
| | | } |
| | | |
| | | protected override void OnTranslate(Vector3 t) |
| | | { |
| | | _lastPosition += t; |
| | | |
| | | for (int i = 0; i < _controlPoints.Count; i++) |
| | | _controlPoints[i].p += t; |
| | | } |
| | | |
| | | private void AddControlPoint(Vector3 position) |
| | | { |
| | | for (int i = 0; i < PointsBetweenControlPoints; i++) |
| | | { |
| | | AddPoint(new PCTrailPoint(), position); |
| | | } |
| | | |
| | | AddPoint(new PCTrailPoint(), position); |
| | | |
| | | ControlPoint newCP = new ControlPoint { p = position }; |
| | | |
| | | if (TrailData.UseForwardOverride) |
| | | { |
| | | newCP.forward = TrailData.ForwardOverrideRelative |
| | | ? _t.TransformDirection(TrailData.ForwardOverride.normalized) |
| | | : TrailData.ForwardOverride.normalized; |
| | | } |
| | | |
| | | _controlPoints.Add(newCP); |
| | | } |
| | | |
| | | protected override int GetMaxNumberOfPoints() |
| | | { |
| | | return ((MaxControlPoints) + ((MaxControlPoints) * PointsBetweenControlPoints)); |
| | | } |
| | | |
| | | public Vector3 GetPointAlongCurve(Vector3 curveStart, Vector3 curveStartHandle, Vector3 curveEnd, Vector3 curveEndHandle, float t, float crease) |
| | | { |
| | | float oneMinT = 1 - t; |
| | | float oneMinTPow3 = Mathf.Pow(oneMinT, 3); |
| | | float oneMinTPow2 = Mathf.Pow(oneMinT, 2); |
| | | |
| | | float oneMinCrease = 1 - crease; |
| | | return ((oneMinTPow3 * curveStart * oneMinCrease) + (3 * oneMinTPow2 * t * curveStartHandle * crease) + (3 * oneMinT * Mathf.Pow(t, 2) * curveEndHandle * crease) + |
| | | (Mathf.Pow(t, 3) * curveEnd * oneMinCrease)) |
| | | / |
| | | ((oneMinTPow3 * oneMinCrease) + (3 * oneMinTPow2 * t * crease) + (3 * oneMinT * Mathf.Pow(t, 2) * crease) + |
| | | (Mathf.Pow(t, 3) * oneMinCrease)); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 62cd7e0b3a08cf84e82658d9a3eaeb32 |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 1000 |
| | | icon: {fileID: 2800000, guid: 8d56c6f37ee95884baa3b4f7e4837399, type: 3} |
| | | userData: |
| New file |
| | |
| | | using UnityEngine; |
| | | |
| | | namespace PigeonCoopToolkit.Effects.Trails |
| | | { |
| | | [AddComponentMenu("Pigeon Coop Toolkit/Effects/Trail")] |
| | | public class Trail : TrailRenderer_Base |
| | | { |
| | | public float MinVertexDistance = 0.1f; |
| | | public int MaxNumberOfPoints = 50; |
| | | private Vector3 _lastPosition; |
| | | private float _distanceMoved; |
| | | |
| | | protected override void Start() |
| | | { |
| | | base.Start(); |
| | | _lastPosition = _t.position; |
| | | } |
| | | |
| | | protected override void Update() |
| | | { |
| | | if(_emit) |
| | | { |
| | | _distanceMoved += Vector3.Distance(_t.position, _lastPosition); |
| | | |
| | | if (_distanceMoved != 0 && _distanceMoved >= MinVertexDistance) |
| | | { |
| | | AddPoint(new PCTrailPoint(), _t.position); |
| | | _distanceMoved = 0; |
| | | } |
| | | |
| | | _lastPosition = _t.position; |
| | | |
| | | } |
| | | |
| | | base.Update(); |
| | | } |
| | | |
| | | protected override void OnStartEmit() |
| | | { |
| | | _lastPosition = _t.position; |
| | | _distanceMoved = 0; |
| | | } |
| | | |
| | | protected override void Reset() |
| | | { |
| | | base.Reset(); |
| | | MinVertexDistance = 0.1f; |
| | | } |
| | | |
| | | protected override void OnTranslate(Vector3 t) |
| | | { |
| | | _lastPosition += t; |
| | | } |
| | | |
| | | protected override int GetMaxNumberOfPoints() |
| | | { |
| | | return MaxNumberOfPoints; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 5f742ccbd25717e438dd6fdea4d66bad |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 1000 |
| | | icon: {fileID: 2800000, guid: 888165c9c85ad6b429824b89f1f4f698, type: 3} |
| | | userData: |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using PigeonCoopToolkit.Utillities; |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | namespace PigeonCoopToolkit.Effects.Trails |
| | | { |
| | | public abstract class TrailRenderer_Base : MonoBehaviour |
| | | { |
| | | public PCTrailRendererData TrailData; |
| | | public bool Emit = false; |
| | | |
| | | protected bool _emit; |
| | | protected bool _noDecay; |
| | | |
| | | private PCTrail _activeTrail; |
| | | private List<PCTrail> _fadingTrails; |
| | | protected Transform _t; |
| | | |
| | | |
| | | private static Dictionary<Material, List<PCTrail>> _matToTrailList; |
| | | private static List<Mesh> _toClean; |
| | | |
| | | private static bool _hasRenderer = false; |
| | | private static int GlobalTrailRendererCount = 0; |
| | | |
| | | protected virtual void Awake() |
| | | { |
| | | GlobalTrailRendererCount++; |
| | | |
| | | if(GlobalTrailRendererCount == 1) |
| | | { |
| | | _matToTrailList = new Dictionary<Material, List<PCTrail>>(); |
| | | _toClean = new List<Mesh>(); |
| | | } |
| | | |
| | | |
| | | _fadingTrails = new List<PCTrail>(); |
| | | _t = transform; |
| | | _emit = Emit; |
| | | |
| | | if (_emit) |
| | | { |
| | | _activeTrail = new PCTrail(GetMaxNumberOfPoints()); |
| | | _activeTrail.IsActiveTrail = true; |
| | | OnStartEmit(); |
| | | } |
| | | } |
| | | |
| | | protected virtual void Start() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected virtual void LateUpdate() |
| | | { |
| | | if(_hasRenderer) |
| | | return; |
| | | |
| | | |
| | | _hasRenderer = true; |
| | | |
| | | |
| | | foreach (KeyValuePair<Material, List<PCTrail>> keyValuePair in _matToTrailList) |
| | | { |
| | | CombineInstance[] combineInstances = new CombineInstance[keyValuePair.Value.Count]; |
| | | |
| | | for (int i = 0; i < keyValuePair.Value.Count; i++) |
| | | { |
| | | combineInstances[i] = new CombineInstance |
| | | { |
| | | mesh = keyValuePair.Value[i].Mesh, |
| | | subMeshIndex = 0, |
| | | transform = Matrix4x4.identity |
| | | }; |
| | | } |
| | | |
| | | Mesh combinedMesh = new Mesh(); |
| | | combinedMesh.CombineMeshes(combineInstances, true, false); |
| | | _toClean.Add(combinedMesh); |
| | | |
| | | DrawMesh(combinedMesh, keyValuePair.Key); |
| | | |
| | | keyValuePair.Value.Clear(); |
| | | } |
| | | } |
| | | |
| | | protected virtual void Update() |
| | | { |
| | | if (_hasRenderer) |
| | | { |
| | | _hasRenderer = false; |
| | | |
| | | if (_toClean.Count > 0) |
| | | { |
| | | foreach (Mesh mesh in _toClean) |
| | | { |
| | | if (Application.isEditor) |
| | | DestroyImmediate(mesh, true); |
| | | else |
| | | Destroy(mesh); |
| | | } |
| | | } |
| | | |
| | | _toClean.Clear(); |
| | | |
| | | } |
| | | |
| | | if (_matToTrailList.ContainsKey(TrailData.TrailMaterial) == false) |
| | | { |
| | | _matToTrailList.Add(TrailData.TrailMaterial, new List<PCTrail>()); |
| | | } |
| | | |
| | | |
| | | if(_activeTrail != null) |
| | | { |
| | | UpdatePoints(_activeTrail, Time.deltaTime); |
| | | UpdateTrail(_activeTrail, Time.deltaTime); |
| | | GenerateMesh(_activeTrail); |
| | | _matToTrailList[TrailData.TrailMaterial].Add(_activeTrail); |
| | | } |
| | | |
| | | for (int i = _fadingTrails.Count-1; i >= 0; i--) |
| | | { |
| | | if (_fadingTrails[i] == null || _fadingTrails[i].Points.Any(a => a.TimeActive() < TrailData.Lifetime) == false) |
| | | { |
| | | if (_fadingTrails[i] != null) |
| | | _fadingTrails[i].Dispose(); |
| | | |
| | | _fadingTrails.RemoveAt(i); |
| | | continue; |
| | | } |
| | | |
| | | UpdatePoints(_fadingTrails[i], Time.deltaTime); |
| | | UpdateTrail(_fadingTrails[i], Time.deltaTime); |
| | | GenerateMesh(_fadingTrails[i]); |
| | | _matToTrailList[TrailData.TrailMaterial].Add(_fadingTrails[i]); |
| | | } |
| | | |
| | | CheckEmitChange(); |
| | | } |
| | | |
| | | protected virtual void OnDestroy() |
| | | { |
| | | GlobalTrailRendererCount--; |
| | | |
| | | if(GlobalTrailRendererCount == 0) |
| | | { |
| | | if(_toClean != null && _toClean.Count > 0) |
| | | { |
| | | foreach (Mesh mesh in _toClean) |
| | | { |
| | | if (Application.isEditor) |
| | | DestroyImmediate(mesh, true); |
| | | else |
| | | Destroy(mesh); |
| | | } |
| | | } |
| | | |
| | | _toClean = null; |
| | | _matToTrailList.Clear(); |
| | | _matToTrailList = null; |
| | | } |
| | | |
| | | if (_activeTrail != null) |
| | | { |
| | | _activeTrail.Dispose(); |
| | | _activeTrail = null; |
| | | } |
| | | |
| | | if (_fadingTrails != null) |
| | | { |
| | | foreach (PCTrail fadingTrail in _fadingTrails) |
| | | { |
| | | if (fadingTrail != null) |
| | | fadingTrail.Dispose(); |
| | | } |
| | | |
| | | _fadingTrails.Clear(); |
| | | } |
| | | } |
| | | |
| | | protected virtual void OnStopEmit() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected virtual void OnStartEmit() |
| | | { |
| | | } |
| | | |
| | | protected virtual void OnTranslate(Vector3 t) |
| | | { |
| | | } |
| | | |
| | | protected abstract int GetMaxNumberOfPoints(); |
| | | |
| | | protected virtual void Reset() |
| | | { |
| | | if(TrailData == null) |
| | | TrailData = new PCTrailRendererData(); |
| | | |
| | | TrailData.Lifetime = 1; |
| | | |
| | | TrailData.UsingSimpleColor = false; |
| | | TrailData.UsingSimpleSize = false; |
| | | |
| | | TrailData.ColorOverLife = new Gradient(); |
| | | TrailData.SimpleColorOverLifeStart = Color.white; |
| | | TrailData.SimpleColorOverLifeEnd = new Color(1, 1, 1, 0); |
| | | |
| | | TrailData.SizeOverLife = new AnimationCurve(new Keyframe(0, 1), new Keyframe(1, 0)); |
| | | TrailData.SimpleSizeOverLifeStart = 1; |
| | | TrailData.SimpleSizeOverLifeEnd = 0; |
| | | } |
| | | |
| | | protected virtual void InitialiseNewPoint(PCTrailPoint newPoint) |
| | | { |
| | | |
| | | } |
| | | |
| | | protected virtual void UpdateTrail(PCTrail trail, float deltaTime) |
| | | { |
| | | |
| | | } |
| | | |
| | | protected void AddPoint(PCTrailPoint newPoint, Vector3 pos) |
| | | { |
| | | if (_activeTrail == null) |
| | | return; |
| | | |
| | | newPoint.Position = pos; |
| | | newPoint.PointNumber = _activeTrail.Points.Count == 0 ? 0 : _activeTrail.Points[_activeTrail.Points.Count - 1].PointNumber + 1; |
| | | InitialiseNewPoint(newPoint); |
| | | |
| | | newPoint.SetDistanceFromStart(_activeTrail.Points.Count == 0 |
| | | ? 0 |
| | | : _activeTrail.Points[_activeTrail.Points.Count - 1].GetDistanceFromStart() + Vector3.Distance(_activeTrail.Points[_activeTrail.Points.Count - 1].Position, pos)); |
| | | |
| | | if(TrailData.UseForwardOverride) |
| | | { |
| | | newPoint.Forward = TrailData.ForwardOverrideRelative |
| | | ? _t.TransformDirection(TrailData.ForwardOverride.normalized) |
| | | : TrailData.ForwardOverride.normalized; |
| | | } |
| | | |
| | | _activeTrail.Points.Add(newPoint); |
| | | } |
| | | |
| | | private void GenerateMesh(PCTrail trail) |
| | | { |
| | | trail.Mesh.Clear(false); |
| | | |
| | | Vector3 camForward = Camera.main != null ? Camera.main.transform.forward : Vector3.forward; |
| | | |
| | | if(TrailData.UseForwardOverride) |
| | | { |
| | | camForward = TrailData.ForwardOverride.normalized; |
| | | } |
| | | |
| | | trail.activePointCount = NumberOfActivePoints(trail); |
| | | |
| | | if (trail.activePointCount < 2) |
| | | return; |
| | | |
| | | |
| | | int vertIndex = 0; |
| | | for (int i = 0; i < trail.Points.Count; i++) |
| | | { |
| | | PCTrailPoint p = trail.Points[i]; |
| | | float timeAlong = p.TimeActive()/TrailData.Lifetime; |
| | | |
| | | if(p.TimeActive() > TrailData.Lifetime) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (TrailData.UseForwardOverride && TrailData.ForwardOverrideRelative) |
| | | camForward = p.Forward; |
| | | |
| | | Vector3 cross = Vector3.zero; |
| | | |
| | | if (i < trail.Points.Count - 1) |
| | | { |
| | | cross = |
| | | Vector3.Cross((trail.Points[i + 1].Position - p.Position).normalized, camForward). |
| | | normalized; |
| | | } |
| | | else |
| | | { |
| | | cross = |
| | | Vector3.Cross((p.Position - trail.Points[i - 1].Position).normalized, camForward). |
| | | normalized; |
| | | } |
| | | |
| | | |
| | | //yuck! lets move these into their own functions some time |
| | | Color c = TrailData.StretchColorToFit ? |
| | | (TrailData.UsingSimpleColor ? Color.Lerp(TrailData.SimpleColorOverLifeStart, TrailData.SimpleColorOverLifeEnd, 1 - ((float)vertIndex / (float)trail.activePointCount / 2f)) : TrailData.ColorOverLife.Evaluate(1 - ((float)vertIndex / (float)trail.activePointCount / 2f))) : |
| | | (TrailData.UsingSimpleColor ? Color.Lerp(TrailData.SimpleColorOverLifeStart,TrailData.SimpleColorOverLifeEnd,timeAlong) : TrailData.ColorOverLife.Evaluate(timeAlong)); |
| | | |
| | | float s = TrailData.StretchSizeToFit ? |
| | | (TrailData.UsingSimpleSize ? Mathf.Lerp(TrailData.SimpleSizeOverLifeStart,TrailData.SimpleSizeOverLifeEnd,1 - ((float)vertIndex / (float)trail.activePointCount / 2f)) : TrailData.SizeOverLife.Evaluate(1 - ((float)vertIndex / (float)trail.activePointCount / 2f))) : |
| | | (TrailData.UsingSimpleSize ? Mathf.Lerp(TrailData.SimpleSizeOverLifeStart,TrailData.SimpleSizeOverLifeEnd, timeAlong) : TrailData.SizeOverLife.Evaluate(timeAlong)); |
| | | |
| | | |
| | | trail.verticies[vertIndex] = p.Position + cross * s; |
| | | |
| | | if(TrailData.MaterialTileLength <= 0) |
| | | { |
| | | trail.uvs[vertIndex] = new Vector2((float)vertIndex / (float)trail.activePointCount / 2f, 0); |
| | | } |
| | | else |
| | | { |
| | | trail.uvs[vertIndex] = new Vector2(p.GetDistanceFromStart() / TrailData.MaterialTileLength, 0); |
| | | } |
| | | |
| | | trail.normals[vertIndex] = camForward; |
| | | trail.colors[vertIndex] = c; |
| | | vertIndex++; |
| | | trail.verticies[vertIndex] = p.Position - cross * s; |
| | | |
| | | if (TrailData.MaterialTileLength <= 0) |
| | | { |
| | | trail.uvs[vertIndex] = new Vector2((float)vertIndex / (float)trail.activePointCount / 2f, 1); |
| | | } |
| | | else |
| | | { |
| | | trail.uvs[vertIndex] = new Vector2(p.GetDistanceFromStart() / TrailData.MaterialTileLength, 1); |
| | | } |
| | | |
| | | trail.normals[vertIndex] = camForward; |
| | | trail.colors[vertIndex] = c; |
| | | |
| | | vertIndex++; |
| | | } |
| | | |
| | | Vector2 finalPosition = trail.verticies[vertIndex-1]; |
| | | for(int i = vertIndex; i < trail.verticies.Length; i++) |
| | | { |
| | | trail.verticies[i] = finalPosition; |
| | | } |
| | | |
| | | int indIndex = 0; |
| | | for (int pointIndex = 0; pointIndex < 2 * (trail.activePointCount - 1); pointIndex++) |
| | | { |
| | | if(pointIndex%2==0) |
| | | { |
| | | trail.indicies[indIndex] = pointIndex; |
| | | indIndex++; |
| | | trail.indicies[indIndex] = pointIndex + 1; |
| | | indIndex++; |
| | | trail.indicies[indIndex] = pointIndex + 2; |
| | | } |
| | | else |
| | | { |
| | | trail.indicies[indIndex] = pointIndex + 2; |
| | | indIndex++; |
| | | trail.indicies[indIndex] = pointIndex + 1; |
| | | indIndex++; |
| | | trail.indicies[indIndex] = pointIndex; |
| | | } |
| | | |
| | | indIndex++; |
| | | } |
| | | |
| | | int finalIndex = trail.indicies[indIndex-1]; |
| | | for (int i = indIndex; i < trail.indicies.Length; i++) |
| | | { |
| | | trail.indicies[i] = finalIndex; |
| | | } |
| | | |
| | | trail.Mesh.vertices = trail.verticies; |
| | | trail.Mesh.SetIndices(trail.indicies, MeshTopology.Triangles, 0); |
| | | trail.Mesh.uv = trail.uvs; |
| | | trail.Mesh.normals = trail.normals; |
| | | trail.Mesh.colors = trail.colors; |
| | | } |
| | | |
| | | private void DrawMesh(Mesh trailMesh, Material trailMaterial) |
| | | { |
| | | Graphics.DrawMesh(trailMesh, Matrix4x4.identity, trailMaterial, gameObject.layer); |
| | | } |
| | | |
| | | private void UpdatePoints(PCTrail line, float deltaTime) |
| | | { |
| | | for (int i = 0; i < line.Points.Count; i++) |
| | | { |
| | | line.Points[i].Update(_noDecay ? 0 : deltaTime); |
| | | } |
| | | } |
| | | |
| | | [Obsolete("UpdatePoint is deprecated, you should instead override UpdateTrail and loop through the individual points yourself (See Smoke or Smoke Plume scripts for how to do this).", true)] |
| | | protected virtual void UpdatePoint(PCTrailPoint pCTrailPoint, float deltaTime) |
| | | { |
| | | } |
| | | |
| | | private void CheckEmitChange() |
| | | { |
| | | if (_emit != Emit) |
| | | { |
| | | _emit = Emit; |
| | | if (_emit) |
| | | { |
| | | _activeTrail = new PCTrail(GetMaxNumberOfPoints()); |
| | | _activeTrail.IsActiveTrail = true; |
| | | |
| | | OnStartEmit(); |
| | | } |
| | | else |
| | | { |
| | | OnStopEmit(); |
| | | _activeTrail.IsActiveTrail = false; |
| | | _fadingTrails.Add(_activeTrail); |
| | | _activeTrail = null; |
| | | } |
| | | } |
| | | } |
| | | |
| | | private int NumberOfActivePoints(PCTrail line) |
| | | { |
| | | int count = 0; |
| | | for (int index = 0; index < line.Points.Count; index++) |
| | | { |
| | | if (line.Points[index].TimeActive() < TrailData.Lifetime) count++; |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | [UnityEngine.ContextMenu("Toggle inspector size input method")] |
| | | protected void ToggleSizeInputStyle() |
| | | { |
| | | TrailData.UsingSimpleSize = !TrailData.UsingSimpleSize; |
| | | } |
| | | [UnityEngine.ContextMenu("Toggle inspector color input method")] |
| | | protected void ToggleColorInputStyle() |
| | | { |
| | | TrailData.UsingSimpleColor = !TrailData.UsingSimpleColor; |
| | | } |
| | | |
| | | public void LifeDecayEnabled(bool enabled) |
| | | { |
| | | _noDecay = !enabled; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Translates every point in the vector t |
| | | /// </summary> |
| | | public void Translate(Vector3 t) |
| | | { |
| | | if (_activeTrail != null) |
| | | { |
| | | for (int i = 0; i < _activeTrail.Points.Count; i++) |
| | | { |
| | | _activeTrail.Points[i].Position += t; |
| | | } |
| | | } |
| | | |
| | | if (_fadingTrails != null) |
| | | { |
| | | foreach (PCTrail fadingTrail in _fadingTrails) |
| | | { |
| | | for (int i = 0; i < fadingTrail.Points.Count; i++) |
| | | { |
| | | fadingTrail.Points[i].Position += t; |
| | | } |
| | | } |
| | | } |
| | | |
| | | OnTranslate(t); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Insert a trail into this trail renderer. |
| | | /// </summary> |
| | | /// <param name="from">The start position of the trail.</param> |
| | | /// <param name="to">The end position of the trail.</param> |
| | | /// <param name="distanceBetweenPoints">Distance between each point on the trail</param> |
| | | public void CreateTrail(Vector3 from, Vector3 to, float distanceBetweenPoints) |
| | | { |
| | | float distanceBetween = Vector3.Distance(from, to); |
| | | |
| | | Vector3 dirVector = to - from; |
| | | dirVector = dirVector.normalized; |
| | | |
| | | float currentLength = 0; |
| | | |
| | | CircularBuffer<PCTrailPoint> newLine = new CircularBuffer<PCTrailPoint>(GetMaxNumberOfPoints()); |
| | | int pointNumber = 0; |
| | | while (currentLength < distanceBetween) |
| | | { |
| | | PCTrailPoint newPoint = new PCTrailPoint(); |
| | | newPoint.PointNumber = pointNumber; |
| | | newPoint.Position = from + dirVector*currentLength; |
| | | newLine.Add(newPoint); |
| | | InitialiseNewPoint(newPoint); |
| | | |
| | | pointNumber++; |
| | | |
| | | if (distanceBetweenPoints <= 0) |
| | | break; |
| | | else |
| | | currentLength += distanceBetweenPoints; |
| | | } |
| | | |
| | | PCTrailPoint lastPoint = new PCTrailPoint(); |
| | | lastPoint.PointNumber = pointNumber; |
| | | lastPoint.Position = to; |
| | | newLine.Add(lastPoint); |
| | | InitialiseNewPoint(lastPoint); |
| | | |
| | | PCTrail newTrail = new PCTrail(GetMaxNumberOfPoints()); |
| | | newTrail.Points = newLine; |
| | | |
| | | _fadingTrails.Add(newTrail); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Clears all active trails from the system. |
| | | /// </summary> |
| | | /// <param name="emitState">Desired emit state after clearing</param> |
| | | public void ClearSystem(bool emitState) |
| | | { |
| | | if(_activeTrail != null) |
| | | { |
| | | _activeTrail.Dispose(); |
| | | _activeTrail = null; |
| | | } |
| | | |
| | | if (_fadingTrails != null) |
| | | { |
| | | foreach (PCTrail fadingTrail in _fadingTrails) |
| | | { |
| | | if (fadingTrail != null) |
| | | fadingTrail.Dispose(); |
| | | } |
| | | |
| | | _fadingTrails.Clear(); |
| | | } |
| | | |
| | | Emit = emitState; |
| | | _emit = !emitState; |
| | | |
| | | CheckEmitChange(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Get the number of active seperate trail segments. |
| | | /// </summary> |
| | | public int NumSegments() |
| | | { |
| | | int num = 0; |
| | | if (_activeTrail != null && NumberOfActivePoints(_activeTrail) != 0) |
| | | num++; |
| | | |
| | | num += _fadingTrails.Count; |
| | | return num; |
| | | } |
| | | } |
| | | |
| | | public class PCTrail : System.IDisposable |
| | | { |
| | | public CircularBuffer<PCTrailPoint> Points; |
| | | public Mesh Mesh; |
| | | |
| | | public Vector3[] verticies; |
| | | public Vector3[] normals; |
| | | public Vector2[] uvs; |
| | | public Color[] colors; |
| | | public int[] indicies; |
| | | public int activePointCount; |
| | | |
| | | public bool IsActiveTrail = false; |
| | | |
| | | public PCTrail(int numPoints) |
| | | { |
| | | Mesh = new Mesh(); |
| | | Mesh.MarkDynamic(); |
| | | |
| | | verticies = new Vector3[2 * numPoints]; |
| | | normals = new Vector3[2 * numPoints]; |
| | | uvs = new Vector2[2 * numPoints]; |
| | | colors = new Color[2 * numPoints]; |
| | | indicies = new int[2 * (numPoints) * 3]; |
| | | |
| | | Points = new CircularBuffer<PCTrailPoint>(numPoints); |
| | | } |
| | | |
| | | #region Implementation of IDisposable |
| | | |
| | | public void Dispose() |
| | | { |
| | | if(Mesh != null) |
| | | { |
| | | if(Application.isEditor) |
| | | UnityEngine.Object.DestroyImmediate(Mesh, true); |
| | | else |
| | | UnityEngine.Object.Destroy(Mesh); |
| | | } |
| | | |
| | | Points.Clear(); |
| | | Points = null; |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | public class PCTrailPoint |
| | | { |
| | | public Vector3 Forward; |
| | | public Vector3 Position; |
| | | public int PointNumber; |
| | | |
| | | private float _timeActive = 0; |
| | | private float _distance; |
| | | |
| | | public virtual void Update(float deltaTime) |
| | | { |
| | | _timeActive += deltaTime; |
| | | } |
| | | |
| | | public float TimeActive() |
| | | { |
| | | return _timeActive; |
| | | } |
| | | |
| | | public void SetTimeActive(float time) |
| | | { |
| | | _timeActive = time; |
| | | } |
| | | |
| | | public void SetDistanceFromStart(float distance) |
| | | { |
| | | _distance = distance; |
| | | } |
| | | |
| | | public float GetDistanceFromStart() |
| | | { |
| | | return _distance; |
| | | } |
| | | } |
| | | |
| | | [System.Serializable] |
| | | public class PCTrailRendererData |
| | | { |
| | | public Material TrailMaterial; |
| | | public float Lifetime = 1; |
| | | public bool UsingSimpleSize = false; |
| | | public float SimpleSizeOverLifeStart; |
| | | public float SimpleSizeOverLifeEnd; |
| | | public AnimationCurve SizeOverLife = new AnimationCurve(); |
| | | public bool UsingSimpleColor = false; |
| | | public Color SimpleColorOverLifeStart; |
| | | public Color SimpleColorOverLifeEnd; |
| | | public Gradient ColorOverLife; |
| | | public bool StretchSizeToFit; |
| | | public bool StretchColorToFit; |
| | | public float MaterialTileLength = 0; |
| | | public bool UseForwardOverride; |
| | | public Vector3 ForwardOverride; |
| | | public bool ForwardOverrideRelative; |
| | | } |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 87716fa8801130a4994e129a3b6b2fa6 |
| | | labels: |
| | | - BetterTrails |
| | | - TrailRenderer |
| | | - Smoke |
| | | - Trail |
| | | - Effects |
| | | - skidmarks |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 1000 |
| | | icon: {instanceID: 0} |
| | | userData: |
| New file |
| | |
| | | namespace PigeonCoopToolkit.Generic |
| | | { |
| | | [System.Serializable] |
| | | public class VersionInformation |
| | | { |
| | | public string Name; |
| | | public int Major = 1; |
| | | public int Minor = 0; |
| | | public int Patch = 0; |
| | | |
| | | public VersionInformation(string name, int major, int minor, int patch) |
| | | { |
| | | Name = name; |
| | | Major = major; |
| | | Minor = minor; |
| | | Patch = patch; |
| | | } |
| | | |
| | | public override string ToString() |
| | | { |
| | | return string.Format("{0} {1}.{2}.{3}", Name, Major, Minor, Patch); |
| | | } |
| | | |
| | | public bool Match(VersionInformation other, bool looseMatch) |
| | | { |
| | | if(looseMatch) |
| | | { |
| | | return other.Name == Name && |
| | | other.Major == Major && |
| | | other.Minor == Minor; |
| | | } |
| | | else |
| | | { |
| | | return other.Name == Name && |
| | | other.Major == Major && |
| | | other.Minor == Minor && |
| | | other.Patch == Patch; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1d58a7e753bea0e4c84779d092563363 |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | |
| | | static bool m_PriorAssetDownLoadDone = false;
|
| | | public static bool priorAssetDownLoadDone {
|
| | | get {
|
| | | switch (VersionConfig.Get().assetAccess)
|
| | | if (VersionUtility.Instance.versionInfo != null && VersionUtility.Instance.versionInfo.downAsset == 0) |
| | | { |
| | | return true; |
| | | }
|
| | | else
|
| | | {
|
| | | case InstalledAsset.NullAsset:
|
| | | case InstalledAsset.HalfAsset:
|
| | | case InstalledAsset.FullAsset:
|
| | | return m_PriorAssetDownLoadDone;
|
| | | case InstalledAsset.IngoreDownLoad:
|
| | | return true;
|
| | | default:
|
| | | return true;
|
| | | switch (VersionConfig.Get().assetAccess)
|
| | | {
|
| | | case InstalledAsset.NullAsset:
|
| | | case InstalledAsset.HalfAsset:
|
| | | case InstalledAsset.FullAsset:
|
| | | return m_PriorAssetDownLoadDone;
|
| | | case InstalledAsset.IngoreDownLoad:
|
| | | return true;
|
| | | default:
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | static bool m_UnPriorAssetDownLoadDone = false;
|
| | | public static bool unPriorAssetDownLoadDone {
|
| | | get {
|
| | | switch (VersionConfig.Get().assetAccess)
|
| | | if (VersionUtility.Instance.versionInfo != null && VersionUtility.Instance.versionInfo.downAsset == 0) |
| | | { |
| | | return true; |
| | | }
|
| | | else
|
| | | {
|
| | | case InstalledAsset.NullAsset:
|
| | | case InstalledAsset.HalfAsset:
|
| | | case InstalledAsset.FullAsset:
|
| | | return m_UnPriorAssetDownLoadDone;
|
| | | case InstalledAsset.IngoreDownLoad:
|
| | | return true;
|
| | | default:
|
| | | return true;
|
| | | switch (VersionConfig.Get().assetAccess)
|
| | | {
|
| | | case InstalledAsset.NullAsset:
|
| | | case InstalledAsset.HalfAsset:
|
| | | case InstalledAsset.FullAsset:
|
| | | return m_UnPriorAssetDownLoadDone;
|
| | | case InstalledAsset.IngoreDownLoad:
|
| | | return true;
|
| | | default:
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | path = StringUtility.Contact(ResourcesPath.Instance.StreamingAssetPath, _assetKey);
|
| | | path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, _assetKey);
|
| | | }
|
| | |
|
| | | return path;
|
| | |
| | | |
| | | public static bool IsUnpriorAssetDownLoadOk()
|
| | | {
|
| | | if (VersionUtility.Instance.versionInfo != null && VersionUtility.Instance.versionInfo.downAsset == 0) |
| | | { |
| | | return true; |
| | | }
|
| | |
|
| | | if (VersionConfig.Get().assetAccess == InstalledAsset.IngoreDownLoad)
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | return unPriorAssetDownLoadDone;
|
| | | } |
| | | |
| | | |
| | | }
|
| | |
|
| | |
|
| | | } |
| | |
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | UI3DTreasureExhibition.Instance.StopShow();
|
| | | }
|
| | |
|
| | |
| | | CheckChatFloatOpen();
|
| | | if (win is MainInterfaceWin)
|
| | | {
|
| | | CheckOpenChatAfterCollect();
|
| | | SnxxzGame.Instance.StartCoroutine(Co_CheckAfterCollect());
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | CheckOpenChatAfterCollect();
|
| | | }
|
| | |
|
| | | IEnumerator Co_CheckAfterCollect()
|
| | | {
|
| | | yield return null;
|
| | | CheckOpenChatAfterCollect();
|
| | | }
|
| | |
|
| | | void CheckOpenChatAfterCollect()
|
| | | {
|
| | | if (!openChatAfterCollect)
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | if (!WindowCenter.Instance.Open<MainInterfaceWin>()
|
| | | if (!WindowCenter.Instance.CheckOpen<MainInterfaceWin>()
|
| | | || WindowCenter.Instance.ExitAnyFullScreenOrMaskWin()
|
| | | || StageManager.Instance.isLoading
|
| | | || NewBieCenter.Instance.inGuiding)
|
| | |
| | | {
|
| | | ChatCtrl.Inst.presentChatType = ChatInfoType.Fairy;
|
| | | WindowCenter.Instance.CloseImmediately<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<SocialWin>(false, 2);
|
| | | WindowCenter.Instance.Open<SocialWin>();
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
| | |
|
| | | DTC0102_tagCDBPlayer.switchAccountEvent += SwitchAccountEvent;
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += PlayerLoginOkEvent;
|
| | |
|
| | | InitChatRedpoints();
|
| | |
|
| | | FuncConfigConfig _cfg = Config.Instance.Get<FuncConfigConfig>("RandomWord");
|
| | | try
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void PlayerLoginOkEvent()
|
| | | {
|
| | | UpdateRedpoint(ChatInfoType.Team);
|
| | | UpdateRedpoint(ChatInfoType.Fairy);
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | | {
|
| | | bool isDungeon = StageManager.Instance.CurrentStage is DungeonStage;
|
| | | if (!isDungeon)
|
| | | {
|
| | | ClearAllChatInfo();
|
| | | unReadChatCounts[ChatInfoType.Fairy] = 0;
|
| | | unReadChatCounts[ChatInfoType.Team] = 0;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | ChatData chatData = new ChatFamilyData(vNetData.Content, (int)vNetData.PlayerID, vNetData.Name, vNetData.Extras);
|
| | | KeepChatInfo(chatData);
|
| | | ReceiveNewChat(ChatInfoType.Fairy);
|
| | | }
|
| | | /// <summary>
|
| | | /// 好友私聊
|
| | |
| | | {
|
| | | ChatData chatData = new ChatTeamData(vNetData.Content, (int)vNetData.PlayerID, vNetData.Name, vNetData.Extras);
|
| | | KeepChatInfo(chatData);
|
| | | ReceiveNewChat(ChatInfoType.Team);
|
| | | }
|
| | | /// <summary>
|
| | | /// GM
|
| | |
| | | return string.Empty;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 仙缘红点
|
| | | Dictionary<ChatInfoType, Redpoint> chatSocialRedpoints = new Dictionary<ChatInfoType, Redpoint>();
|
| | | Dictionary<ChatInfoType, int> unReadChatCounts = new Dictionary<ChatInfoType, int>();
|
| | | public void InitChatRedpoints()
|
| | | {
|
| | | chatSocialRedpoints.Add(ChatInfoType.Fairy, new Redpoint(MainRedDot.RedPoint_FriendChatKey, 2502));
|
| | | chatSocialRedpoints.Add(ChatInfoType.Team, new Redpoint(MainRedDot.RedPoint_FriendChatKey, 2503));
|
| | | unReadChatCounts.Add(ChatInfoType.Fairy, 0);
|
| | | unReadChatCounts.Add(ChatInfoType.Team, 0);
|
| | | }
|
| | |
|
| | | public void ViewChat(ChatInfoType type)
|
| | | {
|
| | | if (unReadChatCounts.ContainsKey(type))
|
| | | {
|
| | | unReadChatCounts[type] = 0;
|
| | | UpdateRedpoint(type);
|
| | | }
|
| | | }
|
| | |
|
| | | void ReceiveNewChat(ChatInfoType type)
|
| | | {
|
| | | switch (type)
|
| | | {
|
| | | case ChatInfoType.Team:
|
| | | if (!WindowCenter.Instance.CheckOpen<TeamChatWin>())
|
| | | {
|
| | | unReadChatCounts[ChatInfoType.Team] = Mathf.Min(unReadChatCounts[ChatInfoType.Team] + 1, 99);
|
| | | }
|
| | | break;
|
| | | case ChatInfoType.Fairy:
|
| | | if (!WindowCenter.Instance.CheckOpen<FairyChatWin>())
|
| | | {
|
| | | unReadChatCounts[ChatInfoType.Fairy] = Mathf.Min(unReadChatCounts[ChatInfoType.Fairy] + 1, 99);
|
| | | }
|
| | | break;
|
| | | }
|
| | | UpdateRedpoint(type);
|
| | | }
|
| | |
|
| | | public void UpdateRedpoint(ChatInfoType type)
|
| | | {
|
| | | if (chatSocialRedpoints.ContainsKey(type))
|
| | | {
|
| | | var redpoint = chatSocialRedpoints[type];
|
| | | if (unReadChatCounts[type] > 0)
|
| | | {
|
| | | redpoint.state = RedPointState.Quantity;
|
| | | redpoint.count = unReadChatCounts[type];
|
| | | }
|
| | | else
|
| | | {
|
| | | redpoint.state = RedPointState.None;
|
| | | }
|
| | | }
|
| | | var socialRed = MainRedDot.Instance.redPointFriendChat;
|
| | | if (chatSocialRedpoints[ChatInfoType.Fairy].state == RedPointState.Quantity
|
| | | || chatSocialRedpoints[ChatInfoType.Team].state == RedPointState.Quantity)
|
| | | {
|
| | | socialRed.count = unReadChatCounts[ChatInfoType.Fairy] > 0 ?
|
| | | unReadChatCounts[ChatInfoType.Fairy] : unReadChatCounts[ChatInfoType.Team];
|
| | | }
|
| | | else
|
| | | {
|
| | | socialRed.count = 0;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | | }
|
| | | public struct ChatExtraData
|
| | | {
|
| | |
| | | {
|
| | | ChatCtrl.Inst.presentChatType = ChatInfoType.Fairy;
|
| | | WindowCenter.Instance.CloseImmediately<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<SocialWin>(false, 2);
|
| | | WindowCenter.Instance.Open<SocialWin>();
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<ChatWin>();
|
| | |
| | | {
|
| | | case ChatInfoType.Team:
|
| | | WindowCenter.Instance.CloseImmediately<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<SocialWin>(false, 1);
|
| | | WindowCenter.Instance.Open<SocialWin>(false, 2);
|
| | | break;
|
| | | case ChatInfoType.Fairy:
|
| | | WindowCenter.Instance.CloseImmediately<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<SocialWin>(false, 2);
|
| | | WindowCenter.Instance.Open<SocialWin>();
|
| | | break;
|
| | | default:
|
| | | WindowCenter.Instance.Open<ChatWin>();
|
| | |
| | | [SerializeField] ChatContentBehaviour m_ChatContent;
|
| | | [SerializeField] RectTransform m_ContainerNoFairy;
|
| | | [SerializeField] Button m_JoinFairy;
|
| | |
|
| | | ChatCenter chatCenter { get { return ModelCenter.Instance.GetModel<ChatCenter>(); } }
|
| | |
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | ChatCtrl.Inst.presentChatType = ChatInfoType.Fairy;
|
| | | m_ChatContent.chatType = ChatInfoType.Fairy;
|
| | | MyFairyRefresh();
|
| | | ChatCtrl.Inst.ViewChat(ChatInfoType.Fairy);
|
| | | ChatCtrl.Inst.lockUpdate = false;
|
| | | chatCenter.UpdateChatContentPos();
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | |
| | | [SerializeField] ChatContentBehaviour m_ChatContent;
|
| | | [SerializeField] RectTransform m_NoTeamContainer;
|
| | | TeamModel team { get { return ModelCenter.Instance.GetModel<TeamModel>(); } }
|
| | | ChatCenter chatCenter { get { return ModelCenter.Instance.GetModel<ChatCenter>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | | ChatCtrl.Inst.presentChatType = ChatInfoType.Team;
|
| | | m_ChatContent.chatType = ChatInfoType.Team;
|
| | | MyTeamRefresh();
|
| | | ChatCtrl.Inst.ViewChat(ChatInfoType.Team);
|
| | | ChatCtrl.Inst.lockUpdate = false;
|
| | | chatCenter.UpdateChatContentPos();
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | |
| | | protected override void OnPreOpen()
|
| | | {
|
| | | ComposeModel.ResetModel();
|
| | | if(WindowJumpMgr.Instance.IsJumpState)
|
| | | if(WindowJumpMgr.Instance.IsJumpState && WindowJumpMgr.Instance.jumpType == 1)
|
| | | {
|
| | | if(ComposeModel.CurComposeModel != null)
|
| | | {
|
| | |
| | | {
|
| | | ComposeModel.ResetJumpToModel();
|
| | | selectModel.ClearSelectModel();
|
| | | |
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
|
| | | if (!WindowJumpMgr.Instance.IsJumpState)
|
| | | {
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | |
| | | }
|
| | | if(WindowJumpMgr.Instance.jumpType != 1)
|
| | | {
|
| | | ComposeModel.SetCurComposeModel(null);
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
| | | {
|
| | | [SerializeField] Text m_Title;
|
| | | [SerializeField] RectTransform m_ContainerTimes;
|
| | | [SerializeField] Text m_TimesUnit;
|
| | | [SerializeField] TextEx m_Times;
|
| | | [SerializeField] Text m_PracticePoint;
|
| | | [SerializeField] Text m_UnLockCondition;
|
| | |
| | | else
|
| | | {
|
| | | m_ContainerTimes.gameObject.SetActive(true);
|
| | |
|
| | | switch ((DailyQuestType)this.data.id)
|
| | | {
|
| | | case DailyQuestType.KillMonster:
|
| | | m_TimesUnit.text = Language.Get("DailyQuestMonster");
|
| | | break;
|
| | | default:
|
| | | m_TimesUnit.text = Language.Get("DailyQuestTimes");
|
| | | break;
|
| | | }
|
| | |
|
| | | m_Times.text = StringUtility.Contact(completedTimes, "/", totalTimes);
|
| | | m_Times.colorType = completedTimes >= totalTimes ? TextColType.DarkGreen : TextColType.NavyBrown;
|
| | | }
|
| | |
| | |
|
| | | switch ((DailyQuestType)data.id)
|
| | | {
|
| | | case DailyQuestType.KillMonster:
|
| | | m_PracticePoint.text = Language.Get("DailyQuestPerPoint2", config.OnceActivity, config.OnceActivityTime);
|
| | | break;
|
| | | case DailyQuestType.BlastStove:
|
| | | m_PracticePoint.text = Language.Get("DailyQuestLiandan", config.OnceActivity);
|
| | | break;
|
| | |
| | | for (int i = 0; i < configs.Count; i++)
|
| | | {
|
| | | var config = configs[i];
|
| | | if (config.CanEnter == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (config.StartWeekday == 0 && config.EndWeekday == 0)
|
| | | {
|
| | | for (int j = 0; j < 7; j++)
|
| | |
| | |
|
| | | foreach (var config in configs)
|
| | | {
|
| | | if (config.CanEnter == 0)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | var openDayWeek = config.OpenServerWeek % 7;
|
| | | if (!specialOpenTimes.ContainsKey(openDayWeek))
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public bool IsValidServerOpenTime()
|
| | | {
|
| | | return true;
|
| | |
| | | }
|
| | |
|
| | | var isSpecialDay = TimeUtility.OpenWeekCnt <= 1;
|
| | | var openDayWeek = (int)TimeUtility.openServerTime.DayOfWeek;
|
| | | var openDayWeek = (int)TimeUtility.openServerDayOfWeek;
|
| | | var dayIndex = TimeUtility.OpenDay + 1;
|
| | | if (isSpecialDay && specialOpenTimes.ContainsKey(openDayWeek) && specialOpenTimes[openDayWeek].ContainsKey(dayIndex))
|
| | | if (isSpecialDay)
|
| | | {
|
| | | if (specialOpenTimes.ContainsKey(openDayWeek) && specialOpenTimes[openDayWeek].ContainsKey(dayIndex))
|
| | | {
|
| | |
| | | public bool TryGetTodayNearestOpenTime(out HourMinute _hourMinute)
|
| | | {
|
| | | var isSpecialDay = TimeUtility.OpenWeekCnt <= 1;
|
| | | var openDayWeek = (int)TimeUtility.openServerTime.DayOfWeek;
|
| | | var openDayWeek = (int)TimeUtility.openServerDayOfWeek;
|
| | | var dayIndex = TimeUtility.OpenDay + 1;
|
| | | if (isSpecialDay)
|
| | | {
|
| | |
| | |
|
| | | public bool ContainTimeNode(int week, int timeNode)
|
| | | {
|
| | | var openDayWeek = (int)TimeUtility.openServerTime.DayOfWeek;
|
| | | var openDayWeek = (int)TimeUtility.openServerDayOfWeek;
|
| | |
|
| | | List<HourMinute> hourMinutes = null;
|
| | | var dayDelta = (week == 0 ? 7 : week) - (openDayWeek == 0 ? 7 : openDayWeek);
|
| | |
| | |
|
| | | private bool ContainWeek(int week)
|
| | | {
|
| | | var openDayWeek = (int)TimeUtility.openServerTime.DayOfWeek;
|
| | | var openDayWeek = (int)TimeUtility.openServerDayOfWeek;
|
| | | var todayWeek = (int)TimeUtility.ServerNow.DayOfWeek;
|
| | | var dayDelta = (week == 0 ? 7 : week) - (openDayWeek == 0 ? 7 : openDayWeek);
|
| | |
|
| | |
| | | var isSpecificDay = TimeUtility.OpenWeekCnt <= 1;
|
| | | if (isSpecificDay)
|
| | | {
|
| | | var openDayWeek = (int)TimeUtility.openServerTime.DayOfWeek;
|
| | | var openDayWeek = (int)TimeUtility.openServerDayOfWeek;
|
| | | var todayWeek = (int)TimeUtility.ServerNow.DayOfWeek;
|
| | | var dayDelta = ((week == 0 ? 7 : week) - (todayWeek == 0 ? 7 : todayWeek));
|
| | | var dayIndex = TimeUtility.OpenDay + 1 + dayDelta;
|
| | |
| | | UpdateRedpoints();
|
| | | }
|
| | |
|
| | | public List<int> GetDailyQuests()
|
| | | {
|
| | | return new List<int>(dailyQuests.Keys);
|
| | | }
|
| | |
|
| | | public List<int> GetDailyQuests(DailyQuestCategory _category)
|
| | | {
|
| | | var quests = new List<int>();
|
| | |
| | | private void OnFairyLeagueBattle()
|
| | | {
|
| | | UpdateDailyActionRedpoint((int)DailyQuestType.FairyLeague);
|
| | | }
|
| | |
|
| | | public Dictionary<int, DailyQuestData> GetDailyQuestlist()
|
| | | {
|
| | | return dailyQuests;
|
| | | }
|
| | |
|
| | | public void UpdateRedpoints()
|
| | |
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | PlayerTaskDatas taskModel { get { return ModelCenter.Instance.GetModel<PlayerTaskDatas>(); } }
|
| | | TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
|
| | | MapModel mapModel { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | |
|
| | | public int guidingDailyQuestId = 0;
|
| | |
|
| | |
| | | if (guidingDailyQuestId != 0)
|
| | | {
|
| | | var preferTimeLimit = false;
|
| | | var dailyQuests = model.GetDailyQuestlist();
|
| | | foreach (var quest in dailyQuests.Keys)
|
| | | var dailyQuests = model.GetDailyQuests();
|
| | | foreach (var quest in dailyQuests)
|
| | | {
|
| | | var dailyQuestState = model.GetQuestState(quest);
|
| | | DailyQuestOpenTime openTime;
|
| | |
| | | WindowCenter.Instance.CloseImmediately<DailyQuestWin>();
|
| | | WindowCenter.Instance.Open<PetWin>(false, 2);
|
| | | break;
|
| | | case DailyQuestType.KillMonster:
|
| | | var point = mapModel.GetRecommendHangPoint();
|
| | | var mapEventConfig = Config.Instance.Get<MapEventPointConfig>(point);
|
| | | mapModel.wannaLookLocalMap = mapEventConfig.MapID;
|
| | | WindowCenter.Instance.CloseImmediately<DailyQuestWin>();
|
| | | WindowCenter.Instance.Open<LocalMapWin>();
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | |
| | | public const string OSGIFT_REDPOINT = "OSGitf_Redpoint";
|
| | | public const string TASK_SKILL_HOLE = "TaskSkillHole";
|
| | | public const string RUNE_SPECIAL_HOLE = "RuneSpecialHole";
|
| | | public const string LEAGUE_NOTICE_REDPOINT = "LeagueNoticeRedpoint";
|
| | | public Dictionary<string, int[]> dayRemindDic = new Dictionary<string, int[]>();
|
| | |
|
| | | public bool GetDayRemind(string _remindKey)
|
| | |
| | | SetDayRemind(OSGIFT_REDPOINT);
|
| | | SetDayRemind(TASK_SKILL_HOLE);
|
| | | SetDayRemind(RUNE_SPECIAL_HOLE);
|
| | | SetDayRemind(LEAGUE_NOTICE_REDPOINT);
|
| | | }
|
| | |
|
| | | private void SetDayRemind(string _key)
|
| | |
| | | [SerializeField] ScrollerController m_Controller;
|
| | | [SerializeField] List<DogzSkillData> m_DogzSkills;
|
| | | [SerializeField] List<DogzEquip> m_DogzEquips;
|
| | | [SerializeField] List<Button> m_DogzUnEquipBtns;
|
| | | [SerializeField] List<DogzUnEquip> m_DogzUnEquipBtns;
|
| | | [SerializeField] List<Text> m_PropertyTypes;
|
| | | [SerializeField] List<Text> m_PropertyValues;
|
| | | [SerializeField] Image m_DogzHeadIcon;
|
| | |
| | | [SerializeField] Button m_TakeOffEquipBtn;
|
| | | [SerializeField] Button m_EquipPackBtn;
|
| | | [SerializeField] Button m_CallBackBtn;
|
| | | [SerializeField] RedpointBehaviour assistBtnRedBehav;
|
| | | [SerializeField] Text m_CallBackBtnTxt;
|
| | | [SerializeField] UIEffect alreadyAssistEffect;
|
| | | [SerializeField] UIEffect assistEffect;
|
| | | [SerializeField] UIEffect assistTextEffect;
|
| | | DogzModel m_Model;
|
| | | DogzModel model
|
| | | {
|
| | |
| | | for (int i = 0; i < m_DogzUnEquipBtns.Count; i++)
|
| | | {
|
| | | var _index = i;
|
| | | m_DogzUnEquipBtns[i].onClick.AddListener(() =>
|
| | | m_DogzUnEquipBtns[i].DogzUnEquipBtn.AddListener(() =>
|
| | | {
|
| | | OpenDogzEquip(_index);
|
| | | });
|
| | |
| | | model.UpdateSelectDogzEvent += UpdateSelectDogzEvent;
|
| | | model.UpdateAssistDogzEvent += UpdateDogzAssistCnt;
|
| | | model.RefreshDogzEquipAct += RefreshDogzEquipEvent;
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | }
|
| | | m_Controller.Restart();
|
| | | }
|
| | | int jumpIndex = model.presentSelectDogz - 1 > 0 ? model.presentSelectDogz - 1 : 0;
|
| | | m_Controller.JumpIndex(jumpIndex);
|
| | | }
|
| | | private void UpdateSelectDogzEvent()
|
| | | {
|
| | |
| | | UpdateDogzEquip();
|
| | | UpdateDogzProperty();
|
| | | UpdateDogzBtn();
|
| | | assistBtnRedBehav.redpointId = model.GetDogzAssistRedpointById(model.presentSelectDogz).id;
|
| | | }
|
| | | private void UpdateDogzSkill()
|
| | | {
|
| | |
| | | private void RefreshDogzEquipEvent(int dogzId)
|
| | | {
|
| | | if (dogzId != model.presentSelectDogz) return;
|
| | |
|
| | | m_Controller.m_Scorller.RefreshActiveCellViews();
|
| | | UpdateDogzEquip();
|
| | | UpdateDogzProperty();
|
| | | UpdateDogzBtn();
|
| | |
|
| | | }
|
| | |
|
| | | private void UpdateDogzEquip()
|
| | |
| | | var _dogzCfg = Config.Instance.Get<DogzConfig>(model.presentSelectDogz);
|
| | | m_DogzHeadIcon.SetSprite(_dogzCfg.HeadIcon);
|
| | | m_DogzHeadIcon.SetNativeSize();
|
| | | var _dogzEquips = model.GetDogzEquips(model.presentSelectDogz);
|
| | | alreadyAssistEffect.Stop();
|
| | | if (_dogzEquips != null && _dogzEquips.Count == 5)
|
| | | {
|
| | | m_DogzHeadIcon.material = MaterialUtility.GetUIDefaultGraphicMaterial();
|
| | | if(model.TryGetAssistDogzState(model.presentSelectDogz))
|
| | | {
|
| | | if(!alreadyAssistEffect.IsPlaying)
|
| | | {
|
| | | alreadyAssistEffect.Play();
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | m_DogzHeadIcon.material = MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | }
|
| | |
|
| | | for (int i = 0; i < m_DogzEquips.Count; i++)
|
| | | {
|
| | | ItemModel _data;
|
| | | bool _equiped = model.TryGetDogzEquip(model.presentSelectDogz, i+101, out _data);
|
| | | m_DogzUnEquipBtns[i].gameObject.SetActive(!_equiped);
|
| | | m_DogzUnEquipBtns[i].DogzUnEquipBtn.gameObject.SetActive(!_equiped);
|
| | | m_DogzUnEquipBtns[i].RedpointBeh.redpointId = model.GetDogzEquipPlaceRedpointById(model.presentSelectDogz,i).id;
|
| | | m_DogzEquips[i].gameObject.SetActive(_equiped);
|
| | | if (_equiped)
|
| | | {
|
| | |
| | | {
|
| | | m_PropertyTypes[i].gameObject.SetActive(i < _dogzCfg.BaseAttrTypes.Length);
|
| | | m_PropertyValues[i].gameObject.SetActive(i < _dogzCfg.BaseAttrTypes.Length);
|
| | | string addAttrStr = "";
|
| | | string baseAttrStr = "";
|
| | | if (i < _dogzCfg.BaseAttrTypes.Length)
|
| | | {
|
| | | var _propertyCfg = Config.Instance.Get<PlayerPropertyConfig>(_dogzCfg.BaseAttrTypes[i]);
|
| | | m_PropertyTypes[i].text = _propertyCfg.Name;
|
| | | int attrValue = _dogzCfg.BaseAttrValues[i];
|
| | |
|
| | | if (isAddAttr && model.m_DogzEquipAttrDict[_propertyCfg.ID] > 0)
|
| | | {
|
| | | m_PropertyValues[i].text = StringUtility.Contact(UIHelper.ReplacePercentage(_dogzCfg.BaseAttrValues[i], _propertyCfg.ISPercentage)
|
| | | , _propertyCfg.ISPercentage == 1 ? "%" : string.Empty,"+",UIHelper.ReplacePercentage(model.m_DogzEquipAttrDict[_propertyCfg.ID], _propertyCfg.ISPercentage)
|
| | | |
| | | baseAttrStr = StringUtility.Contact(UIHelper.ReplacePercentage(_dogzCfg.BaseAttrValues[i], _propertyCfg.ISPercentage)
|
| | | , _propertyCfg.ISPercentage == 1 ? "%" : string.Empty);
|
| | |
|
| | | addAttrStr = StringUtility.Contact("+", UIHelper.ReplacePercentage(model.m_DogzEquipAttrDict[_propertyCfg.ID], _propertyCfg.ISPercentage)
|
| | | , _propertyCfg.ISPercentage == 1 ? "%" : string.Empty);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_PropertyValues[i].text = StringUtility.Contact(UIHelper.ReplacePercentage(_dogzCfg.BaseAttrValues[i], _propertyCfg.ISPercentage)
|
| | | baseAttrStr = StringUtility.Contact(UIHelper.ReplacePercentage(_dogzCfg.BaseAttrValues[i], _propertyCfg.ISPercentage)
|
| | | , _propertyCfg.ISPercentage == 1 ? "%" : string.Empty);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | if(model.TryGetAssistDogzState(model.presentSelectDogz))
|
| | | {
|
| | | m_PropertyTypes[i].material = MaterialUtility.GetUIDefaultGraphicMaterial();
|
| | | m_PropertyValues[i].material = MaterialUtility.GetUIDefaultGraphicMaterial();
|
| | | m_PropertyTypes[i].color = UIHelper.s_NavyBrown;
|
| | | if(addAttrStr != "")
|
| | | {
|
| | | m_PropertyValues[i].text = StringUtility.Contact("<color=#401c06>", baseAttrStr, "</color>", "<color=#109d06>", addAttrStr, "</color>");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_PropertyValues[i].text = StringUtility.Contact("<color=#401c06>", baseAttrStr, "</color>");
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | m_PropertyTypes[i].material = MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | m_PropertyValues[i].material = MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | m_PropertyTypes[i].color = UIHelper.s_BrightWhiteColor;
|
| | | if (addAttrStr != "")
|
| | | {
|
| | | m_PropertyValues[i].text = StringUtility.Contact("<color=#686868>", baseAttrStr, "</color>", "<color=#109d06>", addAttrStr, "</color>");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_PropertyValues[i].text = StringUtility.Contact("<color=#686868>", baseAttrStr, "</color>");
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateDogzAssistCnt()
|
| | | {
|
| | | m_Controller.m_Scorller.RefreshActiveCellViews();
|
| | | m_DogzAssistCnt.text = Language.Get("TreasurePrivilege_Dogz_1", StringUtility.Contact(model.GetAssistDogzCount(), "/", model.DogzAssistDefaultCnt));
|
| | | UpdateDogzBtn();
|
| | | UpdateDogzProperty();
|
| | | UpdateDogzEquip();
|
| | | }
|
| | |
|
| | | private void UpdateDogzBtn()
|
| | | {
|
| | | var _dogzEquips = model.GetDogzEquips(model.presentSelectDogz);
|
| | |
| | | {
|
| | | if(model.GetAssistDogzCount() < model.DogzAssistDefaultCnt)
|
| | | {
|
| | | assistEffect.Play();
|
| | | assistTextEffect.Play();
|
| | | model.SendChangeDogzAssist(1);
|
| | | }
|
| | | else
|
| | |
| | | [SerializeField] Button m_SkillBtn;
|
| | | public Button SkillBtn { get { return m_SkillBtn; } }
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public class DogzUnEquip
|
| | | {
|
| | | [SerializeField] Button m_DogzUnEquipBtn;
|
| | | public Button DogzUnEquipBtn { get { return m_DogzUnEquipBtn; } }
|
| | | [SerializeField] RedpointBehaviour m_RedpointBeh;
|
| | | public RedpointBehaviour RedpointBeh { get { return m_RedpointBeh; } }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | [SerializeField] Text m_DogzName;
|
| | | [SerializeField] Text m_DogzGrade;
|
| | | [SerializeField] Button m_DogzBtn;
|
| | | [SerializeField] RedpointBehaviour redpointBehav;
|
| | |
|
| | | DogzModel m_Model;
|
| | | DogzModel model
|
| | |
| | | bool isActive = (_dogzEquips == null || _dogzEquips.Count < 5) ? false : true;
|
| | | m_DogzName.text = _dogzCfg.Name;
|
| | | m_DogzGrade.text = StringUtility.Contact("评分:", 100);
|
| | | redpointBehav.redpointId = model.GetSingleDogzRedpointById(_dogzCfg.ID).id;
|
| | | if (isActive)
|
| | | {
|
| | | m_DogzIcon.material = MaterialUtility.GetUIDefaultGraphicMaterial();
|
| | |
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | | SetDogzAndEquipPlaceRedKey();
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | SetDogzEquipInfo();
|
| | | playerPack.RefreshItemCountAct -= RefreshDogzEquipInfo;
|
| | | playerPack.RefreshItemCountAct += RefreshDogzEquipInfo;
|
| | | UpdateDogzAssistRed();
|
| | | UpdateDogzEquipPlaceRed();
|
| | | UpdateAssistNumRed();
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | switch (_index)
|
| | | {
|
| | | case 0:
|
| | | return "兽角";
|
| | | return Language.Get("DogzEquip1");
|
| | | case 1:
|
| | | return "魔眼";
|
| | | return Language.Get("DogzEquip2");
|
| | | case 2:
|
| | | return "獠牙";
|
| | | return Language.Get("DogzEquip3");
|
| | | case 3:
|
| | | return "兽爪";
|
| | | return Language.Get("DogzEquip4");
|
| | | case 4:
|
| | | return "鳞甲";
|
| | | return Language.Get("DogzEquip5");
|
| | | default:
|
| | | return string.Empty;
|
| | | }
|
| | |
| | | {
|
| | | case 0:
|
| | | case 1:
|
| | | return "白色";
|
| | | return Language.Get("DogzWhite");
|
| | | case 2:
|
| | | return "蓝色";
|
| | | return Language.Get("DogzBlue");
|
| | | case 3:
|
| | | return "紫色";
|
| | | return Language.Get("DogzPurple");
|
| | | case 4:
|
| | | return "橙色";
|
| | | return Language.Get("DogzOrange");
|
| | | case 5:
|
| | | return "红色";
|
| | | return Language.Get("DogzRed");
|
| | | case 6:
|
| | | return Language.Get("DogzPink");
|
| | | default:
|
| | | return string.Empty;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public event Action<int> OpenFuncEvent;
|
| | | public void OpenDogzFuncEvent(int functionOrder)
|
| | | public event Action<int,int> OpenFuncEvent;
|
| | | public void OpenDogzFuncEvent(int functionOrder,int equipIndex)
|
| | | {
|
| | | if(OpenFuncEvent != null)
|
| | | {
|
| | | OpenFuncEvent(functionOrder);
|
| | | OpenFuncEvent(functionOrder,equipIndex);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool CheckIsAddAssistNum()
|
| | | {
|
| | | var _itemConfig = Config.Instance.Get<ItemConfig>(AddAssistItem);
|
| | | if(GetAssistItemCnt() <= playerPack.GetItemCountByID(PackType.rptItem, AddAssistItem))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | #region 协议
|
| | |
| | | {
|
| | | UpdateAssistDogzEvent();
|
| | | }
|
| | | UpdateDogzAssistRed();
|
| | | UpdateDogzEquipPlaceRed();
|
| | | }
|
| | |
|
| | | public event Action UpdateAssistDogzEvent;
|
| | |
| | | {
|
| | | UpdateAssistDogzEvent();
|
| | | }
|
| | |
|
| | | UpdateDogzAssistRed();
|
| | | UpdateDogzEquipPlaceRed();
|
| | | }
|
| | |
|
| | | public int GetAssistDogzCount()
|
| | |
| | |
|
| | | public void SetDogzEquipInfo()
|
| | | {
|
| | | m_DogzEquipDict = new Dictionary<int, List<ItemModel>>();
|
| | | m_DogzEquipDict.Clear();
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptDogzEquip);
|
| | | if (singlePack == null) return;
|
| | |
|
| | |
| | | public Action<int> RefreshDogzEquipAct;
|
| | | private void RefreshDogzEquipInfo(PackType type, int index, int id)
|
| | | {
|
| | | if (type != PackType.rptDogzEquip) return;
|
| | |
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(type, index);
|
| | | int dogzId = GetDogzIDByIndex(index);
|
| | | List<ItemModel> modellist = GetDogzEquips(dogzId);
|
| | | if(modellist != null)
|
| | | if(type == PackType.rptItem && id == AddAssistItem)
|
| | | {
|
| | | if (itemModel != null)
|
| | | UpdateAssistNumRed();
|
| | | }
|
| | | else if(type == PackType.rptDogzItem)
|
| | | {
|
| | | UpdateDogzAssistRed();
|
| | | UpdateDogzEquipPlaceRed();
|
| | | }
|
| | | else if(type == PackType.rptDogzEquip)
|
| | | {
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(type, index);
|
| | | int dogzId = GetDogzIDByIndex(index);
|
| | | List<ItemModel> modellist = GetDogzEquips(dogzId);
|
| | | if (modellist != null)
|
| | | {
|
| | | bool isAdd = true;
|
| | | for (int i = 0; i < modellist.Count; i++)
|
| | | if (itemModel != null)
|
| | | {
|
| | | if (modellist[i].itemInfo.ItemPlace == index)
|
| | | bool isAdd = true;
|
| | | for (int i = 0; i < modellist.Count; i++)
|
| | | {
|
| | | isAdd = false;
|
| | | modellist[i] = itemModel;
|
| | | break;
|
| | | if (modellist[i].itemInfo.ItemPlace == index)
|
| | | {
|
| | | isAdd = false;
|
| | | modellist[i] = itemModel;
|
| | | break;
|
| | | }
|
| | | }
|
| | | if (isAdd)
|
| | | {
|
| | | modellist.Add(itemModel);
|
| | | }
|
| | | }
|
| | | if(isAdd)
|
| | | else
|
| | | {
|
| | | modellist.Add(itemModel);
|
| | | for (int i = 0; i < modellist.Count; i++)
|
| | | {
|
| | | if (modellist[i].itemInfo.ItemPlace == index)
|
| | | {
|
| | | modellist.RemoveAt(i);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | for (int i = 0; i < modellist.Count; i++)
|
| | | if (itemModel != null)
|
| | | {
|
| | | if (modellist[i].itemInfo.ItemPlace == index)
|
| | | {
|
| | | modellist.RemoveAt(i);
|
| | | break;
|
| | | }
|
| | | List<ItemModel> equipDatas = new List<ItemModel>();
|
| | | equipDatas.Add(itemModel);
|
| | | m_DogzEquipDict.Add(dogzId, equipDatas);
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if(itemModel != null)
|
| | | {
|
| | | List<ItemModel> equipDatas = new List<ItemModel>();
|
| | | equipDatas.Add(itemModel);
|
| | | m_DogzEquipDict.Add(dogzId,equipDatas);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if(RefreshDogzEquipAct != null)
|
| | | {
|
| | | RefreshDogzEquipAct(dogzId);
|
| | | if (RefreshDogzEquipAct != null)
|
| | | {
|
| | | RefreshDogzEquipAct(dogzId);
|
| | | }
|
| | |
|
| | | UpdateDogzAssistRed();
|
| | | UpdateDogzEquipPlaceRed();
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 获得神兽穿戴的装备数据
|
| | | /// </summary>
|
| | | public Dictionary<int, List<ItemModel>> m_DogzEquipDict { get; private set; }
|
| | | private Dictionary<int, List<ItemModel>> m_DogzEquipDict = new Dictionary<int, List<ItemModel>>();
|
| | |
|
| | | public List<ItemModel> GetDogzEquips(int _dogzId)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | public List<ItemModel> selectEquipPlacelist { get; private set; }
|
| | | public List<ItemModel> GetDogzItemListByIndex(int index)
|
| | | public List<ItemModel> GetDogzItemListByIndex(int dogzId,int index)
|
| | | {
|
| | | SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptDogzItem);
|
| | | selectEquipPlacelist.Clear();
|
| | | if (singlePack == null) return selectEquipPlacelist;
|
| | |
|
| | | var _itemColor = GetDogzEquipLimitByIndex(presentSelectDogz, index);
|
| | | var _itemColor = GetDogzEquipLimitByIndex(dogzId, index);
|
| | | var _equipPlace = GetDogzEquipPlaceByIndex(index);
|
| | | Dictionary<int, ItemModel> pairs = singlePack.GetPackModelIndexDict();
|
| | | foreach (var value in pairs.Values)
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 装备详细信息
|
| | | public DogzEquipData viewDetailData { get; private set; }
|
| | |
|
| | | public bool viewDetailCompare { get; private set; }
|
| | |
|
| | | public void ViewDetail(int _itemId, bool compare = false)
|
| | | {
|
| | | //viewDetailData = new DogzEquipData(_itemId);
|
| | | //viewDetailCompare = compare;
|
| | | //if (!WindowCenter.Instance.CheckOpen<DogzDetailsWin>())
|
| | | //{
|
| | | // WindowCenter.Instance.Open<DogzDetailsWin>();
|
| | | //}
|
| | | }
|
| | |
|
| | | public int DogzEquipScore(DogzEquipData data)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 默认选择逻辑处理
|
| | | public void SetDefaultSelectDogz()
|
| | | {
|
| | | var configs = Config.Instance.GetAllValues<DogzConfig>();
|
| | | presentSelectDogz = configs[0].ID;
|
| | | foreach (var key in dogzAssistStateDict.Keys)
|
| | | foreach (var key in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | if(dogzAssistStateDict[key] == 1)
|
| | | Redpoint redpoint = GetSingleDogzRedpointById(key);
|
| | | if (redpoint.state == RedPointState.Simple)
|
| | | {
|
| | | if(presentSelectDogz < key)
|
| | | presentSelectDogz = key;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 红点逻辑处理
|
| | | public const int MAINDOGZ_REDKEY = 112;
|
| | | public const int DOGZFUNC_REDKEY = 11201;
|
| | | public const int ADDASSISTDOGZ_REDKEY = 1120100002;
|
| | | public Redpoint mainDogzRedpoint = new Redpoint(MainRedDot.RedPoint_key, MAINDOGZ_REDKEY);
|
| | | public Redpoint dogzFuncRedpoint = new Redpoint(MAINDOGZ_REDKEY,DOGZFUNC_REDKEY);
|
| | | public Redpoint addAssistDogzRedpoint = new Redpoint(DOGZFUNC_REDKEY,ADDASSISTDOGZ_REDKEY);
|
| | | private Dictionary<int, Redpoint> singleDogzRedDict = new Dictionary<int, Redpoint>();
|
| | | private Dictionary<int, Redpoint> dogzAssistRedDict = new Dictionary<int, Redpoint>();
|
| | | private Dictionary<int, Dictionary<int, Redpoint>> dogzEquipPlaceRedDict = new Dictionary<int, Dictionary<int, Redpoint>>();
|
| | | public void SetDogzAndEquipPlaceRedKey()
|
| | | {
|
| | | singleDogzRedDict.Clear();
|
| | | dogzEquipPlaceRedDict.Clear();
|
| | | dogzAssistRedDict.Clear();
|
| | | int i = 0;
|
| | | foreach(var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | i += 1;
|
| | | int dogzRedKey = DOGZFUNC_REDKEY * 100 + i;
|
| | | Redpoint dogzRedPoint = new Redpoint(DOGZFUNC_REDKEY,dogzRedKey);
|
| | | singleDogzRedDict.Add(dogzId, dogzRedPoint);
|
| | | int dogzAssistRedKey = dogzRedKey * 100 + i;
|
| | | Redpoint dogzAssistRedPoint = new Redpoint(dogzRedKey, dogzAssistRedKey);
|
| | | dogzAssistRedDict.Add(dogzId,dogzAssistRedPoint);
|
| | | Dictionary<int, Redpoint> equipPlaceRedDict = new Dictionary<int, Redpoint>();
|
| | | dogzEquipPlaceRedDict.Add(dogzId,equipPlaceRedDict);
|
| | | int equipPlaceNum = m_DogzEquipLimit[dogzId].Count;
|
| | | for (int j = 0; j < equipPlaceNum; j++)
|
| | | {
|
| | | int equipPlaceRedKey = dogzRedKey * 10 + j;
|
| | | Redpoint equipPlaceRedpoint = new Redpoint(dogzRedKey,equipPlaceRedKey);
|
| | | equipPlaceRedDict.Add(j, equipPlaceRedpoint);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | public Redpoint GetSingleDogzRedpointById(int dogzId)
|
| | | {
|
| | | Redpoint redpoint = null;
|
| | | singleDogzRedDict.TryGetValue(dogzId, out redpoint);
|
| | | return redpoint;
|
| | | }
|
| | |
|
| | | public Redpoint GetDogzAssistRedpointById(int dogzId)
|
| | | {
|
| | | Redpoint redpoint = null;
|
| | | dogzAssistRedDict.TryGetValue(dogzId,out redpoint);
|
| | | return redpoint;
|
| | | }
|
| | |
|
| | | public Redpoint GetDogzEquipPlaceRedpointById(int dogzId,int index)
|
| | | {
|
| | | Redpoint redpoint = null;
|
| | | if(dogzEquipPlaceRedDict.ContainsKey(dogzId))
|
| | | {
|
| | | dogzEquipPlaceRedDict[dogzId].TryGetValue(index, out redpoint);
|
| | | }
|
| | | return redpoint;
|
| | | }
|
| | |
|
| | | public void UpdateDogzAssistRed()
|
| | | {
|
| | | foreach(var value in dogzAssistRedDict.Values)
|
| | | {
|
| | | value.state = RedPointState.None;
|
| | | }
|
| | | bool isMaxAssistNum = GetAssistDogzCount() >= DogzAssistDefaultCnt ? true : false;
|
| | | if(!isMaxAssistNum)
|
| | | {
|
| | | int maxDogzId = 0;
|
| | | foreach(var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | var equips = GetDogzEquips(dogzId);
|
| | | int equipNum = equips == null ? 0 : equips.Count;
|
| | | if(equipNum >= 5 && maxDogzId < dogzId
|
| | | && !TryGetAssistDogzState(dogzId))
|
| | | {
|
| | | presentSelectDogz = key;
|
| | | maxDogzId = dogzId;
|
| | | }
|
| | | }
|
| | | if(maxDogzId > 0)
|
| | | {
|
| | | Redpoint assistRedpoint = GetDogzAssistRedpointById(maxDogzId);
|
| | | if(assistRedpoint.state == RedPointState.None)
|
| | | {
|
| | | assistRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | var equips = GetDogzEquips(dogzId);
|
| | | int equipNum = equips == null ? 0 : equips.Count;
|
| | | if(!TryGetAssistDogzState(dogzId) && equipNum == 5)
|
| | | {
|
| | | Redpoint assistRedpoint = GetDogzAssistRedpointById(dogzId);
|
| | | if (assistRedpoint.state == RedPointState.None)
|
| | | {
|
| | | assistRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateDogzEquipPlaceRed()
|
| | | {
|
| | | foreach(var value in dogzEquipPlaceRedDict.Values)
|
| | | {
|
| | | foreach(var value2 in value.Values)
|
| | | {
|
| | | value2.state = RedPointState.None;
|
| | | }
|
| | | }
|
| | |
|
| | | foreach(var value in dogzAssistRedDict.Values)
|
| | | {
|
| | | if(value.state == RedPointState.Simple)
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | | bool isMaxAssistNum = GetAssistDogzCount() >= DogzAssistDefaultCnt ? true : false;
|
| | | if (!isMaxAssistNum)
|
| | | {
|
| | | int maxEquipNum = 0;
|
| | | int spaceDogzId = 0;
|
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | var equips = GetDogzEquips(dogzId);
|
| | | int equipNum = equips == null ? 0 : equips.Count;
|
| | | if (equipNum < 5)
|
| | | {
|
| | | if (spaceDogzId == 0)
|
| | | {
|
| | | if (maxEquipNum <= equipNum)
|
| | | {
|
| | | maxEquipNum = equipNum;
|
| | | spaceDogzId = dogzId;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (maxEquipNum < equipNum)
|
| | | {
|
| | | maxEquipNum = equipNum;
|
| | | spaceDogzId = dogzId;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if(spaceDogzId != 0)
|
| | | {
|
| | | for(int i = 0; i < 5; i++)
|
| | | {
|
| | | ItemModel _data;
|
| | | bool _equiped = TryGetDogzEquip(spaceDogzId, i + 101, out _data);
|
| | | if(!_equiped)
|
| | | {
|
| | | GetDogzItemListByIndex(spaceDogzId,i);
|
| | | if (selectEquipPlacelist.Count > 0)
|
| | | {
|
| | | Redpoint equipPlaceRedpoint = GetDogzEquipPlaceRedpointById(spaceDogzId,i);
|
| | | if(equipPlaceRedpoint.state == RedPointState.None)
|
| | | {
|
| | | equipPlaceRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | int minAlreadyAssistId = 0;
|
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | if(TryGetAssistDogzState(dogzId)
|
| | | && minAlreadyAssistId != 0
|
| | | && minAlreadyAssistId < dogzId)
|
| | | {
|
| | | minAlreadyAssistId = dogzId;
|
| | | }
|
| | | }
|
| | |
|
| | | foreach (var dogzId in m_DogzEquipLimit.Keys)
|
| | | {
|
| | | var equips = GetDogzEquips(dogzId);
|
| | | int equipNum = equips == null ? 0 : equips.Count;
|
| | | bool isBetterDogz = true;
|
| | | if(!TryGetAssistDogzState(dogzId) && dogzId > minAlreadyAssistId && equipNum < 5)
|
| | | {
|
| | | for (int i = 0; i < 5; i++)
|
| | | {
|
| | | ItemModel _data;
|
| | | bool _equiped = TryGetDogzEquip(dogzId, i + 101, out _data);
|
| | | if (!_equiped)
|
| | | {
|
| | | GetDogzItemListByIndex(dogzId,i);
|
| | | if (selectEquipPlacelist.Count < 1)
|
| | | {
|
| | | isBetterDogz = false;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | isBetterDogz = false;
|
| | | }
|
| | |
|
| | | if(isBetterDogz)
|
| | | {
|
| | | for (int i = 0; i < 5; i++)
|
| | | {
|
| | | ItemModel _data;
|
| | | bool _equiped = TryGetDogzEquip(dogzId, i + 101, out _data);
|
| | | if (!_equiped)
|
| | | {
|
| | | Redpoint equipPlaceRedpoint = GetDogzEquipPlaceRedpointById(dogzId, i);
|
| | | if (equipPlaceRedpoint.state == RedPointState.None)
|
| | | {
|
| | | equipPlaceRedpoint.state = RedPointState.Simple;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateAssistNumRed()
|
| | | {
|
| | | if(CheckIsAddAssistNum())
|
| | | {
|
| | | if(addAssistDogzRedpoint.state == RedPointState.None)
|
| | | {
|
| | | addAssistDogzRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | addAssistDogzRedpoint.state = RedPointState.None;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | |
| | | public class DogzPackWin : Window
|
| | | {
|
| | | [SerializeField] List<DogzEquip> m_DogzEquips;
|
| | | [SerializeField] List<Button> m_DogzUnEquipBtns;
|
| | | [SerializeField] List<DogzUnEquip> m_DogzUnEquipBtns;
|
| | | [SerializeField] List<Text> m_DogzUnEquipContents;
|
| | | [SerializeField] Image m_DogzHeadIcon;
|
| | | [SerializeField] Button m_CloseBtn;
|
| | |
| | | [SerializeField] ScrollerController m_PackController;
|
| | | [SerializeField] Button qualitySelectBtn;
|
| | | [SerializeField] Button starSelectBtn;
|
| | | [SerializeField] Transform qualityArrow;
|
| | | [SerializeField] Transform starArrow;
|
| | | [SerializeField] SortTable qualitySort;
|
| | | [SerializeField] SortTable starSort;
|
| | |
|
| | |
| | | playerPack.RefreshItemCountAct += RefreshDogzItemEvent;
|
| | | qualitySort.onSelectSortEvent += RefreshDogzSelectEvent;
|
| | | starSort.onSelectSortEvent += RefreshDogzSelectEvent;
|
| | | qualitySort.onSortCloseEvent += CloseQualitySort;
|
| | | starSort.onSortCloseEvent += CloseStarSort;
|
| | | dogzModel.SelectDogzItemQuality = 0;
|
| | | dogzModel.SelectDogzItemStart = 0;
|
| | |
|
| | | starSort.SetDefault();
|
| | | qualitySort.SetDefault();
|
| | | UpdateDogzEquip();
|
| | | UpdateDogzPack();
|
| | | starSort.gameObject.SetActive(false);
|
| | | qualitySort.gameObject.SetActive(false);
|
| | | starArrow.localRotation = Quaternion.Euler(0, 0, 180);
|
| | | qualityArrow.localRotation = Quaternion.Euler(0, 0, 180);
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | playerPack.RefreshItemCountAct -= RefreshDogzItemEvent;
|
| | | qualitySort.onSelectSortEvent -= RefreshDogzSelectEvent;
|
| | | starSort.onSelectSortEvent -= RefreshDogzSelectEvent;
|
| | | qualitySort.onSortCloseEvent -= CloseQualitySort;
|
| | | starSort.onSortCloseEvent -= CloseStarSort;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | ItemModel _data;
|
| | | int index = i;
|
| | | bool _equiped = dogzModel.TryGetDogzEquip(dogzModel.presentSelectDogz, i+101, out _data);
|
| | | m_DogzUnEquipBtns[i].gameObject.SetActive(!_equiped);
|
| | | m_DogzUnEquipBtns[i].DogzUnEquipBtn.gameObject.SetActive(!_equiped);
|
| | | m_DogzUnEquipBtns[i].RedpointBeh.redpointId = dogzModel.GetDogzEquipPlaceRedpointById(dogzModel.presentSelectDogz,i).id;
|
| | | m_DogzEquips[i].gameObject.SetActive(_equiped);
|
| | | if (_equiped)
|
| | | {
|
| | |
| | | m_DogzUnEquipContents[i].text = StringUtility.Contact(DogzModel.GetItemColorName(_itemColor),
|
| | | DogzModel.GetDogzPartNameByIndex(i));
|
| | | m_DogzUnEquipContents[i].color = UIHelper.GetUIColor(_itemColor);
|
| | | m_DogzUnEquipBtns[i].RemoveAllListeners();
|
| | | m_DogzUnEquipBtns[i].AddListener(() => { ClickEquipIndex(index); });
|
| | | m_DogzUnEquipBtns[i].DogzUnEquipBtn.RemoveAllListeners();
|
| | | m_DogzUnEquipBtns[i].DogzUnEquipBtn.AddListener(() => { ClickEquipIndex(index); });
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void ClickEquipIndex(int index)
|
| | | {
|
| | | dogzModel.GetDogzItemListByIndex(index);
|
| | | dogzModel.GetDogzItemListByIndex(dogzModel.presentSelectDogz,index);
|
| | | if(dogzModel.selectEquipPlacelist.Count > 0)
|
| | | {
|
| | | WindowCenter.Instance.Open<SelectDogzItemWin>();
|
| | |
| | | private void GetEquipBtn()
|
| | | {
|
| | | //--界面跳转
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.DogzDungeon);
|
| | | }
|
| | |
|
| | | private void ClickStarSelect()
|
| | | {
|
| | | starSort.gameObject.SetActive(!starSort.gameObject.activeInHierarchy);
|
| | | starArrow.localRotation = Quaternion.Euler(0, 0, 0);
|
| | | if (!starSort.gameObject.activeInHierarchy)
|
| | | {
|
| | | starSort.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | |
|
| | | private void ClickQualitySelect()
|
| | | {
|
| | | qualitySort.gameObject.SetActive(!qualitySort.gameObject.activeInHierarchy);
|
| | | qualityArrow.localRotation = Quaternion.Euler(0, 0, 0);
|
| | | if (!qualitySort.gameObject.activeInHierarchy)
|
| | | {
|
| | | qualitySort.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | private void CloseQualitySort()
|
| | | {
|
| | | qualityArrow.localRotation = Quaternion.Euler(0, 0, 180);
|
| | | }
|
| | |
|
| | | private void CloseStarSort()
|
| | | {
|
| | | starArrow.localRotation = Quaternion.Euler(0, 0, 180);
|
| | | }
|
| | |
|
| | | [Serializable]
|
| | | public class DogzUnEquip
|
| | | {
|
| | | [SerializeField] Button m_DogzUnEquipBtn;
|
| | | public Button DogzUnEquipBtn { get { return m_DogzUnEquipBtn; } }
|
| | | [SerializeField] RedpointBehaviour m_RedpointBeh;
|
| | | public RedpointBehaviour RedpointBeh { get { return m_RedpointBeh; } }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | |
|
| | | private void OnOpenFuncEvent(int order)
|
| | | private void OnOpenFuncEvent(int order,int equipIndex)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GodBeastModel>().ItemPlace = equipIndex;
|
| | | funcBtnGroup.TriggerByOrder(order);
|
| | | if(WindowCenter.Instance.CheckOpen<DogzPackWin>())
|
| | | {
|
| | |
| | | public void Display() |
| | | { |
| | | timer = 0f; |
| | | UI3DModelExhibition.Instance.BeginShowNPC(model.bigBoxNpcId, Vector3.zero, m_RawImage); |
| | | UI3DModelExhibition.Instance.ShowNPC(model.bigBoxNpcId, Vector3.zero, m_RawImage); |
| | | DisplayBoxSurplusInfo(); |
| | | model.boxSurplusChangeEvent += OnBoxInfoUpdate; |
| | | } |
| | |
| | | public void Dispose() |
| | | { |
| | | model.boxSurplusChangeEvent -= OnBoxInfoUpdate; |
| | | UI3DModelExhibition.Instance.StopShowNPC(); |
| | | UI3DModelExhibition.Instance.StopShow(); |
| | | } |
| | | |
| | | private void OnBoxInfoUpdate() |
| | |
| | | public const int DATA_MAPID = 21110; |
| | | |
| | | int m_SelectedBoss = 0; |
| | | public int selectedBoss |
| | | { |
| | | get |
| | | { |
| | | public int selectedBoss { |
| | | get { |
| | | return this.m_SelectedBoss; |
| | | } |
| | | set |
| | | { |
| | | set { |
| | | if (this.m_SelectedBoss != value) |
| | | { |
| | | this.m_SelectedBoss = value; |
| | |
| | | } |
| | | |
| | | int m_WearyValue = 0; |
| | | public int wearyValue |
| | | { |
| | | public int wearyValue { |
| | | get { return m_WearyValue; } |
| | | set |
| | | { |
| | | set { |
| | | if (m_WearyValue != value) |
| | | { |
| | | m_WearyValue = value; |
| | |
| | | } |
| | | |
| | | int m_BigBoxCollectCount = 0; |
| | | public int bigBoxCollectCount |
| | | { |
| | | public int bigBoxCollectCount { |
| | | get { return m_BigBoxCollectCount; } |
| | | set |
| | | { |
| | | set { |
| | | if (m_BigBoxCollectCount != value) |
| | | { |
| | | m_BigBoxCollectCount = value; |
| | |
| | | } |
| | | |
| | | int m_SmallBoxCollectCount = 0; |
| | | public int smallBoxCollectCount |
| | | { |
| | | public int smallBoxCollectCount { |
| | | get { return m_SmallBoxCollectCount; } |
| | | set { m_SmallBoxCollectCount = value; } |
| | | } |
| | |
| | | |
| | | public void UpdateBoxOrEliteRefreshTime(HA904_tagGCDogzNPCRefreshTime _refreshTimes) |
| | | { |
| | | var containBox = false; |
| | | var boxRefreshSecond = 0; |
| | | |
| | | var containElite = false; |
| | | var eliteRefreshSecond = 0; |
| | | |
| | | for (int i = 0; i < _refreshTimes.InfoList.Length; i++) |
| | | { |
| | | var info = _refreshTimes.InfoList[i]; |
| | | if (bigBoxNpcId == info.NPCID || smallBoxNpcId == info.NPCID) |
| | | { |
| | | dogzDungeonBox.UpdateBoxRefreshTime((int)info.RefreshSecond); |
| | | RequestBoxSurplusInfo(); |
| | | containBox = true; |
| | | boxRefreshSecond = (int)info.RefreshSecond; |
| | | } |
| | | |
| | | if (eliteMonsters.Contains((int)info.NPCID)) |
| | | { |
| | | dogzDungeonElite.UpdateEliteRefreshTime((int)info.RefreshSecond); |
| | | containElite = true; |
| | | eliteRefreshSecond = (int)info.RefreshSecond; |
| | | } |
| | | } |
| | | |
| | | if (containBox) |
| | | { |
| | | dogzDungeonBox.UpdateBoxRefreshTime(boxRefreshSecond); |
| | | } |
| | | |
| | | if (containElite) |
| | | { |
| | | dogzDungeonElite.UpdateEliteRefreshTime(eliteRefreshSecond); |
| | | } |
| | | |
| | | if (WindowCenter.Instance.CheckOpen("DogzDungeonWin")) |
| | | { |
| | | if (containBox) |
| | | { |
| | | RequestBoxSurplusInfo(); |
| | | } |
| | | |
| | | if (containElite) |
| | | { |
| | | RequestEliteSurplusInfo(); |
| | | } |
| | | } |
| | |
| | | public class DogzDungeonElite |
| | | { |
| | | public Dictionary<int, int> eliteCounts = new Dictionary<int, int>(); |
| | | public int eliteSurplus |
| | | { |
| | | get |
| | | { |
| | | public int eliteSurplus { |
| | | get { |
| | | var count = 0; |
| | | foreach (var eliteCount in eliteCounts.Values) |
| | | { |
| | |
| | | public class DogzDungeonBossData |
| | | { |
| | | public int id { get; private set; } |
| | | public bool isUnLocked |
| | | { |
| | | get |
| | | { |
| | | public bool isUnLocked { |
| | | get { |
| | | var config = Config.Instance.Get<NPCConfig>(id); |
| | | return PlayerDatas.Instance.baseData.LV >= config.NPCLV; |
| | | } |
| | |
| | | public void Display() |
| | | { |
| | | timer = 0f; |
| | | UI3DModelExhibition.Instance.BeginShowNPC(model.eliteMonsters[0], Vector3.zero, m_RawImage); |
| | | UI3DModelExhibition.Instance.ShowNPC(model.eliteMonsters[0], Vector3.zero, m_RawImage); |
| | | DisplayGuardSurplusInfo(); |
| | | model.boxSurplusChangeEvent += OnGuardInfoUpdate; |
| | | } |
| | |
| | | public void Dispose() |
| | | { |
| | | model.boxSurplusChangeEvent -= OnGuardInfoUpdate; |
| | | UI3DModelExhibition.Instance.StopShowNPC(); |
| | | UI3DModelExhibition.Instance.StopShow(); |
| | | } |
| | | |
| | | private void OnGuardInfoUpdate() |
| New file |
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Friday, September 21, 2018 |
| | | //-------------------------------------------------------- |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | using TableConfig; |
| | | using System;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | { |
| | | |
| | | public class DungenWHYJ : MonoBehaviour
|
| | | { |
| | | |
| | | [SerializeField] Button m_WHYJButton;
|
| | | [SerializeField] GameObject m_Container_WHYJ;
|
| | | [SerializeField] Transform m_Horizontal;
|
| | | DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | |
|
| | | public void Init()
|
| | | {
|
| | | model.dungeonFightStageChangeEevent -= dungeonFightStageChangeEevent;
|
| | | model.dungeonFightStageChangeEevent += dungeonFightStageChangeEevent;
|
| | | model.updateMissionEvent -= updateMissionEvent;
|
| | | model.updateMissionEvent += updateMissionEvent;
|
| | | if (model.dungeonFightStage == DungeonFightStage.Prepare)
|
| | | {
|
| | | m_Container_WHYJ.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Container_WHYJ.SetActive(false);
|
| | | }
|
| | | SetTranItemCell();
|
| | | }
|
| | |
|
| | | private void updateMissionEvent()
|
| | | {
|
| | | SetTranItemCell();
|
| | | }
|
| | |
|
| | | private void Start()
|
| | | {
|
| | | m_WHYJButton.AddListener(OnClickButton);
|
| | | } |
| | | private void OnEnable()
|
| | | {
|
| | | |
| | | } |
| | | private void OnDisable()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | | private void dungeonFightStageChangeEevent(DungeonFightStage obj)
|
| | | {
|
| | | if (obj == DungeonFightStage.Prepare)
|
| | | {
|
| | | if (!m_Container_WHYJ.activeSelf)
|
| | | {
|
| | | m_Container_WHYJ.SetActive(true);
|
| | | }
|
| | | }
|
| | | else if(obj == DungeonFightStage.Normal)
|
| | | {
|
| | | if (m_Container_WHYJ.activeSelf)
|
| | | {
|
| | | m_Container_WHYJ.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void SetTranItemCell()
|
| | | {
|
| | | int lineID = model.mission.lineID;
|
| | | var WHYJConfig = Config.Instance.Get<WHYJRewardConfig>(lineID+1);
|
| | | int[] RewardList = ConfigParse.GetMultipleStr<int>(WHYJConfig.Reward);
|
| | | int[] QuantityList = ConfigParse.GetMultipleStr<int>(WHYJConfig.Quantity);
|
| | | for (int i = 0; i < m_Horizontal.childCount; i++)
|
| | | {
|
| | | if (i < RewardList.Length)
|
| | | {
|
| | | m_Horizontal.GetChild(i).gameObject.SetActive(true);
|
| | | ItemCell ItemCell = m_Horizontal.GetChild(i).GetComponent<ItemCell>();
|
| | | ItemCellModel cellModel = new ItemCellModel(RewardList[i], true, (ulong)QuantityList[i], 0);
|
| | | ItemCell.Init(cellModel);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Horizontal.GetChild(i).gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | } |
| | | private void OnClickButton()
|
| | | {
|
| | | m_Container_WHYJ.SetActive(!m_Container_WHYJ.activeSelf);
|
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 979d7cffed796d145bb0cc4290a14943 |
| | | timeCreated: 1537527871 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | [SerializeField] DungeonItemCollect m_ItemCollect;
|
| | | [SerializeField] DungeonGuardSkyBehaviour m_GuardSky;
|
| | | [SerializeField] DungeonBossBriefInfoContainer m_BossInfosContainer;
|
| | |
|
| | | [SerializeField] GameObject m_Container_WHYJ;
|
| | | [SerializeField] DungenWHYJ m_DungenWHYJ;
|
| | | bool excutedAutoExit = false;
|
| | | float timer = 0f;
|
| | | DateTime endTime = DateTime.Now;
|
| | |
| | |
|
| | | model.dungeonCoolDownEvent += OnLeaveMapTimeEvent;
|
| | | MainInterfaceWin.Event_Duplicates += OnChangeFuncBtnPosEvent;
|
| | | if (WHYJBool())
|
| | | {
|
| | | m_Container_WHYJ.SetActive(true);
|
| | | m_DungenWHYJ.Init();
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Container_WHYJ.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | MainInterfaceWin.Event_Duplicates -= OnChangeFuncBtnPosEvent;
|
| | | model.dungeonCoolDownEvent -= OnLeaveMapTimeEvent;
|
| | |
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var mapConfig = Config.Instance.Get<MapConfig>(mapId);
|
| | | try
|
| | | {
|
| | | var mapId = PlayerDatas.Instance.baseData.MapID;
|
| | | var mapConfig = Config.Instance.Get<MapConfig>(mapId);
|
| | | if (mapConfig != null && mapConfig.MapFBType != (int)MapType.OpenCountry)
|
| | | {
|
| | | throw new NullReferenceException();
|
| | |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | Debug.Log(ex.Message);
|
| | | ExceptionCatcher.ReportException("副本战斗界面异常关闭", ex.Message);
|
| | | Debug.Log(ex);
|
| | | var content = StringUtility.Contact("当前地图:", PlayerDatas.Instance.baseData.MapID, ";堆栈信息:", ex.StackTrace);
|
| | | ExceptionCatcher.ReportException("副本战斗界面异常关闭", content);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | var config = Config.Instance.Get<RuneTowerFloorConfig>(runeTowerModel.currentFloor);
|
| | | var lastFloor = (int)ModelCenter.Instance.GetModel<RuneModel>().RuneTowerOpenLV;
|
| | | var lastFloorConfig = Config.Instance.Get<RuneTowerFloorConfig>(lastFloor);
|
| | | if (model.dungeonResult.isPass == 1 && config.TowerId == lastFloorConfig.TowerId)
|
| | | if (model.dungeonResult.isPass == 1 && config.TowerId == lastFloorConfig.TowerId && lastFloorConfig.AutoExit == 0)
|
| | | {
|
| | | var runeTowerStage = StageManager.Instance.CurrentStage as RuneTowerDungeonStage;
|
| | | runeTowerStage.PerformChallengeNextLevel();
|
| | |
| | |
|
| | | }
|
| | |
|
| | | private bool WHYJBool()//判断是否在娲皇遗迹副本
|
| | | {
|
| | | var dataMapId = model.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
|
| | | if (dataMapId == GeneralConfig.Instance.ruinsTranscriptMapId)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | CancelGroupEnter(_dungeon.mapId);
|
| | | CancelGroupEnter(_dungeon);
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void CancelGroupEnter(int _mapId)
|
| | | private void CancelGroupEnter(Dungeon _dungeon)
|
| | | {
|
| | | switch (_mapId)
|
| | | switch (_dungeon.mapId)
|
| | | {
|
| | | case RealmModel.REALM_DUNGEON_ID:
|
| | | if (!WindowCenter.Instance.CheckOpen<TeamFrameWin>())
|
| | |
| | | WindowCenter.Instance.Open<TeamFrameWin>(false, teamModel.myTeam.inTeam ? 1 : 0);
|
| | | }
|
| | | break;
|
| | | default:
|
| | | if (!WindowCenter.Instance.CheckOpen<TeamFrameWin>())
|
| | | {
|
| | | var teamModel = ModelCenter.Instance.GetModel<TeamModel>();
|
| | | teamModel.missionBuf = teamModel.currentMission = new TeamMission(_dungeon.mapId, _dungeon.lineId);
|
| | | WindowCenter.Instance.Open<TeamFrameWin>(false, teamModel.myTeam.inTeam ? 1 : 0);
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private string GroupChallengeOnlyOneTip(int _mapId)
|
| | | {
|
| | | switch (_mapId)
|
| | | {
|
| | | case 60010:
|
| | | if (PlayerDatas.Instance.baseData.LV < GeneralConfig.Instance.trialDungeonGroupChallengeTipLv)
|
| | | {
|
| | | return Language.Get("SingleIntoFB");
|
| | | }
|
| | | break;
|
| | | }
|
| | | return Language.Get("FBEnter_OnlyYou");
|
| | | }
|
| | |
|
| | |
| | | var mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(_dataMapId, _lineId);
|
| | | var assetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact("maps/", mapResConfig.MapResources.ToLower()));
|
| | |
|
| | | if (!assetVersion.IsPriorAsset())
|
| | | if (assetVersion != null && !assetVersion.IsPriorAsset())
|
| | | {
|
| | | InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.Whole);
|
| | | return;
|
| | |
| | | m_NumberOfPliesText.text = Language.Get("DungeonVictoryWin_NumberOfPliesText", str);
|
| | | }
|
| | | }
|
| | |
|
| | | List<ServerItem> Serveritem = new List<ServerItem>();
|
| | | protected override void DrawItemRewards()
|
| | | {
|
| | | var merged = false;
|
| | | Serveritem.Clear();
|
| | | var merged = false;
|
| | | var serveritems = dungeonModel.dungeonResult.itemInfo;
|
| | |
|
| | | for (int i = 0; i < serveritems.Length; i++)
|
| | | {
|
| | | Serveritem.Add(serveritems[i]);
|
| | | }
|
| | | Serveritem.Sort(Compare);
|
| | | var hasReward = (serveritems != null && serveritems.Length > 0) || dungeonModel.specialItemCollectRecord.count > 0;
|
| | |
|
| | | m_RewardIndexs.Clear();
|
| | |
| | | }
|
| | | m_ContainerReward.gameObject.SetActive(hasReward);
|
| | |
|
| | | if (serveritems != null)
|
| | | if (Serveritem != null)
|
| | | {
|
| | | var items = new List<ItemModel>();
|
| | | for (int i = 0; i < serveritems.Length; i++)
|
| | | for (int i = 0; i < Serveritem.Count; i++)
|
| | | {
|
| | | var serverItem = serveritems[i];
|
| | | var serverItem = Serveritem[i];
|
| | | var itemModel = new ItemModel(PackType.rptItem);
|
| | | var itemInfo = new ItemInfo();
|
| | | itemInfo.ItemID = serverItem.ItemID;
|
| | |
| | | itemModel.SetItemModel(itemInfo);
|
| | | items.Add(itemModel);
|
| | | }
|
| | | items.Sort(Compare);
|
| | | // items.Sort(Compare);
|
| | |
|
| | | for (int i = 0; i < passRewardBehaviours.Length; i++)
|
| | | {
|
| | | var behaviour = passRewardBehaviours[i];
|
| | |
| | | {
|
| | | behaviour.transform.parent.gameObject.SetActive(true);
|
| | | behaviour.gameObject.SetActive(false);
|
| | | behaviour.serverItem = serveritems[i];
|
| | | behaviour.serverItem = Serveritem[i];
|
| | | behaviour.Init(items[i]);
|
| | | m_RewardIndexs.Add(m_SpecialItemCollect == null ? i : i + 1);
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | int Compare(ItemModel x, ItemModel y)//数组排列
|
| | | int Compare(ServerItem x, ServerItem y)//数组排列
|
| | | {
|
| | | ItemConfig itemConfigx = Config.Instance.Get<ItemConfig>(x.itemId);
|
| | | ItemConfig itemConfigy = Config.Instance.Get<ItemConfig>(y.itemId);
|
| | | ItemConfig itemConfigx = Config.Instance.Get<ItemConfig>(x.ItemID);
|
| | | ItemConfig itemConfigy = Config.Instance.Get<ItemConfig>(y.ItemID);
|
| | | if (itemConfigx.ItemColor.CompareTo(itemConfigy.ItemColor) != 0)
|
| | | return -itemConfigx.ItemColor.CompareTo(itemConfigy.ItemColor);
|
| | | return 1;
|
| | |
| | | var config = Config.Instance.Get<RuneTowerFloorConfig>(runeTowerModel.currentFloor);
|
| | | var lastFloor = (int)ModelCenter.Instance.GetModel<RuneModel>().RuneTowerOpenLV;
|
| | | var lastFloorConfig = Config.Instance.Get<RuneTowerFloorConfig>(lastFloor);
|
| | | m_RuneTowerNext.gameObject.SetActive(config.TowerId == lastFloorConfig.TowerId);
|
| | | m_RuneTowerNext.gameObject.SetActive(lastFloorConfig.AutoExit == 0 && config.TowerId == lastFloorConfig.TowerId);
|
| | |
|
| | | DisplayRunesUnLock(lastFloor);
|
| | | }
|
| | |
| | | [SerializeField] ButtonEx m_GroupStart;
|
| | | [SerializeField] ButtonEx m_SingleStart;
|
| | | [SerializeField] ButtonEx m_AutoGroupStart;
|
| | | [SerializeField] ButtonEx m_Group;
|
| | | [SerializeField] Button m_CloseWin;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerGroup;
|
| | |
|
| | | DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | TeamModel teamModel { get { return ModelCenter.Instance.GetModel<TeamModel>(); } }
|
| | |
| | | m_SingleStart.AddListener(ChallengeDungeon);
|
| | | m_AutoGroupStart.AddListener(AutoGroupChallenge);
|
| | | m_Sweep.AddListener(SweepDungeon);
|
| | | m_Group.AddListener(OpenGroup);
|
| | | m_CloseWin.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | private void OpenGroup()
|
| | | {
|
| | | var openGroup = m_ContainerGroup.gameObject.activeSelf;
|
| | | m_ContainerGroup.gameObject.SetActive(!openGroup);
|
| | | }
|
| | |
|
| | | private void UpdateDungeonEnterCD()
|
| | | {
|
| | | var dungeonId = model.GetDungeonId(model.currentDungeon);
|
| | |
| | | m_SingleStart.gameObject.SetActive(fbType == 1 || fbType == 2);
|
| | | m_AutoGroupStart.gameObject.SetActive(fbType == 2 || fbType == 3);
|
| | |
|
| | | m_ContainerGroup.gameObject.SetActive(false);
|
| | | m_Group.gameObject.SetActive(fbType == 2 || fbType == 3);
|
| | |
|
| | | m_EntranceBG.SetSprite(dungeonOpenTimeConfig.PanelImg);
|
| | |
|
| | | m_DungeonTitle.text = dungeonConfig.FBName;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(dungeonConfig.BossActorID[0], Vector3.zero, m_BossPortrayal);
|
| | | UI3DModelExhibition.Instance.ShowNPC(dungeonConfig.BossActorID[0], Vector3.zero, m_BossPortrayal);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | [SerializeField] Image m_BossRealm;
|
| | | [SerializeField] Text m_BossName;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerGroup;
|
| | | [SerializeField] Button m_Group;
|
| | |
|
| | | [SerializeField] TrialRewardsBehaviour[] m_RewardBehaviours;
|
| | | [SerializeField] ScrollRect m_RewardScroller;
|
| | |
|
| | |
| | | m_SingleStart.AddListener(ChallengeDungeon);
|
| | | m_AutoGroupStart.AddListener(AutoGroupChallenge);
|
| | | m_CloseWin.AddListener(CloseClick);
|
| | | m_Group.AddListener(OpenGroup);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | | m_GroupStart.image.material = CheckChallenge() ? MaterialUtility.GetUIDefaultGraphicMaterial() : MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | m_SingleStart.image.material = CheckChallenge() ? MaterialUtility.GetUIDefaultGraphicMaterial() : MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | m_AutoGroupStart.image.material = CheckChallenge() ? MaterialUtility.GetUIDefaultGraphicMaterial() : MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | m_Group.image.material = CheckChallenge() ? MaterialUtility.GetUIDefaultGraphicMaterial() : MaterialUtility.GetDefaultSpriteGrayMaterial();
|
| | | m_ContainerGroup.gameObject.SetActive(false);
|
| | |
|
| | | DrawDungeonBaseInfo();
|
| | | DrawRewards();
|
| | | }
|
| | |
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.dungeonRecordChangeEvent -= UpdateDungeonTimes;
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | private void OpenGroup()
|
| | | {
|
| | | if (!CheckChallenge())
|
| | | {
|
| | | return;
|
| | | }
|
| | | var openGroup = m_ContainerGroup.gameObject.activeSelf;
|
| | | m_ContainerGroup.gameObject.SetActive(!openGroup);
|
| | | }
|
| | |
|
| | | private void DrawDungeonBaseInfo()
|
| | | {
|
| | |
| | | m_GroupStart.gameObject.SetActive(fbType == 2 || fbType == 3);
|
| | | m_SingleStart.gameObject.SetActive(fbType == 1 || fbType == 2);
|
| | | m_AutoGroupStart.gameObject.SetActive(fbType == 2 || fbType == 3);
|
| | | m_Group.gameObject.SetActive(fbType == 2 || fbType == 3);
|
| | |
|
| | | var playerLevel = PlayerDatas.Instance.baseData.LV;
|
| | | m_LevelLimit.gameObject.SetActive(playerLevel < dungeonConfig.LVLimitMin);
|
| | |
| | | void DisplayBossInfo(int _npcId)
|
| | | {
|
| | | m_BossName.gameObject.SetActive(true);
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(_npcId, Vector3.zero, m_BossPortrayal);
|
| | | UI3DModelExhibition.Instance.ShowNPC(_npcId, Vector3.zero, m_BossPortrayal);
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(_npcId);
|
| | | if (npcConfig != null)
|
| | | {
|
| | |
| | |
|
| | | private void RefreshItemCountAct(PackType packType, int arg2, int itemId)
|
| | | {
|
| | | if (packType == PackType.rptItem && trialTokens.Contains(itemId))
|
| | | var config = Config.Instance.Get<ItemConfig>(itemId);
|
| | | if (config == null)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | return;
|
| | | }
|
| | | if (packType == PackType.rptItem)
|
| | | {
|
| | | if (trialTokens.Contains(itemId) || config.EquipPlace > 0)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | }
|
| | | }
|
| | | else if (packType == PackType.rptEquip)
|
| | | {
|
| | |
| | | {
|
| | | return 0;
|
| | | }
|
| | | var singlepack = packModel.GetSinglePackModel(PackType.rptEquip);
|
| | | var singlepack = packModel.GetSinglePackModel(PackType.rptItem);
|
| | | if (singlepack != null)
|
| | | {
|
| | | var dict = singlepack.GetPackModelIndexDict();
|
| | | if (dict != null)
|
| | | {
|
| | | foreach (var itemModel in dict.Values)
|
| | | {
|
| | | if (itemModel.chinItemModel.EquipPlace == config.EquipPlace
|
| | | && (itemModel.chinItemModel.JobLimit / 100 == PlayerDatas.Instance.baseData.Job
|
| | | || itemModel.chinItemModel.JobLimit == 0)
|
| | | && !ModelCenter.Instance.GetModel<PackModelInterface>().IsOverdue(itemModel.itemInfo.ItemGUID, itemModel.itemId, itemModel.useDataDict))
|
| | | {
|
| | | var compare = EquipCompare(itemModel, config);
|
| | | if (compare == -1 || compare == 0)
|
| | | {
|
| | | return compare;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | singlepack = packModel.GetSinglePackModel(PackType.rptEquip);
|
| | | if (singlepack == null)
|
| | | {
|
| | | return 1;
|
| | |
| | | {
|
| | | return 1;
|
| | | }
|
| | | var compareConfig = Config.Instance.Get<ItemConfig>(equipItem.itemId);
|
| | | return EquipCompare(equipItem, config);
|
| | | }
|
| | |
|
| | | int EquipCompare(ItemModel compareItem, ItemConfig config)
|
| | | {
|
| | | var compareConfig = Config.Instance.Get<ItemConfig>(compareItem.itemId);
|
| | | if (compareConfig == null)
|
| | | {
|
| | | return 1;
|
| | |
| | | model.SelectEquipClassEvent += SelectEquipClassEvent;
|
| | | packModel.RefreshItemCountAct += RefreshItemCountAct;
|
| | | Display();
|
| | | JumpToRedpoint();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | |
|
| | | private void RefreshItemCountAct(PackType packtype, int arg2, int itemId)
|
| | | {
|
| | | if (packtype == PackType.rptItem && model.trialTokens.Contains(itemId))
|
| | | var config = Config.Instance.Get<ItemConfig>(itemId);
|
| | | if (config == null)
|
| | | {
|
| | | m_Controller.m_Scorller.RefreshActiveCellViews();
|
| | | DisplayTokens();
|
| | | return;
|
| | | }
|
| | | if (packtype == PackType.rptItem)
|
| | | {
|
| | | if (model.trialTokens.Contains(itemId) || config.EquipPlace > 0)
|
| | | {
|
| | | m_Controller.m_Scorller.RefreshActiveCellViews();
|
| | | DisplayTokens();
|
| | | }
|
| | | }
|
| | | else if (packtype == PackType.rptEquip)
|
| | | {
|
| | |
| | | DisplayTokens();
|
| | | bool _up = m_SelectClassBehaviour.gameObject.activeSelf;
|
| | | m_SelectClassUp.transform.localEulerAngles = Vector3.zero.SetZ(_up ? 0 : 180);
|
| | | JumpToRedpoint();
|
| | | }
|
| | |
|
| | | private void JumpToRedpoint()
|
| | | {
|
| | | if (model.selectEquipClass == 1)
|
| | | {
|
| | | var trialClasses = model.GetTotalClass();
|
| | | var index = 0;
|
| | | for (int i = 0; i < trialClasses.Count; i++)
|
| | | {
|
| | | var line = 0;
|
| | | index += 1;
|
| | | if (JumpToRedpoint(trialClasses[i], out line))
|
| | | {
|
| | | m_Controller.JumpIndex(index + line);
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | List<TrialExchangeConfig> list;
|
| | | if (model.TryGetTrialExchanges(trialClasses[i], out list))
|
| | | {
|
| | | index += Mathf.CeilToInt((float)list.Count / 3);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | var line = 0;
|
| | | JumpToRedpoint(model.selectEquipClass, out line);
|
| | | m_Controller.JumpIndex(line);
|
| | | }
|
| | | }
|
| | |
|
| | | private bool JumpToRedpoint(int _class, out int line)
|
| | | {
|
| | | var itemId = 0;
|
| | | line = 0;
|
| | | if (model.IsAnySatisfyExchangeBetterEquip(_class, out itemId))
|
| | | {
|
| | | List<TrialExchangeConfig> list;
|
| | | if (model.TryGetTrialExchanges(_class, out list))
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | {
|
| | | if (list[i].id == itemId)
|
| | | {
|
| | | line = i / 3;
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | void OnShowFairyBossModel()
|
| | | {
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(fairyBossModel.fairyBossNpcId, Vector3.zero, model);
|
| | | UI3DModelExhibition.Instance.ShowNPC(fairyBossModel.fairyBossNpcId, Vector3.zero, model);
|
| | | }
|
| | |
|
| | | private void OnFoodGetWay()
|
| | |
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo -= OnRefreshFairyBoss;
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyBoss -= OnRefreshFairyBoss;
|
| | | TimeMgr.Instance.OnHourEvent -= OnRefreshFairyBoss;
|
| | |
| | | model.RemoveHelp();
|
| | | return;
|
| | | }
|
| | | if (PlayerDatas.Instance.extersion.bossState == 1)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("Boss_Leave");
|
| | | model.RemoveHelp();
|
| | | return;
|
| | | }
|
| | | if (!model.IsBossAlive(help.npcId))
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("FairyGrabBossNotAlive"), (bool isOk) =>
|
| | |
| | | });
|
| | | return;
|
| | | }
|
| | | model.RemoveHelp();
|
| | | MapTransferUtility.Instance.MoveToNPC(help.npcId);
|
| | | }
|
| | | }
|
| | |
| | | [SerializeField] RectTransform m_ContainerUnOpen;
|
| | | [SerializeField] RectTransform m_ContainerOpen;
|
| | | [SerializeField] Text m_SurplusTime;
|
| | | [SerializeField] Text m_OpenDate;
|
| | |
|
| | | FairyGrabBossModel model { get { return ModelCenter.Instance.GetModel<FairyGrabBossModel>(); } }
|
| | | DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
|
| | | BossHomeModel bossHomeModel { get { return ModelCenter.Instance.GetModel<BossHomeModel>(); } }
|
| | | FindPreciousModel findPreciousModel { get { return ModelCenter.Instance.GetModel<FindPreciousModel>(); } }
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | |
|
| | | float m_Timer = 0f;
|
| | | const float Interval = 10f;
|
| | |
| | | DisplaySurplusTime();
|
| | | DisplayBossInfo();
|
| | | DisplayHighestFairy();
|
| | | DisplayOpenDate();
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | model.bossSelectedEvent += BossSelectedEvent;
|
| | | model.bossProgressUpdate += BossProgressUpdate;
|
| | | model.bossAllProgressUpdate += BossAllProgressUpdate;
|
| | | model.stateUpdate += StateUpdate;
|
| | | TimeUtility.OnServerOpenDayRefresh += OnServerOpenDayRefresh;
|
| | | m_Timer = 0;
|
| | | }
|
| | |
|
| | |
| | | model.bossProgressUpdate -= BossProgressUpdate;
|
| | | model.bossAllProgressUpdate -= BossAllProgressUpdate;
|
| | | model.stateUpdate -= StateUpdate;
|
| | | TimeUtility.OnServerOpenDayRefresh -= OnServerOpenDayRefresh;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | private void OnServerOpenDayRefresh()
|
| | | {
|
| | | DisplayOpenDate();
|
| | | }
|
| | |
|
| | | void DisplayBosses()
|
| | | {
|
| | | var bosses = new List<int>();
|
| | |
| | | m_Bosses.MoveToCenter(bosses.IndexOf(model.selectBoss));
|
| | | }
|
| | |
|
| | | void DisplayOpenDate()
|
| | | {
|
| | | DailyQuestOpenTime dailyQuestOpenTime;
|
| | | if (dailyQuestModel.TryGetOpenTime((int)DailyQuestType.FairyGrabBoss, out dailyQuestOpenTime))
|
| | | {
|
| | | m_OpenDate.text = Language.Get("FairyGrabBossOpenDate", dailyQuestOpenTime.ToOpenTimeString());
|
| | | }
|
| | | else
|
| | | {
|
| | | m_OpenDate.text = string.Empty;
|
| | | }
|
| | | }
|
| | |
|
| | | void DisplayBossInfo()
|
| | | {
|
| | | List<Item> dropItems;
|
| | |
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class FairyLeagueModel : Model, IAfterPlayerDataInitialize, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | public class FairyLeagueModel : Model, IAfterPlayerDataInitialize, IBeforePlayerDataInitialize, IPlayerLoginOk,IOpenServerActivity
|
| | | {
|
| | | public event Action OnRefreshFairyLeagueEvent;
|
| | |
|
| | |
| | | {
|
| | | get
|
| | | {
|
| | | var openServerTime = TimeUtility.openServerTime;
|
| | | var openServerWeekDay = openServerTime.DayOfWeek == DayOfWeek.Sunday ? 7 : (int)openServerTime.DayOfWeek;
|
| | | var openServerWeekDay = TimeUtility.openServerDayOfWeek == DayOfWeek.Sunday ? 7 : (int)TimeUtility.openServerDayOfWeek;
|
| | | if (specialLeagueTimes.ContainsKey(openServerWeekDay))
|
| | | {
|
| | | var dict = specialLeagueTimes[openServerWeekDay];
|
| | |
| | | {
|
| | | get
|
| | | {
|
| | | var openServerTime = TimeUtility.openServerTime;
|
| | | var openServerWeekDay = openServerTime.DayOfWeek == DayOfWeek.Sunday ? 7 : (int)openServerTime.DayOfWeek;
|
| | | var openServerWeekDay = TimeUtility.openServerDayOfWeek == DayOfWeek.Sunday ? 7 : (int)TimeUtility.openServerDayOfWeek;
|
| | | if (specialLeagueTimes.ContainsKey(openServerWeekDay))
|
| | | {
|
| | | var dict = specialLeagueTimes[openServerWeekDay];
|
| | |
| | | DTCA003_tagUniversalGameRecInfo.onGetUniversalGameInfo += OnGetUniversalGameInfo;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | TimeMgr.Instance.OnMinuteEvent += MinuteEvent;
|
| | | TimeMgr.Instance.OnDayEvent += DayEvent;
|
| | | fairyLeagueHelp = new FairyLeagueHelp();
|
| | | OpenServerActivityCenter.Instance.Register((int)OpenServerActivityCenter.OSActivityType.FairyLeagueNotice, this);
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | cacheLeagueStage = fairyLeagueStage;
|
| | | CheckFairyLeagueData();
|
| | | UpdateRedpoint();
|
| | | UpdateNoticeRedpoint();
|
| | | serverInited = true;
|
| | | }
|
| | |
|
| | |
| | | readonly List<int> fairyLeagueStateValues = new List<int>() { 11, 12, 13, 21, 22, 23 };
|
| | | FairyLeagueWeekTime fairyLeagueWeekTime = new FairyLeagueWeekTime();
|
| | | Dictionary<int, Dictionary<int, FairyLeagueWeekTime>> specialLeagueTimes = new Dictionary<int, Dictionary<int, FairyLeagueWeekTime>>();
|
| | | public Dictionary<int,int> leagueNoticeWeapons { get; private set; }
|
| | | private void ParseConfig()
|
| | | {
|
| | | FuncConfigConfig cfg = Config.Instance.Get<FuncConfigConfig>("FamilyMatchGuide");
|
| | |
| | | integralAddition = int.Parse(cfg.Numerical5);
|
| | | cfg = Config.Instance.Get<FuncConfigConfig>("FamilyMatchResourcePoint1");
|
| | | crystalRateDict = ConfigParse.GetDic<int, float>(cfg.Numerical1);
|
| | | cfg = Config.Instance.Get<FuncConfigConfig>("FamilyForcast");
|
| | | leagueNoticeWeapons = ConfigParse.GetDic<int, int>(cfg.Numerical1);
|
| | | }
|
| | |
|
| | | int GetIndexOfWeek(int _openWeekDay, int _openDays, out int dayOfWeek)
|
| | | {
|
| | | var index = (_openWeekDay + _openDays - 1) / 7;
|
| | | var index = (_openWeekDay + _openDays - 2) / 7;
|
| | | dayOfWeek = (_openWeekDay + _openDays - 1) % 7;
|
| | | dayOfWeek = dayOfWeek == 0 ? 7 : dayOfWeek;
|
| | | return index;
|
| | | }
|
| | |
|
| | |
| | | #region 红点
|
| | | private Redpoint m_LeagueRedpoint = new Redpoint(107, 10704);
|
| | | public Redpoint m_JoinFairyLeagueRedpoint { get; private set; }
|
| | |
|
| | | public void UpdateRedpoint()
|
| | | {
|
| | | m_JoinFairyLeagueRedpoint.state = RedPointState.None;
|
| | |
| | | return;
|
| | | }
|
| | | m_JoinFairyLeagueRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | #endregion
|
| | |
|
| | | #region 仙盟联赛预告
|
| | | private void OnFuncStateChangeEvent(int func)
|
| | | {
|
| | | if (func == 142)
|
| | | {
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate((int)OpenServerActivityCenter.OSActivityType.FairyLeagueNotice);
|
| | | }
|
| | | UpdateNoticeRedpoint();
|
| | | }
|
| | | }
|
| | |
|
| | | public event Action<int> onStateUpate;
|
| | | public bool IsOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return FuncOpen.Instance.IsFuncOpen(142) && !IsAfterFirstLeague();
|
| | | }
|
| | | }
|
| | | public bool IsAdvance
|
| | | {
|
| | | get { return false; }
|
| | | }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get { return false; }
|
| | | }
|
| | |
|
| | | public int GetBeforeFirstLeagueTime()
|
| | | {
|
| | | var seconds = 0;
|
| | | if (TimeUtility.OpenWeekCnt <= 1)
|
| | | {
|
| | | if (IsAfterFirstLeague())
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | var weekTime = currentWeekTime == null ? nextWeekTime : currentWeekTime;
|
| | | var ring = weekTime.rings[0];
|
| | | var session = ring.sessions[0];
|
| | | var fightStage = session.stages.Find((x) =>
|
| | | {
|
| | | return x.stage == FairyLeagueStage.Fight;
|
| | | });
|
| | | var time = TimeUtility.ServerNow.AddTicks((weekTime.rings[0].openServerDay - TimeUtility.OpenDay - 1) * TimeSpan.TicksPerDay);
|
| | | time = new DateTime(time.Year, time.Month, time.Day, fightStage.startHour, fightStage.startMinute, 0);
|
| | | seconds = (int)(time - TimeUtility.ServerNow).TotalSeconds;
|
| | | seconds = Mathf.Max(seconds, 0);
|
| | | }
|
| | | return seconds;
|
| | | }
|
| | |
|
| | | public bool IsAfterFirstLeague()
|
| | | {
|
| | | if (TimeUtility.OpenWeekCnt <= 1)
|
| | | {
|
| | | var openServerWeekDay = TimeUtility.openServerDayOfWeek == DayOfWeek.Sunday ? 7 : (int)TimeUtility.openServerDayOfWeek;
|
| | | if (specialLeagueTimes.ContainsKey(openServerWeekDay))
|
| | | {
|
| | | var dict = specialLeagueTimes[openServerWeekDay];
|
| | | var weekCount = TimeUtility.OpenWeekCnt;
|
| | | if (dict.ContainsKey(0) && weekCount > 0)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | if (currentWeekTime == null)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var weekTime = currentWeekTime == null ? nextWeekTime : currentWeekTime;
|
| | | if (weekTime.IsNextWeek)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | if (weekTime.rings.Count > 1 && weekTime.currentRing == 1)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return weekTime.currentSession == 1 && weekTime.fairyLeagueStage == FairyLeagueStage.Over;
|
| | | }
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | Redpoint fairyLeagueNoticeRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20912);
|
| | | void UpdateNoticeRedpoint()
|
| | | {
|
| | | fairyLeagueNoticeRedpoint.state = RedPointState.None;
|
| | | if (!DayRemind.Instance.GetDayRemind(DayRemind.LEAGUE_NOTICE_REDPOINT)
|
| | | && IsOpen)
|
| | | {
|
| | | fairyLeagueNoticeRedpoint.state = RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetViewLeagueNotice()
|
| | | {
|
| | | if (fairyLeagueNoticeRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | DayRemind.Instance.SetDayRemind(DayRemind.LEAGUE_NOTICE_REDPOINT, true);
|
| | | UpdateNoticeRedpoint();
|
| | | }
|
| | | }
|
| | | #endregion
|
| | | }
|
| | |
| | |
|
| | | public int dayOfWeek { get; set; }
|
| | |
|
| | | public int openServerDay { get; private set; }
|
| | |
|
| | | public void Sort()
|
| | | {
|
| | | sessions.Sort((Session x, Session y) =>
|
| | |
| | |
|
| | | public void ParseConfig(DungeonSpecialStateTimeConfig config, int dayOfWeek)
|
| | | {
|
| | | openServerDay = config.OpenServerDay;
|
| | |
|
| | | var session = sessions.Find((x) =>
|
| | | {
|
| | | return x.session == (config.StateValue < 20 ? 0 : 1);
|
| New file |
| | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Friday, September 21, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System;
|
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI {
|
| | |
|
| | | public class FairyLeagueNoticeWin : Window
|
| | | {
|
| | | [SerializeField] RectTransform m_ContainerNoFairy;
|
| | | [SerializeField] RectTransform m_ContainerHasFairy;
|
| | | [SerializeField] Button m_JoinFairy;
|
| | | [SerializeField] Button m_Goto;
|
| | | [SerializeField] RawImage[] m_RawWeapons;
|
| | | [SerializeField, Header("武器角度,职业1,2,3")] Vector3[] m_WeaponAngles;
|
| | |
|
| | | FairyLeagueModel model { get { return ModelCenter.Instance.GetModel<FairyLeagueModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | m_JoinFairy.onClick.AddListener(JoinFairy);
|
| | | m_Goto.onClick.AddListener(Goto);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo += OnRefreshFairyInfo;
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyMine += OnRefreshFairyInfo;
|
| | | model.SetViewLeagueNotice();
|
| | | Display();
|
| | | DisplayWeapons();
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyInfo -= OnRefreshFairyInfo;
|
| | | PlayerDatas.Instance.fairyData.OnRefreshFairyMine -= OnRefreshFairyInfo;
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
|
| | | }
|
| | | #endregion
|
| | |
|
| | | void Display()
|
| | | {
|
| | | m_ContainerNoFairy.gameObject.SetActive(!PlayerDatas.Instance.fairyData.HasFairy);
|
| | | m_ContainerHasFairy.gameObject.SetActive(PlayerDatas.Instance.fairyData.HasFairy);
|
| | | }
|
| | |
|
| | | private void Goto()
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.UnionFunc4);
|
| | | }
|
| | | private void JoinFairy()
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.UnionFunc3);
|
| | | }
|
| | |
|
| | | private void OnRefreshFairyInfo()
|
| | | {
|
| | | Display();
|
| | | }
|
| | |
|
| | | void DisplayWeapons()
|
| | | {
|
| | | var job = PlayerDatas.Instance.baseData.Job;
|
| | | var _rawImage = m_RawWeapons[0];
|
| | | var _angle = m_WeaponAngles[0];
|
| | | var _weaponId = model.leagueNoticeWeapons.ContainsKey(job) ? model.leagueNoticeWeapons[job] : 0;
|
| | | if (_weaponId == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | for (int i = 0; i < m_RawWeapons.Length; i++)
|
| | | {
|
| | | m_RawWeapons[i].gameObject.SetActive(job == (i + 1));
|
| | | if ((i + 1) == job)
|
| | | {
|
| | | _rawImage = m_RawWeapons[i];
|
| | | _angle = m_WeaponAngles[i];
|
| | | }
|
| | | }
|
| | | var config = Config.Instance.Get<ItemConfig>(_weaponId);
|
| | | UI3DModelExhibition.Instance.ShowEquipment(config.ChangeOrd, _angle, _rawImage);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: c1c8b96d40cac8741ab435102d9d4549 |
| | | timeCreated: 1537498840 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | protected override void OnPreClose()
|
| | | {
|
| | | model.UpdateKingFairyEvent -= UpdateKingFairyEvent;
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | itemData = _leaderData.roleEquipDataDic[RoleEquipType.retWeapon2];
|
| | | weapon2 = itemData.ItemID;
|
| | | }
|
| | | UI3DModelExhibition.Instance.BeginShowOtherPlayer(m_LeaderMob, _leaderData.rolePropData.Job, clothes, _suitEffect, weapon, wing, weapon2);
|
| | |
|
| | | var data = new UI3DModelExhibition.UI3DPlayerExhibitionData
|
| | | {
|
| | | job = _leaderData.rolePropData.Job,
|
| | | clothesId = clothes,
|
| | | suitLevel = _suitEffect,
|
| | | weaponId = weapon,
|
| | | wingsId = wing,
|
| | | secondaryId = weapon2,
|
| | | };
|
| | |
|
| | | UI3DModelExhibition.Instance.ShowOtherPlayer(m_LeaderMob, data);
|
| | | m_LeaderNameTxt.text = _leaderData.rolePropData.Name;
|
| | | m_LeaderRealmImg.gameObject.SetActive(_leaderData.rolePropData.RealmLV > 0);
|
| | | var _realmCfg = Config.Instance.Get<RealmConfig>(_leaderData.rolePropData.RealmLV);
|
| | |
| | | m_BossIntroduce.gameObject.SetActive(false);
|
| | | m_ContainerMonster.gameObject.SetActive(true);
|
| | | m_BossIntroduce.Dispose();
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(model.selectedBoss, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_MonsterPortrait);
|
| | | UI3DModelExhibition.Instance.ShowNPC(model.selectedBoss, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_MonsterPortrait);
|
| | | m_MonsterLevel.text = Language.Get("Z1024", npcConfig.NPCLV);
|
| | | break;
|
| | | case 2:
|
| | |
| | | m_ContainerMonster.gameObject.SetActive(true);
|
| | | m_BossIntroduce.Dispose();
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(_bossId);
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(_bossId, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_MonsterPortrait);
|
| | | UI3DModelExhibition.Instance.ShowNPC(_bossId, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_MonsterPortrait);
|
| | | m_MonsterLevel.text = Language.Get("Z1024", npcConfig.NPCLV);
|
| | | break;
|
| | | case 2:
|
| | |
| | |
|
| | | public void Dispose()
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | |
|
| | | private void LateUpdate()
|
| | |
| | | var config = Config.Instance.Get<NPCConfig>(bossId);
|
| | | m_BossName.text = config.charName;
|
| | | m_BossLevel.text = Language.Get("Z1024", config.NPCLV);
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(bossId, config.UIModeLOffset, config.UIModelRotation, m_BossPortrait);
|
| | | UI3DModelExhibition.Instance.ShowNPC(bossId, config.UIModeLOffset, config.UIModelRotation, m_BossPortrait);
|
| | | m_BossAbility.Display(bossId);
|
| | | }
|
| | |
|
| | | protected virtual void DrawReward()
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | m_ViewType = ViewType.Reward;
|
| | | m_ContainerReward.gameObject.SetActive(true);
|
| | | m_ContainerBossInfo.gameObject.SetActive(false);
|
| | |
| | | private Dictionary<string, MailInfo> mailModelDict = new Dictionary<string,MailInfo>();
|
| | | private List<MailInfo> timeOrderMailInfo = new List<MailInfo>();
|
| | | private Regex smatch = new Regex(@"<MailTemplate>([^>.\n]*)</MailTemplate>([^>.\n]*)", RegexOptions.Singleline);
|
| | | private Regex smatchSystem = new Regex(@"[\\]*\/[\\]*", RegexOptions.Singleline);
|
| | |
|
| | | public string mailTitleStr = "";
|
| | | public string mailContentstr = "";
|
| | | public string mailSendPersonStr = "";
|
| | |
| | | public void GetReciveMailContent(MailInfo info)
|
| | | {
|
| | | Debug.Log(info.Text);
|
| | | info.Text = smatchSystem.Replace(info.Text, "/");
|
| | | if (smatch.IsMatch(info.Text))
|
| | | {
|
| | | Match match = smatch.Match(info.Text);
|
| | |
| | |
|
| | | if(mailContentArray.Length > 2)
|
| | | {
|
| | | string mailDes = Regex.Replace(mailContentArray[2], @"<[\\]+/r>", "</r>");
|
| | | string mailDes = mailContentArray[2];
|
| | | mailContentstr = mailDes;
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | StringBuilder todayDailySB = new StringBuilder();
|
| | | List<int> dailyIdlist = new List<int>();
|
| | | public string GetTodayDailyNotify(DateTime getTime)
|
| | | {
|
| | | dailyIdlist.Clear();
|
| | | todayDailySB.Length = 0;
|
| | | var dayOfWeek = (int)getTime.DayOfWeek;
|
| | | var quests = dailyModel.GetQuestByWeekTime(dayOfWeek % 7);
|
| | |
| | | int openTime = openTimelist[i];
|
| | | for (int j = 0;j < quests[openTime].Count; j++)
|
| | | {
|
| | | if(dailyIdlist.Contains(quests[openTime][j]))
|
| | | {
|
| | | continue;
|
| | | }
|
| | | dailyIdlist.Add(quests[openTime][j]);
|
| | | DailyQuestOpenTime dailyQuestOpenTime;
|
| | | dailyModel.TryGetOpenTime(quests[openTime][j], out dailyQuestOpenTime);
|
| | | if (dailyQuestOpenTime.IsValidServerOpenTime())
|
| | |
| | | int needToolCnt = 0;
|
| | | if (IsHaveManyXBTool(xbType, out toolCnt, out needToolCnt))
|
| | | {
|
| | | needToolCnt = needToolCnt - toolCnt;
|
| | | int needMoney = needToolCnt * funcSet.xbPrices[0];
|
| | | if (needMoney > 0)
|
| | | if(toolCnt >= needToolCnt)
|
| | | {
|
| | | ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(funcSet.costToolIds[1]);
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("HappyXBCostTools", funcSet.costToolNums[1], itemConfig.ItemName, needMoney, needToolCnt), (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | CheckXBManyLimit(needMoney, xbType);
|
| | | }
|
| | | return;
|
| | | });
|
| | | CheckXBManyLimit(0, xbType, 2);
|
| | | }
|
| | | else
|
| | | {
|
| | | CheckXBManyLimit(0, xbType);
|
| | | CheckXBManyLimit(funcSet.xbPrices[1], xbType,0);
|
| | | }
|
| | | //needToolCnt = needToolCnt - toolCnt;
|
| | | //int needMoney = needToolCnt * funcSet.xbPrices[0];
|
| | | //if (needMoney > 0)
|
| | | //{
|
| | | // ItemConfig itemConfig = Config.Instance.Get<ItemConfig>(funcSet.costToolIds[1]);
|
| | | // ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("HappyXBCostTools", funcSet.costToolNums[1], itemConfig.ItemName, needMoney, needToolCnt), (bool isOk) =>
|
| | | // {
|
| | | // if (isOk)
|
| | | // {
|
| | | // CheckXBManyLimit(needMoney, xbType,0);
|
| | | // }
|
| | | // return;
|
| | | // });
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // CheckXBManyLimit(0, xbType,2);
|
| | | //}
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | CheckXBManyLimit(funcSet.xbPrices[1],xbType);
|
| | | CheckXBManyLimit(funcSet.xbPrices[1],xbType,0);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | public void CheckXBManyLimit(int needMoney,int xbtype)
|
| | | public void CheckXBManyLimit(int needMoney,int xbtype,int costType)
|
| | | {
|
| | | if (UIHelper.GetMoneyCnt(1) >= (ulong)needMoney)
|
| | | {
|
| | | SendXBQuest(xbtype, 1, 2);
|
| | | SendXBQuest(xbtype, 1, costType);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | public const string defaultHttpContentType = "application/x-www-form-urlencoded";
|
| | | public const string jsonHttpContentType = "application/json ; charset=utf-8";
|
| | |
|
| | | public void RequestWWW(string _url, int _retry = 3, Action<bool, string> _result = null)
|
| | | {
|
| | | StartCoroutine(Co_RequestWWW(_url, null, _retry, _result));
|
| | | }
|
| | |
|
| | | public void RequestWWW(string _url, IDictionary<string, string> _parameters, int _retry = 3, Action<bool, string> _result = null)
|
| | | {
|
| | | StartCoroutine(Co_RequestWWW(_url, _parameters, _retry, _result));
|
| | | }
|
| | |
|
| | | IEnumerator Co_RequestWWW(string _url, IDictionary<string, string> _parameters, int _retry = 3, Action<bool, string> _result = null)
|
| | | {
|
| | | if (_url == null || _url.Length == 0)
|
| | | {
|
| | | DebugEx.LogError("PHPDataComm post 参数有错");
|
| | | if (_result != null)
|
| | | {
|
| | | _result(false, string.Empty);
|
| | | _result = null;
|
| | | }
|
| | | yield break;
|
| | | }
|
| | |
|
| | | int i = 0;
|
| | | bool isSuccess = false;
|
| | |
|
| | | byte[] data = null;
|
| | | if (_parameters != null)
|
| | | {
|
| | | data = Encoding.UTF8.GetBytes(HashtablaToString(_parameters));
|
| | | }
|
| | |
|
| | | var PostData = data == null ? new WWW(_url) : new WWW(_url, data);
|
| | |
|
| | | while (!PostData.isDone)
|
| | | {
|
| | | yield return null;
|
| | | }
|
| | |
|
| | | if (PostData.error != null)
|
| | | {
|
| | | Debug.LogErrorFormat("WWW 数据通信,请求数据失败:{0},已经尝试,{1},次", PostData.error, i);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (!string.IsNullOrEmpty(PostData.text))
|
| | | {
|
| | | DebugEx.LogFormat("WWW 数据通信,请求数据成功:{0}", PostData.text);
|
| | | isSuccess = true;
|
| | | if (_result != null)
|
| | | {
|
| | | _result(true, PostData.text);
|
| | | _result = null;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (!isSuccess)
|
| | | {
|
| | | if (_result != null)
|
| | | {
|
| | | _result(false, string.Empty);
|
| | | _result = null;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void RequestHttpPost(string _url, IDictionary<string, string> _parameters, string _contentType, int _retry = 3, Action<bool, string> _result = null)
|
| | | {
|
| | | var content = HashtablaToString(_parameters);
|
| | |
| | | dogzModel.CheckPutOff(dogzModel.GetDogzEquipPlaceByIndex(attrData.index));
|
| | | });
|
| | |
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.strength, (ItemWinBtnType, ItemAttrData) => {
|
| | | dogzModel.OpenDogzFuncEvent(1);
|
| | | });
|
| | | if(dogzModel.TryGetAssistDogzState(dogzModel.presentSelectDogz))
|
| | | {
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.strength, (ItemWinBtnType, ItemAttrData) => {
|
| | | dogzModel.OpenDogzFuncEvent(1, attrData.index);
|
| | | });
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | UI3DTreasureExhibition.Instance.BeginShowTreasure(id, modelImg);
|
| | | break;
|
| | | case ModelShowType.mount:
|
| | | UI3DModelExhibition.Instance.BeginShowHourse(id, modelImg);
|
| | | UI3DModelExhibition.Instance.ShowHourse(id, modelImg);
|
| | | break;
|
| | | case ModelShowType.pet:
|
| | | var config = Config.Instance.Get<NPCConfig>(id);
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(id, config.UIModeLOffset, config.UIModelRotation, modelImg);
|
| | | UI3DModelExhibition.Instance.ShowNPC(id, config.UIModeLOffset, config.UIModelRotation, modelImg);
|
| | | break;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | protected override void OnAfterClose() {
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | UI3DModelExhibition.Instance.BeginShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
|
| | | UI3DModelExhibition.Instance.ShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
|
| | | playerPack.RefreshAttrActiveAct += ControlEffect;
|
| | | playerPack.ItemCntAddAct += PutOnEquip;
|
| | | playerPack.ItemCntReduceAct += PutOffEquip;
|
| | |
| | | {
|
| | | if (typeof(PetMatInfoWin).Name != window.name && typeof(ItemInfoWin).Name != window.name) return;
|
| | |
|
| | | UI3DModelExhibition.Instance.BeginShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
|
| | | UI3DModelExhibition.Instance.ShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | |
| | | {
|
| | | _roleEquipDict.Add(itemModel.itemInfo.ItemPlace,itemModel);
|
| | | }
|
| | | UI3DModelExhibition.Instance.BeginShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
|
| | | UI3DModelExhibition.Instance.ShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
|
| | |
|
| | | }
|
| | |
|
| | |
| | |
|
| | | ClearEquipInfo(place);
|
| | | equipArealist[(RoleEquipType)place].transform.Find("ItemCell").gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.BeginShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
|
| | | UI3DModelExhibition.Instance.ShowPlayer(RoleShowBG, PlayerDatas.Instance.baseData.Job);
|
| | | }
|
| | |
|
| | | private void OnClickEquipIntensify(GameObject go)
|
| | |
| | | else if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Sp)
|
| | | {
|
| | | send.IDType = 3;
|
| | | send.ExtraLen = (byte)SDKUtility.Instance.FreePlatformInfo.sessionID.Length;
|
| | | send.Extra = SDKUtility.Instance.FreePlatformInfo.sessionID;
|
| | | }
|
| | | send.AccID = sdkLoginResult.account;
|
| | | send.Password = sdkLoginResult.token;
|
| | |
| | | send.AppID = VersionConfig.Get().appId;
|
| | | send.AccountID = (uint)sdkLoginResult.accountID;// 内部登陆的时候的id
|
| | | send.TokenExpire = sdkLoginResult.tokenExpire;// 内部登陆的时长,无所谓的
|
| | | if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Sp)
|
| | | {
|
| | | send.TokenExpire = SDKUtility.Instance.FreePlatformInfo.timeStamp;
|
| | | }
|
| | | send.Phone = (byte)sdkLoginResult.phone;
|
| | | send.ServerID = (uint)ServerListCenter.Instance.currentServer.region_flag;
|
| | | if (sdkIDCheckIDAuthentication.type == "1")
|
| | |
| | |
|
| | | int playerJob = PlayerDatas.Instance.baseData.Job;
|
| | |
|
| | | UI3DModelExhibition.Instance.BeginShowPlayer(m_playerIcon, playerJob, true);
|
| | | UI3DModelExhibition.Instance.ShowPlayer(m_playerIcon, playerJob, true);
|
| | |
|
| | | m_PlayerNameText.text = PlayerDatas.Instance.baseData.PlayerName;
|
| | |
|
| | |
| | |
|
| | | string npcIcon = configStoryMissions.NpcIcon[IsMultistage];
|
| | |
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(npcId, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_NPCIcon, false, true);
|
| | | UI3DModelExhibition.Instance.ShowNPC(npcId, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_NPCIcon, false, true);
|
| | | }
|
| | | typesPeaker = type;
|
| | | }
|
| | |
| | | Pet = 6,//灵宠
|
| | | Horse = 8,//坐骑
|
| | | Wing = 97,//翅膀
|
| | | GossipFurnace = 87,//八卦炉
|
| | | GossipFurnace = 143,//八卦炉
|
| | | } |
| | | |
| | | public class FeatureNoticeWin : Window |
| | |
| | | }
|
| | | protected override void OnPreClose() |
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowNPC(); |
| | | UI3DModelExhibition.Instance.StopShowHourse();
|
| | | UI3DModelExhibition.Instance.StopShowWing(); |
| | | UI3DModelExhibition.Instance.StopShow(); |
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | UI3DModelExhibition.Instance.StopShow(); |
| | | UI3DTreasureExhibition.Instance.StopShow(); |
| | | }
|
| | | protected override void OnAfterClose() |
| | |
| | | m_TextShowB.gameObject.SetActive(false);
|
| | | m_TextShowC.gameObject.SetActive(false);
|
| | | m_TextShowD.gameObject.SetActive(false);
|
| | | m_TextAdvanceName.text = "?";
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | m_TextShowB.gameObject.SetActive(true);
|
| | | m_TextShowC.gameObject.SetActive(true);
|
| | | m_TextShowD.gameObject.SetActive(true);
|
| | | m_TextAdvanceName.text = functionForecastConfig.FuncName;
|
| | | }
|
| | | m_TextAdvanceName.text = functionForecastConfig.FuncName;
|
| | | |
| | | DisplayIcon(ClickFuncID);
|
| | | string[] StrList = ConfigParse.GetMultipleStr(functionForecastConfig.Content);
|
| | | if (StrList.Length > 0)
|
| | |
| | | m_RawImage3.gameObject.SetActive(false);
|
| | | m_RawImage4.gameObject.SetActive(false);
|
| | | m_FeaturesImage.gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | UI3DModelExhibition.Instance.StopShowHourse();
|
| | | UI3DModelExhibition.Instance.StopShowWing();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | UI3DTreasureExhibition.Instance.StopShow();
|
| | | var functionForecastConfig = Config.Instance.Get<FunctionForecastConfig>(ClickFuncID);
|
| | | bool Type = false;
|
| | |
| | | case (int)FeatureNoticeEnum.Pet:
|
| | | m_RawImage1.gameObject.SetActive(true);
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(50106001);
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(50106001, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_RawImage1);
|
| | | UI3DModelExhibition.Instance.ShowNPC(50106001, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_RawImage1);
|
| | | break;
|
| | | case (int)FeatureNoticeEnum.Horse:
|
| | | m_RawImage2.gameObject.SetActive(true);
|
| | | HorseConfig _model = Config.Instance.Get<HorseConfig>(100);
|
| | | UI3DModelExhibition.Instance.BeginShowHourse(_model.Model, m_RawImage2);
|
| | | UI3DModelExhibition.Instance.ShowHourse(_model.Model, m_RawImage2);
|
| | | break;
|
| | | case (int)FeatureNoticeEnum.Wing:
|
| | | m_RawImage3.gameObject.SetActive(true);
|
| | |
| | | {
|
| | | var config = Config.Instance.Get<WingRefineExpConfig>(3711);
|
| | | int _modelID = config.Model;
|
| | | UI3DModelExhibition.Instance.BeginShowWing(_modelID, vec3, m_RawImage3);
|
| | | UI3DModelExhibition.Instance.ShowWing(_modelID, vec3, m_RawImage3);
|
| | | }
|
| | | else if (job == 2)
|
| | | {
|
| | | var config = Config.Instance.Get<WingRefineExpConfig>(3721);
|
| | | int _modelID = config.Model;
|
| | | UI3DModelExhibition.Instance.BeginShowWing(_modelID, vec3, m_RawImage3);
|
| | | UI3DModelExhibition.Instance.ShowWing(_modelID, vec3, m_RawImage3);
|
| | | }
|
| | | break;
|
| | | case (int)FeatureNoticeEnum.GossipFurnace:
|
| | |
| | | }
|
| | | }
|
| | | m_TextUnopened.gameObject.SetActive(true);
|
| | | m_TextUnopened.text = string.Format(Language.Get("NextYGLimit"), NeedLv, functionForecastConfig.FuncName);
|
| | | m_TextUnopened.text = string.Format(Language.Get("NextYGLimit"), NeedLv);
|
| | | return;
|
| | | }
|
| | | if (funcoPenConfig.LimitMagicWeapon != 0 || funcoPenConfig.LimitMissionID != 0)
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | m_FunctionName.text = functionForecastConfig.FuncName;
|
| | | |
| | | m_FunctionalLevel.text = functionForecastConfig.DisplayLevel.ToString()+ Language.Get("Z1041");
|
| | |
|
| | | bool Type = false;
|
| | |
| | | }
|
| | | if (!FuncOpen.Instance.IsFuncOpen(funcId) && Type && NeedLv > playerLv)
|
| | | {
|
| | | m_FunctionName.text = "?";
|
| | | m_FeaturesTypeIcon.SetSprite("UnKnowIcon");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_FunctionName.text = functionForecastConfig.FuncName;
|
| | | m_FeaturesTypeIcon.SetSprite(functionForecastConfig.FuncIconKey);
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | m_FunctionName.text = functionForecastConfig.FuncName;
|
| | | |
| | | m_FunctionalLevel.text = functionForecastConfig.DisplayLevel.ToString()+Language.Get("Z1041");
|
| | | bool Type = false;
|
| | | int NeedLv = 0;
|
| | |
| | | if (!FuncOpen.Instance.IsFuncOpen(funcId) && Type && NeedLv> playerLv)
|
| | | {
|
| | | m_FeaturesTypeIcon.SetSprite("UnKnowIcon");
|
| | | m_FunctionName.text = "?";
|
| | | }
|
| | | else
|
| | | {
|
| | | m_FunctionName.text = functionForecastConfig.FuncName;
|
| | | m_FeaturesTypeIcon.SetSprite(functionForecastConfig.FuncIconKey);
|
| | | }
|
| | | if (PlayerDatas.Instance.baseData.LV >= functionForecastConfig.DisplayLevel)
|
| | |
| | | }
|
| | | if (!AnimationFadeOutDicLow.ContainsKey(highBtnRecord.Index))
|
| | | {
|
| | | if (isPlayerUIeffect.RedPointId == 201 || isPlayerUIeffect.RedPointId == 210)
|
| | | if (isPlayerUIeffect.RedPointId == 201 /*|| isPlayerUIeffect.RedPointId == 210*/)//201(福利),210(仙宝寻主)
|
| | | {
|
| | | if (RedpointCenter.Instance.GetRedpointState(isPlayerUIeffect.RedPointId) == RedPointState.GetReward)
|
| | | {
|
| | |
| | | void DownButton(GameObject go)
|
| | | {
|
| | | _ExpRate.gameObject.SetActive(true);
|
| | |
|
| | | // WindowCenter.Instance.Open<WheelOfFortuneWin>();
|
| | | }
|
| | | void UpButton(GameObject go)
|
| | | {
|
| | |
| | |
|
| | | if (allMissionDict.ContainsKey(MissionID))
|
| | | {
|
| | | int missionState = allMissionDict[MissionID].MissionState;
|
| | | if (allMissionDict[MissionID].MissionState != MissionState && MissionState == 3 && AutomaticityBool)
|
| | | {
|
| | | if (CompletionOfTaskEvent != null)
|
| | |
| | | }
|
| | | TaskChanges(MissionID, MissionState, DiscriptionIndex);//任务的状态修改
|
| | |
|
| | | if (Event_TaskRefreshes != null)//刷新任务
|
| | | if (missionState == 0 && (MissionState == 1 || MissionState==2))
|
| | | {
|
| | | Event_TaskRefreshes(MissionID);
|
| | | if (Event_TaskToAdd != null)//任务添加(用于存储于身上的未接取任务的特殊处理)
|
| | | {
|
| | | Event_TaskToAdd(MissionID, MissionState, DiscriptionIndex);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (Event_TaskRefreshes != null)//刷新任务
|
| | | {
|
| | | Event_TaskRefreshes(MissionID);
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | |
| | | [SerializeField] Button m_OpenNowBtn;
|
| | | [SerializeField] Button m_GoToBtn; |
| | | [SerializeField] Button m_ClaoseBtn; |
| | | [SerializeField] Image m_Image;//孔数 |
| | | PlayerMainDate m_MainModel;
|
| | | PlayerMainDate mainModel { get { return m_MainModel ?? (m_MainModel = ModelCenter.Instance.GetModel<PlayerMainDate>()); } }
|
| | | PlayerTaskDatas m_TaskModel;
|
| | |
| | | if (taskinfo != null)
|
| | | {
|
| | | m_Text_Condition_1.text = taskinfo.show_writing;
|
| | | if (taskmodel._DicTaskInformation.ContainsKey(mainModel.TaskSkillID))
|
| | | {
|
| | | Dictionary<string, string> SkillDic = new Dictionary<string, string>();
|
| | | SkillDic = taskmodel._DicTaskInformation[mainModel.TaskSkillID];
|
| | | string strA = "on_kill_" + mainModel.TaskSkillID.ToString();
|
| | | string strB = "get_byid_" + mainModel.TaskSkillID.ToString();
|
| | | m_Text_Condition_1.SetReplaceInfo(SkillDic);
|
| | | }
|
| | | }
|
| | | if (mainModel.TaskId_Skill.Contains(mainModel.TaskSkillID))
|
| | | {
|
| | | int Index = mainModel.TaskId_Skill.IndexOf(mainModel.TaskSkillID);
|
| | | m_Text_Reward_1.text = string.Format(Language.Get("PassiveSkillTask1"), (mainModel.SkillIndex[Index] + 1));
|
| | | SetImageSprite(mainModel.SkillIndex[Index] + 1);
|
| | | m_NeedMoney_Text.text = string.Format(Language.Get("PassiveSkillTask2"), mainModel.NeedFairyJade[Index]);
|
| | | }
|
| | | } |
| | |
| | | if (Gold >= NeedMoney)
|
| | | {
|
| | | taskmodel.CompletionOfTask(mainModel.TaskSkillID);
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.SkillFunc2);
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.SkillFunc2Type2);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | m_Text_Condition_1.ExcuteHref();
|
| | |
|
| | | // Close();
|
| | | }
|
| | |
|
| | | private void SetImageSprite(int Index)
|
| | | {
|
| | | switch (Index)
|
| | | {
|
| | | case 1:
|
| | | m_Image.SetSprite("Slot_1");
|
| | | break;
|
| | | case 2:
|
| | | m_Image.SetSprite("Slot_2");
|
| | | break;
|
| | | case 3:
|
| | | m_Image.SetSprite("Slot_3");
|
| | | break;
|
| | | case 4:
|
| | | m_Image.SetSprite("Slot_4");
|
| | | break;
|
| | | case 5:
|
| | | m_Image.SetSprite("Slot_5");
|
| | | break;
|
| | | case 6:
|
| | | m_Image.SetSprite("Slot_6");
|
| | | break;
|
| | |
|
| | | }
|
| | | } |
| | | #endregion |
| | |
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.SkillFunc2);
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.SkillFunc2Type2);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | firstTimeRechargeModel.OpenFirstChargeTrialWin();
|
| | | }
|
| | | else if(!WindowCenter.Instance.CheckOpen<PetAndMountPushWin>()) //灵宠坐骑推送
|
| | | else if(!WindowCenter.Instance.CheckOpen<PetAndMountPushWin>()
|
| | | && !WindowCenter.Instance.CheckOpen<OffLineOnHookWin>()) //灵宠坐骑推送
|
| | | {
|
| | | storeModel.SetPushPetAndMountWinState();
|
| | | }
|
| | |
| | | if (PutawayData.Instance.itemModel == null) return; |
| | | if (PlayerDatas.Instance.market.putawayCnt >= model.totalPutawayCnt) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("MarketNoPutaway4", model.totalPutawayCnt); |
| | | return; |
| | | } |
| | | if (PutawayData.Instance.priceCnt == 0) |
| | |
| | | public static Regex Color_Start_Regex = new Regex(@"<color=#[0-9a-zA-Z]+>", RegexOptions.Singleline);
|
| | | public static Regex Color_End_Regex = new Regex(@"</color>", RegexOptions.Singleline);
|
| | | public static Regex Space_Regex = new Regex(@"<Space=([0-9]*)>", RegexOptions.Singleline);
|
| | | public static Regex Size_Start_Regex = new Regex(@"<Size=([0-9]+)>", RegexOptions.Singleline);
|
| | | public static Regex Size_End_Regex = new Regex(@"</Size>", RegexOptions.Singleline);
|
| | | public static Regex Size_Start_Regex = new Regex(@"<[Ss]ize=([0-9]+)>", RegexOptions.Singleline);
|
| | | public static Regex Size_End_Regex = new Regex(@"</[Ss]ize>", RegexOptions.Singleline);
|
| | |
|
| | | private static RichTextEventEnum eventType = RichTextEventEnum.TABLE;
|
| | |
|
| | |
| | | if (HorseID != mount_ID)
|
| | | {
|
| | | HorseConfig _model = Config.Instance.Get<HorseConfig>(HorseID);
|
| | | UI3DModelExhibition.Instance.BeginShowHourse(_model.Model, m_MountRawImg);
|
| | | UI3DModelExhibition.Instance.ShowHourse(_model.Model, m_MountRawImg);
|
| | | mount_ID = HorseID;
|
| | | if (UI3DModelExhibition.Instance.NpcModelHorse != null)
|
| | | {
|
| | |
| | | RidingAndPetActivationWin.FairyJadeDEvent -= FairyJadeDEvent;
|
| | | FlySkillIconWin.FairyJadeDEvent -= FairyJadeDEvent;
|
| | | OnClickStopDomesticateBtn();
|
| | | UI3DModelExhibition.Instance.StopShowHourse();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | |
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | OperationTimeHepler.Instance.dayResetEvent -= DayResetEvent;
|
| | | m_Time.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | void DisplayTime(int seconds)
|
| | |
| | | [Header("仙玉投资")]
|
| | | FairyInvest,
|
| | | [Header("VIP投资")]
|
| | | VipInvest
|
| | | VipInvest,
|
| | | [Header("仙盟联赛预告")]
|
| | | FairyLeagueNotice,
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return m_OSRedEnvelopeModel ?? (m_OSRedEnvelopeModel = ModelCenter.Instance.GetModel<OSRedEnvelopeModel>());
|
| | | }
|
| | | }
|
| | | FairyLeagueModel fairyLeagueModel { get { return ModelCenter.Instance.GetModel<FairyLeagueModel>(); } }
|
| | |
|
| | | List<int> openActivitys = new List<int>();
|
| | | List<int> priorityActivitys = new List<int>();
|
| | |
| | | impactRankModel.presentSelectType = impactDefaultType;
|
| | | impactRankModel.gotoImpactRankType = 0;
|
| | | envelopeModel.selectType = 1;
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | CheckAlreadyOpen();
|
| | | UpdateFunctionBtns();
|
| | | }
|
| | |
| | | TimeUtility.OnServerOpenDayRefresh -= OnStepServerDayEvent;
|
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent;
|
| | | OpenServerActivityCenter.Instance.openServerActivityStateChange -= OpenServerActivityStateChange;
|
| | | GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
|
| | | CloseOtherWin();
|
| | | impactRankModel.gotoImpactRankType = 0;
|
| | | }
|
| | |
| | | {
|
| | | openActivitys.Sort(Compare);
|
| | | return openActivitys[0];
|
| | | }
|
| | | }
|
| | |
|
| | | private void SecondEvent()
|
| | | {
|
| | | var cell = m_ActivityCtrl.GetActiveCellView((int)OpenServerActivityCenter.OSActivityType.FairyLeagueNotice);
|
| | | if (cell != null)
|
| | | {
|
| | | var activityCell = cell as OpenServerActivityCell;
|
| | | var seconds = fairyLeagueModel.GetBeforeFirstLeagueTime();
|
| | | if (seconds > 0)
|
| | | {
|
| | | activityCell.title.text = UIHelper.ReplaceNewLine(Language.Get("FairyLeagueForcast", TimeUtility.SecondsToHMS(seconds)));
|
| | | }
|
| | | else
|
| | | {
|
| | | activityCell.title.text = Language.Get("FamilyMatchName");
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.MultipRealmPoint, out operationBase))
|
| | | {
|
| | | _cell.title.text = Language.Get("MultipleRealmPoint", Language.Get(StringUtility.Contact("Num_CHS_", (operationBase as OperationMultipleRealmPoint).multiplePractice)));
|
| | | }
|
| | | break;
|
| | | case 12:
|
| | | var seconds = fairyLeagueModel.GetBeforeFirstLeagueTime();
|
| | | if (seconds > 0)
|
| | | {
|
| | | _cell.title.text = UIHelper.ReplaceNewLine(Language.Get("FairyLeagueForcast", TimeUtility.SecondsToHMS(seconds)));
|
| | | }
|
| | | else
|
| | | {
|
| | | _cell.title.text = Language.Get("FamilyMatchName");
|
| | | }
|
| | | break;
|
| | | default:
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<FairyJadeInvestmentWin>();
|
| | | WindowCenter.Instance.Open<FairyJadeInvestmentWin>(true);
|
| | | }
|
| | | break;
|
| | | case 11:
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<VipInvestWin>();
|
| | | WindowCenter.Instance.Open<VipInvestWin>(true);
|
| | | }
|
| | | break;
|
| | |
|
| | | case 12:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<FairyLeagueNoticeWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<FairyLeagueNoticeWin>(true);
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | WindowCenter.Instance.CloseImmediately<LimitedTimePackageWin>();
|
| | | WindowCenter.Instance.CloseImmediately<FairyJadeInvestmentWin>();
|
| | | WindowCenter.Instance.CloseImmediately<VipInvestWin>();
|
| | | WindowCenter.Instance.CloseImmediately<FairyLeagueNoticeWin>();
|
| | | }
|
| | |
|
| | | private int Compare(int order_x, int order_y)
|
| | |
| | | typePetID = PetID;
|
| | | timePlay = 0;
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(PetID);
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(PetID, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, _rawImage);
|
| | | UI3DModelExhibition.Instance.ShowNPC(PetID, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, _rawImage);
|
| | | if (UI3DModelExhibition.Instance.NpcModelPet != null)
|
| | | {
|
| | | var animator = UI3DModelExhibition.Instance.NpcModelPet.GetComponent<Animator>();
|
| | |
| | | HorseConfig Horseconfig = Config.Instance.Get<HorseConfig>(ActivateID);
|
| | | int InitFightPower = 0;
|
| | | InitFightPower += Horseconfig.InitFightPower;
|
| | | UI3DModelExhibition.Instance.BeginShowHourse(Horseconfig.Model, m_RawImageMount);
|
| | | UI3DModelExhibition.Instance.ShowHourse(Horseconfig.Model, m_RawImageMount);
|
| | | MountSkills.Clear();
|
| | | foreach (var key in mountModel.GetMountSkillAndItem.Keys)
|
| | | {
|
| | |
| | | HorseConfig Horseconfig = Config.Instance.Get<HorseConfig>(ActivateID);
|
| | | int InitFightPower = 0;
|
| | | InitFightPower += Horseconfig.InitFightPower;
|
| | | UI3DModelExhibition.Instance.BeginShowHourse(Horseconfig.Model, m_RawImageMount);
|
| | | UI3DModelExhibition.Instance.ShowHourse(Horseconfig.Model, m_RawImageMount);
|
| | | MountSkills.Clear();
|
| | | foreach (var key in mountModel.GetMountSkillAndItem.Keys)
|
| | | {
|
| | |
| | | m_RawImagePet.gameObject.SetActive(true);
|
| | | m_RawImageMount.gameObject.SetActive(false);
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(ActivateID);
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(ActivateID, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_RawImagePet);
|
| | | UI3DModelExhibition.Instance.ShowNPC(ActivateID, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_RawImagePet);
|
| | | PetInfoConfig petInfoConfig = Config.Instance.Get<PetInfoConfig>(ActivateID);
|
| | | int InitFightPower = int.Parse(petInfoConfig.InitFightPower);
|
| | | string StrPetSkill = petInfoConfig.SkillID;
|
| | |
| | | m_RawImageMount.gameObject.SetActive(false);
|
| | |
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(ActivateID);
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(ActivateID, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_RawImagePet);
|
| | | UI3DModelExhibition.Instance.ShowNPC(ActivateID, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_RawImagePet);
|
| | | // StartCoroutine("FrameDelay");
|
| | | PetInfoConfig petInfoConfig = Config.Instance.Get<PetInfoConfig>(ActivateID);
|
| | | int InitFightPower = int.Parse(petInfoConfig.InitFightPower);
|
| | |
| | | IsCanReborn = false;
|
| | | isOpenPrompting = true;
|
| | | this.deadCD = 0;
|
| | | localBossState = 0;
|
| | | localBossState = false;
|
| | | playerIsDie = false;
|
| | | }
|
| | |
|
| | |
| | | private DungeonOpenTimeConfig _dungeonOpenTimeModel;
|
| | |
|
| | | public bool IsCanReborn { get; private set; }
|
| | | public int localBossState { get; private set;}
|
| | | public bool localBossState { get; private set;}
|
| | | public string killerName { get; private set; }
|
| | | public bool isKillByPlayer { get; private set; }
|
| | | public int npcRealmLv { get; private set; }
|
| | | private void RefreshPlayerDieInfo(string key, ArrayList infolist)
|
| | | {
|
| | | npcRealmLv = 0;
|
| | | localBossState = false;
|
| | | switch (key)
|
| | | {
|
| | | case "PK_lhs_318691":
|
| | |
| | | case "GeRen_chenxin_279029":
|
| | | if(infolist.Count > 0)
|
| | | {
|
| | | WorldBossConfig bossConfig = Config.Instance.Get<WorldBossConfig>(int.Parse(infolist[0].ToString()));
|
| | | NPCConfig nPCConfig = Config.Instance.Get<NPCConfig>(int.Parse(infolist[0].ToString()));
|
| | | if(nPCConfig != null)
|
| | | {
|
| | | killerName = nPCConfig.charName;
|
| | | npcRealmLv = nPCConfig.Realm;
|
| | | }
|
| | | if(bossConfig != null)
|
| | | {
|
| | | localBossState = true;
|
| | | }
|
| | | isKillByPlayer = false;
|
| | | }
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | localBossState = PlayerDatas.Instance.extersion.bossState;
|
| | | playerIsDie = true;
|
| | | _tagMapModel = Config.Instance.Get<MapConfig>(PlayerDatas.Instance.baseData.MapID);
|
| | | if (_tagMapModel.MapFBType == 0)
|
| | |
| | | rebornTiredNum = RebornConditions[0];
|
| | | rebornPrice = RebornConditions[2];
|
| | | //isBossKill = StatusManager.Instance.IsExist((int)playerId,20022);
|
| | | if (!isKillByPlayer && localBossState == 1)
|
| | | if (!isKillByPlayer && localBossState)
|
| | | {
|
| | | autoRebornTime = RebornConditions[3];
|
| | | }
|
| | |
| | | if (PlayerDatas.Instance.baseData.PlayerID != data.PlayerID)
|
| | | return;
|
| | |
|
| | | localBossState = 0;
|
| | | localBossState = false;
|
| | | this.deadCD = 0;
|
| | | isKillByPlayer = false;
|
| | | playerIsDie = false;
|
| | |
| | | {
|
| | | questTimes = 0;
|
| | | _rebornPriceText.text = 1.ToString();
|
| | | if(DeadModel.isKillByPlayer || DeadModel.localBossState != 1)
|
| | | if(DeadModel.isKillByPlayer || !DeadModel.localBossState)
|
| | | {
|
| | | OnShowBtnlist();
|
| | | }
|
| | |
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | UI3DTreasureExhibition.Instance.StopShow();
|
| | | flying = false;
|
| | | }
|
| | |
| | | case ActivateShow.ActivateFunc.Realm:
|
| | | m_ModelRawImage.gameObject.SetActive(true);
|
| | | m_ModelRawImage.rectTransform.sizeDelta = new Vector2(680, 510);
|
| | | UI3DModelExhibition.Instance.BeginShowPlayer(m_ModelRawImage, PlayerDatas.Instance.baseData.Job, RoleEquipType.retWing);
|
| | | UI3DModelExhibition.Instance.ShowPlayer(m_ModelRawImage, PlayerDatas.Instance.baseData.Job, RoleEquipType.retWing);
|
| | | break;
|
| | | case ActivateShow.ActivateFunc.GodWeapon:
|
| | | m_ModelRawImage.gameObject.SetActive(true);
|
| | |
| | |
|
| | | [SerializeField] UIEffect m_RealmDungeonSfx;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerGroup;
|
| | | [SerializeField] Button m_Group;
|
| | | [SerializeField] Button m_AutoGroup;
|
| | | [SerializeField] Button m_GroupDungeon;
|
| | | [SerializeField] Button m_SingleDungeon;
|
| | | [SerializeField] Button m_FuncButton;
|
| | | [SerializeField] Text m_FuncButtonTxt;
|
| | | [SerializeField] Text m_RealmStageTip;
|
| | |
|
| | | [SerializeField] RectTransform m_ContainerFightPower;
|
| | |
| | | m_SingleDungeon.onClick.AddListener(SingleDungeon);
|
| | | m_FuncButton.onClick.AddListener(OnFunctionClick);
|
| | | m_RealmPreview.onClick.AddListener(OnRealmPreview);
|
| | | m_Group.onClick.AddListener(OpenGroup);
|
| | | m_AutoGroup.onClick.AddListener(AutoGroup);
|
| | | m_GroupDungeon.onClick.AddListener(GroupDungeon);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | |
| | | cacheRealmPoint = PlayerDatas.Instance.extersion.realmPoint;
|
| | | m_RawBoss.gameObject.SetActive(false);
|
| | | m_RawPlayer.gameObject.SetActive(false);
|
| | | m_ContainerGroup.gameObject.SetActive(false);
|
| | | overdueTime = DateTime.Now;
|
| | | Display();
|
| | | }
|
| | |
| | | StopBoss();
|
| | | m_RawBoss.gameObject.SetActive(false);
|
| | | m_RawPlayer.gameObject.SetActive(true);
|
| | | UI3DModelExhibition.Instance.BeginShowSitDownPlayer(m_RawPlayer, PlayerDatas.Instance.baseData.Job);
|
| | | UI3DModelExhibition.Instance.ShowSitDownPlayer(m_RawPlayer, PlayerDatas.Instance.baseData.Job);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent;
|
| | | WindowCenter.Instance.windowAfterCloseEvent -= WindowAfterCloseEvent;
|
| | | StopBoss();
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | realmModel.realmDungeonState = false;
|
| | | if (cacheCoroutine != null)
|
| | | {
|
| | |
| | | yield return WaitingForSecondConst.WaitMS800;
|
| | | var config = Config.Instance.Get<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
|
| | | m_RawPlayer.gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(m_DelayEnterTime > 0 ? m_DelayEnterTime : 1f);
|
| | | StartBoss(config, true);
|
| | | }
|
| | |
| | | m_RawPlayer.gameObject.SetActive(true);
|
| | | StopBoss();
|
| | | m_RawBoss.gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.BeginShowSitDownPlayer(m_RawPlayer, PlayerDatas.Instance.baseData.Job);
|
| | | UI3DModelExhibition.Instance.ShowSitDownPlayer(m_RawPlayer, PlayerDatas.Instance.baseData.Job);
|
| | | }
|
| | | else if (_realmPoint >= config.NeedGood)
|
| | | {
|
| | | m_RawBoss.gameObject.SetActive(true);
|
| | | m_RawPlayer.gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | StartBoss(config);
|
| | | }
|
| | | }
|
| | |
|
| | | private void StopBoss()
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | |
|
| | | private void StartBoss(RealmConfig config, bool act = false)
|
| | | {
|
| | | StopBoss();
|
| | | m_RawBoss.gameObject.SetActive(true);
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(config.BossID, config.IsBigRealm == 1 ? Vector3.zero : direction, m_RawBoss, false);
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | UI3DModelExhibition.Instance.ShowNPC(config.BossID, config.IsBigRealm == 1 ? Vector3.zero : direction, m_RawBoss, false);
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(config.BossID);
|
| | | var npcModel = UI3DModelExhibition.Instance.NpcModelPet;
|
| | | m_RawBoss.transform.localPosition = config.IsBigRealm == 1 ? m_BossPositions[1] : m_BossPositions[0];
|
| | |
| | | {
|
| | | var _realmPoint = PlayerDatas.Instance.extersion.realmPoint;
|
| | | var config = Config.Instance.Get<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
|
| | | m_FuncButton.gameObject.SetActive(!realmModel.IsRealmHighest);
|
| | | m_SingleDungeon.gameObject.SetActive(false);
|
| | | if (_realmPoint >= config.NeedPoint)
|
| | | {
|
| | | m_FuncButtonTxt.text = Language.Get(config.IsBigRealm == 1 ? "RealmWin_Bewrite_13" : "RealmWin_Bewrite_12");
|
| | | m_SingleDungeon.gameObject.SetActive(config.IsBigRealm == 1 && !realmModel.IsRealmHighest);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_FuncButtonTxt.text = Language.Get("RealmWin_Bewrite_1");
|
| | | }
|
| | | bool satisfyChallenge = _realmPoint >= config.NeedPoint;
|
| | | m_Group.gameObject.SetActive(!realmModel.IsRealmHighest && config.IsBigRealm == 1 && satisfyChallenge);
|
| | | m_SingleDungeon.gameObject.SetActive(!realmModel.IsRealmHighest && satisfyChallenge);
|
| | | m_FuncButton.gameObject.SetActive(!realmModel.IsRealmHighest && !satisfyChallenge);
|
| | | }
|
| | |
|
| | | private void OnFunctionClick()
|
| | | {
|
| | | var _realmPoint = PlayerDatas.Instance.extersion.realmPoint;
|
| | | var config = Config.Instance.Get<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
|
| | | if (_realmPoint >= config.NeedPoint)
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.DailyQuestFunc1);
|
| | | }
|
| | |
|
| | | private void GroupDungeon()
|
| | | {
|
| | | if (DateTime.Now < overdueTime)
|
| | | {
|
| | | if (DateTime.Now < overdueTime)
|
| | | {
|
| | | return;
|
| | | }
|
| | | PlayerDatas.Instance.realm.realmHelpList.Clear();
|
| | | if (config.IsBigRealm == 1)
|
| | | {
|
| | | var teamModel = ModelCenter.Instance.GetModel<TeamModel>();
|
| | | if (teamModel.myTeam.inTeam && teamModel.myTeam.iamCaptainer)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<DungeonModel>().GroupChallenge(RealmModel.REALM_DUNGEON_ID, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | teamModel.missionBuf = teamModel.currentMission = new TeamMission(31110, 1);
|
| | | WindowCenter.Instance.Open<TeamFrameWin>(false, teamModel.myTeam.inTeam ? 1 : 0);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | ModelCenter.Instance.GetModel<DungeonModel>().SingleChallenge(RealmModel.REALM_DUNGEON_ID);
|
| | | }
|
| | | return;
|
| | | }
|
| | | if (PlayerDatas.Instance.baseData.MapID == RealmModel.REALM_DUNGEON_ID)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var teamModel = ModelCenter.Instance.GetModel<TeamModel>();
|
| | | if (teamModel.myTeam.inTeam && teamModel.myTeam.iamCaptainer)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<DungeonModel>().GroupChallenge(RealmModel.REALM_DUNGEON_ID, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.DailyQuestFunc1);
|
| | | teamModel.missionBuf = teamModel.currentMission = new TeamMission(31110, 1);
|
| | | WindowCenter.Instance.Open<TeamFrameWin>(false, teamModel.myTeam.inTeam ? 1 : 0);
|
| | | }
|
| | | }
|
| | |
|
| | | private void AutoGroup()
|
| | | {
|
| | | if (DateTime.Now < overdueTime)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var teamModel = ModelCenter.Instance.GetModel<TeamModel>();
|
| | | teamModel.RequestAutoMatchTeam(new TeamMission(RealmModel.REALM_DUNGEON_ID, 1));
|
| | | WindowCenter.Instance.Open<TeamFrameWin>(false, 1);
|
| | | }
|
| | |
|
| | | private void OpenGroup()
|
| | | {
|
| | | var opened = m_ContainerGroup.gameObject.activeSelf;
|
| | | if (!opened)
|
| | | {
|
| | | m_ContainerGroup.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | |
|
| | | private void SingleDungeon()
|
| | | {
|
| | | if (DateTime.Now < overdueTime)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (PlayerDatas.Instance.baseData.MapID == RealmModel.REALM_DUNGEON_ID)
|
| | | {
|
| | | return;
|
| | | }
|
| | | PlayerDatas.Instance.realm.realmHelpList.Clear();
|
| | | var _realmPoint = PlayerDatas.Instance.extersion.realmPoint;
|
| | | var config = Config.Instance.Get<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
|
| | | if (_realmPoint >= config.NeedPoint)
|
| | |
| | | OnUpdateSpecialAttr();
|
| | | OnUpdateLvExp();
|
| | | m_PlayerFightPower.text = PlayerDatas.Instance.baseData.FightPoint.ToString();
|
| | | UI3DModelExhibition.Instance.BeginShowPlayer(m_PlayerShowModel, PlayerDatas.Instance.baseData.Job);
|
| | | UI3DModelExhibition.Instance.ShowPlayer(m_PlayerShowModel, PlayerDatas.Instance.baseData.Job);
|
| | | OnRefreshRealm();
|
| | | OnRefreshWorldLv();
|
| | | }
|
| | |
| | |
|
| | | void OnDisableRole()
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | |
|
| | | protected override void BindController()
|
| | |
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowPlayer();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | | #endregion
|
| | |
|
| | |
| | | {
|
| | | weapon2 = itemData.ItemID;
|
| | | }
|
| | | UI3DModelExhibition.Instance.BeginShowOtherPlayer(roleModel, viewPlayerData.rolePropData.Job, clothes, _suitLevel, weapon, wing, weapon2);
|
| | |
|
| | | var data = new UI3DModelExhibition.UI3DPlayerExhibitionData {
|
| | | job = viewPlayerData.rolePropData.Job,
|
| | | clothesId = clothes,
|
| | | suitLevel = _suitLevel,
|
| | | weaponId=weapon,
|
| | | wingsId=wing,
|
| | | secondaryId=weapon2,
|
| | | };
|
| | | UI3DModelExhibition.Instance.ShowOtherPlayer(roleModel, data);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | m_RawModel.gameObject.SetActive(true);
|
| | | var config = Config.Instance.Get<HorseConfig>(id);
|
| | | UI3DModelExhibition.Instance.BeginShowHourse(config.Model, m_RawModel);
|
| | | UI3DModelExhibition.Instance.ShowHourse(config.Model, m_RawModel);
|
| | | if (UI3DModelExhibition.Instance.NpcModelHorse != null)
|
| | | {
|
| | | var animator = UI3DModelExhibition.Instance.NpcModelHorse.GetComponent<Animator>();
|
| | |
| | | {
|
| | | m_RawModel.gameObject.SetActive(true);
|
| | | var npcConfig = Config.Instance.Get<NPCConfig>(id);
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(id, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_RawModel);
|
| | | UI3DModelExhibition.Instance.ShowNPC(id, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_RawModel);
|
| | | if (UI3DModelExhibition.Instance.NpcModelPet != null)
|
| | | {
|
| | | var animator = UI3DModelExhibition.Instance.NpcModelPet.GetComponent<Animator>();
|
| | |
| | | guideSweep = false;
|
| | | WindowCenter.Instance.uiRoot.eventSystem.enabled = true;
|
| | | m_Tower.Dispose();
|
| | | UI3DModelExhibition.Instance.StopShowNPC();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | model.selectedFloorEvent -= OnSelectedFloorChange;
|
| | | dailyQuestModel.dailyQuestProgressUpdateEvent -= OnRuneTowerSweepResult;
|
| | | }
|
| | |
| | | m_BossName.text = npcConfig.charName;
|
| | | m_BossLevel.text = Language.Get("HeadUpName_Monster", npcConfig.NPCLV);
|
| | |
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(towerFloorConfig.BossId, new Vector3(0, 30, 0), m_BossPortrait);
|
| | | UI3DModelExhibition.Instance.ShowNPC(towerFloorConfig.BossId, new Vector3(0, 30, 0), m_BossPortrait);
|
| | |
|
| | | var challengable = !model.allTowerCompleted && model.selectedFloor == model.currentFloor;
|
| | | if (challengable)
|
| | |
| | | [SerializeField] RawImage rawImag;
|
| | | [SerializeField] Button closeBtn;
|
| | | [SerializeField] RichText m_Goto;
|
| | | [SerializeField] Text fightPower;
|
| | |
|
| | | StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | |
| | | titleText.text = Language.Get("StorePetPush");
|
| | | PetInfoConfig petInfo = tipsModel.unlockPetDict[storeConfig.ItemID];
|
| | | var config = Config.Instance.Get<NPCConfig>(petInfo.ID);
|
| | | UI3DModelExhibition.Instance.BeginShowNPC(petInfo.ID, config.UIModeLOffset, config.UIModelRotation,rawImag);
|
| | | fightPower.text = petInfo.ShowFightPower.ToString();
|
| | | UI3DModelExhibition.Instance.ShowNPC(petInfo.ID, config.UIModeLOffset, config.UIModelRotation,rawImag);
|
| | | break;
|
| | | case 41:
|
| | | titleText.text = Language.Get("StoreMountPush");
|
| | | HorseConfig horseConfig = tipsModel.unlockMountDict[storeConfig.ItemID];
|
| | | UI3DModelExhibition.Instance.BeginShowHourse(horseConfig.Model,rawImag);
|
| | | fightPower.text = horseConfig.ShowFightPower.ToString();
|
| | | UI3DModelExhibition.Instance.ShowHourse(horseConfig.Model,rawImag);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | NewBieCenter.Instance.guideBeginEvent -= GuidBegin;
|
| | | shopItemlimitDict.Clear();
|
| | | petAndMountPushlist.Clear();
|
| | | ClearPushData();
|
| | | tagTowerModel = null;
|
| | | storeFuncType = StoreFunc.WeekStore;
|
| | | tcbRefreshDict.Clear();
|
| | |
| | |
|
| | | private void GuidBegin()
|
| | | {
|
| | | SetPushPetAndMountWinState(true,true);
|
| | | PetAndMountPushWin pushWin = WindowCenter.Instance.Get<PetAndMountPushWin>();
|
| | | if(pushWin != null)
|
| | | {
|
| | | SetPushPetAndMountWinState(true, true);
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnMoveTopPart(bool isMove)
|
| | | {
|
| | | SetPushPetAndMountWinState(!isMove);
|
| | | if(!isLogin)
|
| | | {
|
| | | SetPushPetAndMountWinState(!isMove);
|
| | | }
|
| | | }
|
| | |
|
| | | private void windowAfterOpen(Window win)
|
| | |
| | |
|
| | | private void windowAfterClose(Window win)
|
| | | {
|
| | | if (isLogin) return;
|
| | |
|
| | | if(win is MainInterfaceWin)
|
| | | {
|
| | | SetPushPetAndMountWinState(true);
|
| | |
| | |
|
| | | [SerializeField] UIAlphaTween m_UIAlphaTween;
|
| | | [SerializeField] Slider m_Slider;
|
| | |
|
| | | [SerializeField] GameObject m_Text_two;//下级属性
|
| | | [SerializeField] Button m_StrengthenDoubleBtn;//双倍强化按钮
|
| | | [SerializeField] Text m_NeedFairy;//所需的仙玉
|
| | | [SerializeField] GameObject m_BottomBox;
|
| | | DogzModel Dogz_model;
|
| | | DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } } |
| | | private Dictionary<int, int> QualityLimit = new Dictionary<int, int>();
|
| | | DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } }
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
|
| | | ItemTipsModel _itemTipsModel;
|
| | |
| | | {
|
| | | m_DoubleToggle.onValueChanged.AddListener(OnClickToggle);
|
| | | m_StrengthenBtn.AddListener(OnClickStrengthBtn);
|
| | | m_StrengthenDoubleBtn.AddListener(OnClickStrengthBtn);
|
| | | } |
| | | private void OnEnable()
|
| | | {
|
| | |
| | | }
|
| | | private void OnDisable()
|
| | | {
|
| | | GodBeast_Number = 0;
|
| | | GodBeast_Part = 0;
|
| | | |
| | | GodBeastReinforcementWin.ChooseToModify -= ChooseToModify;
|
| | | godBeastModel.AbsorbEvent -= AbsorbEvent;
|
| | | }
|
| | |
|
| | | public void Init()
|
| | | {
|
| | | if (QualityLimit.Count <= 0)
|
| | | {
|
| | | string DogzAssist = Config.Instance.Get<FuncConfigConfig>("DogzAssist").Numerical4;//获取不同品质的神兽强化上限
|
| | | QualityLimit = ConfigParse.GetDic<int, int>(DogzAssist);
|
| | | }
|
| | | }
|
| | |
|
| | | public void Unit()
|
| | |
| | |
|
| | | private void OnClickToggle(bool Isbool)
|
| | | {
|
| | | AttributeAssignment();
|
| | | if (GodBeastNumber != 0 && GodBeastPart != 0)
|
| | | {
|
| | | AttributeAssignment();
|
| | | }
|
| | | |
| | | }
|
| | | private void OnClickStrengthBtn()
|
| | | {
|
| | |
| | | ListCount.Add(DicAb[key]);
|
| | | }
|
| | | if (m_DoubleToggle.isOn)
|
| | | { |
| | | {
|
| | | if (ListIndex.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 1);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (ListIndex.Count <= 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | dogz_model.SendDogzEquipStrength(m_DogZItemModel.itemInfo.ItemPlace, ListIndex, ListCount, 0);
|
| | | }
|
| | | }
|
| | |
|
| | | private void ChooseToModify(int locationMarker)
|
| | | {
|
| | | GetGodBeastLocationMarker(locationMarker);
|
| | | }
|
| | | private void AbsorbEvent()//选中取消的数据刷新
|
| | | private void AbsorbEvent()//选中与取消的数据刷新
|
| | | {
|
| | | GetDogZLevelAndExp();
|
| | | AttributeAssignment();
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | m_UIAlphaTween.gameObject.SetActive(true);
|
| | | m_FrameNull.SetActive(true);
|
| | | m_FullLevel.SetActive(false);
|
| | | m_FullLevel.SetActive(false); |
| | | GetDogZLevelAndExp();
|
| | | AttributeAssignment();
|
| | | }
|
| | | else
|
| | | {
|
| | | GodBeastNumber = 0;
|
| | | GodBeastPart = 0;
|
| | | m_ItemCell.gameObject.SetActive(false);
|
| | | m_ExpSlider.stage = 0;
|
| | | m_ExpSlider.delay = 0f;
|
| | | m_ExpSlider.ResetStage();
|
| | | m_ExpSlider.value = 0;
|
| | | m_ExpNum.text = "0/0";
|
| | | m_TextAttributes1.gameObject.SetActive(false);
|
| | | m_TextAttributes2.gameObject.SetActive(false);
|
| | | m_TextAttributesAdd1.gameObject.SetActive(false);
|
| | | m_TextAttributesAdd2.gameObject.SetActive(false);
|
| | | m_StrengthenDoubleBtn.gameObject.SetActive(false);
|
| | | m_Text_two.SetActive(false);
|
| | | m_FrameNull.SetActive(false);
|
| | | m_FullLevel.SetActive(false);
|
| | | m_UIAlphaTween.gameObject.SetActive(false);
|
| | | m_BottomBox.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | | GainProficiency();//获取熟练度
|
| | | m_BottomBox.SetActive(true);
|
| | | var IudetDogzEquipPlus = m_DogZItemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | int lv = QualityLimit[m_DogZItemModel.chinItemModel.ItemColor];
|
| | | int lv = godBeastModel.QualityLimit[m_DogZItemModel.chinItemModel.ItemColor];
|
| | | var DogzEquipConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, lv);
|
| | | if (DogZLv >= lv)
|
| | | {
|
| | | m_BottomBox.SetActive(false);
|
| | | m_Text_two.SetActive(false);
|
| | | m_FrameNull.SetActive(false);
|
| | | m_TextAttributes1.gameObject.SetActive(false);
|
| | | m_TextAttributes2.gameObject.SetActive(false);
|
| | | m_TextAttributesAdd1.gameObject.SetActive(false);
|
| | | m_TextAttributesAdd2.gameObject.SetActive(false);
|
| | | m_FullLevel.SetActive(true);
|
| | | GodBeast_Number = GodBeastNumber;
|
| | | GodBeast_Part = GodBeastPart;
|
| | | m_ExpSlider.stage = lv;
|
| | | m_ExpSlider.delay = 0f;
|
| | | m_ExpSlider.ResetStage();
|
| | | m_ExpSlider.value = 1;
|
| | | m_Slider.gameObject.SetActive(false);
|
| | | m_ExpNum.text = DogzEquipConfig.upExpTotal + "/" + DogzEquipConfig.upExpTotal;
|
| | | int NeedExp = DogzEquipConfig.upExpTotal;
|
| | | if (DogZLv > 0)
|
| | | {
|
| | | var Dogz_EquipConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, DogZLv - 1);
|
| | | NeedExp -= Dogz_EquipConfig.upExpTotal;
|
| | | }
|
| | | m_ExpNum.text = NeedExp + "/" + NeedExp;
|
| | | }
|
| | | else
|
| | | {
|
| | | |
| | | m_StrengthenDoubleBtn.interactable = true;
|
| | | m_StrengthenBtn.interactable = true;
|
| | | m_Text_two.SetActive(true);
|
| | | if (m_DoubleToggle.isOn)
|
| | | {
|
| | | m_StrengthenBtn.gameObject.SetActive(false);
|
| | | m_StrengthenDoubleBtn.gameObject.SetActive(true);
|
| | | m_NeedFairy.text = NeedFairyJade.ToString();
|
| | | PropertySetting(DogZExp, DoubleProficiency);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_StrengthenBtn.gameObject.SetActive(true);
|
| | | m_StrengthenDoubleBtn.gameObject.SetActive(false);
|
| | | PropertySetting(DogZExp, SingleProficiency);
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (m_DoubleToggle.isOn)
|
| | | {
|
| | | m_StrengthenBtn.gameObject.SetActive(false);
|
| | | m_StrengthenDoubleBtn.gameObject.SetActive(true);
|
| | | m_NeedFairy.text = NeedFairyJade.ToString();
|
| | | PropertySetting(0, DoubleProficiency);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_StrengthenBtn.gameObject.SetActive(true);
|
| | | m_StrengthenDoubleBtn.gameObject.SetActive(false);
|
| | | PropertySetting(0, SingleProficiency);
|
| | | }
|
| | | }
|
| | |
| | | m_LvNextText.text = "+" + toLv.ToString();
|
| | | }
|
| | | var DogzEquipConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, DogZLv);
|
| | | int NeedExp = DogzEquipConfig.upExpTotal;
|
| | | if (DogZLv > 0)
|
| | | {
|
| | | var Dogz_EquipConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, DogZLv - 1);
|
| | | NeedExp -= Dogz_EquipConfig.upExpTotal;
|
| | | }
|
| | | int[] AttType = ConfigParse.GetMultipleStr<int>(DogzEquipConfig.attType);
|
| | | int[] AttValue = ConfigParse.GetMultipleStr<int>(DogzEquipConfig.attValue);
|
| | | if (ToExpTotal == 0)
|
| | |
| | | m_Slider.gameObject.SetActive(false);
|
| | | m_TextAttributesAdd1.gameObject.SetActive(false);
|
| | | m_TextAttributesAdd2.gameObject.SetActive(false);
|
| | | m_ExpNum.text = DogZExp + "/" + DogzEquipConfig.upExpTotal;
|
| | | float value = (float)DogZExp / DogzEquipConfig.upExpTotal;
|
| | |
|
| | | m_ExpNum.text = DogZExp + "/" + NeedExp;
|
| | | float value = (float)DogZExp / NeedExp;
|
| | | SetExperienceBar(DogZLv, value);
|
| | | if (AttType.Length > 1)
|
| | | {
|
| | |
| | | else
|
| | | {
|
| | | m_Slider.gameObject.SetActive(true);
|
| | | if (DogZExp + ToExpTotal >= DogzEquipConfig.upExpTotal)
|
| | | if (DogZExp + ToExpTotal >= NeedExp)
|
| | | {
|
| | | m_Slider.value = 1f;
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Slider.value = (float)(DogZExp + ToExpTotal) / (float)(DogzEquipConfig.upExpTotal);
|
| | | m_Slider.value = (float)(DogZExp + ToExpTotal) / (float)(NeedExp);
|
| | | }
|
| | | m_UIAlphaTween.Play();
|
| | | var DogzEquipToConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, toLv);
|
| | | int[] AttTypeTo = ConfigParse.GetMultipleStr<int>(DogzEquipToConfig.attType);
|
| | | int[] AttValueTo = ConfigParse.GetMultipleStr<int>(DogzEquipToConfig.attValue);
|
| | | string strColor = string.Format(Language.Get("DogzGreenText"), ToExpTotal);
|
| | | m_ExpNum.text = DogZExp + strColor + "/" + DogzEquipConfig.upExpTotal;
|
| | | float value= (float)DogZExp / DogzEquipConfig.upExpTotal;
|
| | | m_ExpNum.text = DogZExp + strColor + "/" + NeedExp;
|
| | | float value = (float)DogZExp / NeedExp;
|
| | | SetExperienceBar(DogZLv, value);
|
| | | if (AttType.Length > 1)
|
| | | {
|
| | | m_TextAttributes1.gameObject.SetActive(true);
|
| | | m_TextAttributes2.gameObject.SetActive(true);
|
| | | m_TextAttributesAdd1.gameObject.SetActive(true);
|
| | | m_TextAttributesAdd2.gameObject.SetActive(true);
|
| | | string StrName1 = Config.Instance.Get<PlayerPropertyConfig>(AttType[0]).Name;
|
| | | string StrName2 = Config.Instance.Get<PlayerPropertyConfig>(AttType[1]).Name;
|
| | | m_TextAttributes1.text = StrName1 + ":" + AttValue[0];
|
| | | m_TextAttributes2.text = StrName2 + ":" + AttValue[1];
|
| | | m_TextAttributesAdd1.text = "+" + (AttValueTo[0] - AttValue[0]);
|
| | | m_TextAttributesAdd2.text = "+" + (AttValueTo[1] - AttValue[1]);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_TextAttributes1.gameObject.SetActive(true);
|
| | | m_TextAttributesAdd1.gameObject.SetActive(true);
|
| | | m_TextAttributes2.gameObject.SetActive(false);
|
| | | m_TextAttributesAdd2.gameObject.SetActive(false);
|
| | | string StrName1 = Config.Instance.Get<PlayerPropertyConfig>(AttType[0]).Name;
|
| | | m_TextAttributes1.text = StrName1 + ":" + AttValue[0];
|
| | | m_TextAttributesAdd1.text = "+" + (AttValueTo[0] - AttValue[0]);
|
| | | }
|
| | | }
|
| | |
|
| | | SetAddAttributes(DogzEquipConfig, GodBeastPart, toLv);//设置预览的属性
|
| | | if (ToExpTotal == 0)
|
| | | {
|
| | | m_StrengthenBtn.interactable = false;
|
| | | m_StrengthenDoubleBtn.interactable = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | m_StrengthenBtn.interactable = true;
|
| | | m_StrengthenDoubleBtn.interactable = true;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | return DogzLv;
|
| | | }
|
| | | int lv = QualityLimit[m_DogZItemModel.chinItemModel.ItemColor];
|
| | | int lv = godBeastModel.QualityLimit[m_DogZItemModel.chinItemModel.ItemColor];
|
| | | var IudetDogzEquipPlus = m_DogZItemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | ToExpTotal+= IudetDogzEquipPlus[1];
|
| | | }
|
| | | for (int i = lv; i >= 0; i--)
|
| | | {
|
| | | var DogzEquipConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, i);
|
| | |
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | DogZLv = IudetDogzEquipPlus[0];
|
| | | DogZExp = IudetDogzEquipPlus[1];
|
| | | if (DogZLv > 0)
|
| | | {
|
| | | var Dogz_EquipConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, DogZLv - 1);
|
| | | DogZExp = IudetDogzEquipPlus[1] - Dogz_EquipConfig.upExpTotal;
|
| | | }
|
| | | else
|
| | | {
|
| | | DogZExp = IudetDogzEquipPlus[1];
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | int GodBeast_Number = 0;
|
| | | int GodBeast_Part = 0;
|
| | | private void SetExperienceBar(int lv,float value)//设置经验条
|
| | | private void SetExperienceBar(int lv, float value)//设置经验条
|
| | | {
|
| | | if (GodBeast_Number != GodBeastNumber || GodBeast_Part != GodBeastPart)
|
| | | {
|
| | |
| | | m_ExpSlider.value = value;
|
| | | }
|
| | | }
|
| | |
|
| | | private void SetAddAttributes(DogzEquipPlusConfig DogzEquipConfig, int GodBeastPart, int toLv)//设置预览的属性
|
| | | {
|
| | | int[] AttType = ConfigParse.GetMultipleStr<int>(DogzEquipConfig.attType);
|
| | | int[] AttValue = ConfigParse.GetMultipleStr<int>(DogzEquipConfig.attValue);
|
| | | var DogzEquipToConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(GodBeastPart, toLv);
|
| | | int[] AttTypeTo = ConfigParse.GetMultipleStr<int>(DogzEquipToConfig.attType);
|
| | | int[] AttValueTo = ConfigParse.GetMultipleStr<int>(DogzEquipToConfig.attValue);
|
| | | if (AttType.Length > 1)
|
| | | {
|
| | | m_TextAttributes1.gameObject.SetActive(true);
|
| | | m_TextAttributes2.gameObject.SetActive(true);
|
| | | m_TextAttributesAdd1.gameObject.SetActive(true);
|
| | | m_TextAttributesAdd2.gameObject.SetActive(true);
|
| | | string StrName1 = Config.Instance.Get<PlayerPropertyConfig>(AttType[0]).Name;
|
| | | string StrName2 = Config.Instance.Get<PlayerPropertyConfig>(AttType[1]).Name;
|
| | | m_TextAttributes1.text = StrName1 + ":" + AttValue[0];
|
| | | m_TextAttributes2.text = StrName2 + ":" + AttValue[1];
|
| | | m_TextAttributesAdd1.text = "+" + (AttValueTo[0] - AttValue[0]);
|
| | | m_TextAttributesAdd2.text = "+" + (AttValueTo[1] - AttValue[1]);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_TextAttributes1.gameObject.SetActive(true);
|
| | | m_TextAttributesAdd1.gameObject.SetActive(true);
|
| | | m_TextAttributes2.gameObject.SetActive(false);
|
| | | m_TextAttributesAdd2.gameObject.SetActive(false);
|
| | | string StrName1 = Config.Instance.Get<PlayerPropertyConfig>(AttType[0]).Name;
|
| | | m_TextAttributes1.text = StrName1 + ":" + AttValue[0];
|
| | | m_TextAttributesAdd1.text = "+" + (AttValueTo[0] - AttValue[0]);
|
| | | }
|
| | |
|
| | | }
|
| | | } |
| | | |
| | | } |
| | |
| | | public Dictionary<int, int> Absorption_Dic = new Dictionary<int, int>();//获取选择的物品
|
| | | public event Action AbsorbEvent;
|
| | | public int ItemInde = 0;//物品下标
|
| | | public ItemModel Crystal_ItemModel;
|
| | | public ItemModel Crystal_ItemModel;//当前所选中的水晶物品
|
| | | public int ItemPlace = -1;//神兽装备位置信息
|
| | | public Dictionary<int, int> QualityLimit = new Dictionary<int, int>();//对应品质所能选择的最大强化等级
|
| | | DogzModel Dogz_model;
|
| | | DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } }
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
|
| | | public override void Init()
|
| | | {
|
| | |
|
| | | if (QualityLimit.Count <= 0)
|
| | | {
|
| | | string DogzAssist = Config.Instance.Get<FuncConfigConfig>("DogzAssist").Numerical4;//获取不同品质的神兽强化上限
|
| | | QualityLimit = ConfigParse.GetDic<int, int>(DogzAssist);
|
| | | }
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | return SiteEnhancementAttributeDic;
|
| | | }
|
| | |
|
| | | public int DogZBagIndex = 0;
|
| | | public bool IsFullLevel()//是都满级能够继续吸收
|
| | | {
|
| | | bool IsBool = false;
|
| | | int DogZLV = 0;//获取当前神兽等级
|
| | | int DogProficiency = 0;//当前神兽的熟练度
|
| | | int SingleProficiency = 0;//单倍熟练度
|
| | | int DoubleProficiency = 0;//双倍熟练度
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptDogzEquip, DogZBagIndex);
|
| | | if (itemModel == null)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | int lv = QualityLimit[itemModel.chinItemModel.ItemColor];
|
| | | var DogzEquipMaxConfig = DogzEquipPlusConfig.GetEquipplaceAndLevel(itemModel.chinItemModel.EquipPlace, lv); |
| | | var IudetDogzEquipPlus = itemModel.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | |
|
| | | if (IudetDogzEquipPlus != null)
|
| | | {
|
| | | DogZLV = IudetDogzEquipPlus[0];
|
| | | DogProficiency = IudetDogzEquipPlus[1];
|
| | | }
|
| | | foreach (var key in Absorption_Dic.Keys)
|
| | | {
|
| | | ItemModel item_Model = playerPack.GetItemModelByIndex(PackType.rptDogzItem, key);
|
| | | if (item_Model != null)
|
| | | {
|
| | | if (item_Model.chinItemModel.Effect1 == 235)
|
| | | {
|
| | | var _IudetDogzEquipPlus = item_Model.GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);
|
| | | SingleProficiency += item_Model.chinItemModel.EffectValueA1 * Absorption_Dic[key];
|
| | | if (_IudetDogzEquipPlus != null)
|
| | | {
|
| | | SingleProficiency += _IudetDogzEquipPlus[1];
|
| | | DoubleProficiency += item_Model.chinItemModel.EffectValueA1;
|
| | | }
|
| | | else
|
| | | {
|
| | | DoubleProficiency += item_Model.chinItemModel.EffectValueA1 * 2 * Absorption_Dic[key];
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | if (true)
|
| | | {
|
| | | if (DogProficiency + DoubleProficiency >= DogzEquipMaxConfig.upExpTotal)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | } |
| | | }
|
| | | else
|
| | | {
|
| | | if (DogProficiency + SingleProficiency >= DogzEquipMaxConfig.upExpTotal)
|
| | | {
|
| | | return true;
|
| | | }
|
| | | else
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | | |
| | |
| | | public int GodBeastStar;//神兽星级
|
| | | public int LocationMarker;//位置标记
|
| | | public int EquipScore;//装备评分
|
| | | public int ItemPlace;//背包装备位置
|
| | | } |
| | | public class GodBeastReinforcementWin : Window |
| | | {
|
| | |
| | | [SerializeField] GodBeastSlidingList m_GodBeastSlidingList; |
| | | [SerializeField] GameObject m_Listprompt_Text;
|
| | | [SerializeField] GodBeastAttributes m_GodBeastAttributes;
|
| | | [SerializeField] UIEffect m_UIEffect;
|
| | | DogzModel Dogz_model;
|
| | | DogzModel dogz_model { get { return Dogz_model ?? (Dogz_model = ModelCenter.Instance.GetModel<DogzModel>()); } }
|
| | | PlayerPackModel _playerPack;
|
| | | PlayerPackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); } }
|
| | | GodBeastModel GodBeastModel;
|
| | | GodBeastModel godBeastModel { get { return GodBeastModel ?? (GodBeastModel = ModelCenter.Instance.GetModel<GodBeastModel>()); } }
|
| | | public static event Action<int> ChooseToModify;
|
| | | private List<GodBeastClass> GodBeastList = new List<GodBeastClass>(); |
| | | private int CurrentlySelected = 0; |
| | | private int JumpIndex = 0; |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | |
| | | {
|
| | | CurrentlySelected = 0;
|
| | | GetGodBeast();//获取神兽强化装备信息
|
| | | if (GodBeastList.Count > 0)
|
| | | {
|
| | | CurrentlySelected = GodBeastList[0].LocationMarker;
|
| | | m_ScrollerController.JumpIndex(0);
|
| | | }
|
| | | m_ScrollerController.OnRefreshCell += OnRefreshGridCell; |
| | | OnCreateGridLineCell(m_ScrollerController); |
| | | if (godBeastModel.ItemPlace != -1)
|
| | | {
|
| | | for (int i = 0; i < GodBeastList.Count; i++)
|
| | | {
|
| | | if (GodBeastList[i].ItemPlace == godBeastModel.ItemPlace)
|
| | | {
|
| | | CurrentlySelected = GodBeastList[i].LocationMarker;
|
| | | GetDogZBagIndex();
|
| | | int Index = 0;
|
| | | Index = GodBeastList.FindIndex((x) =>
|
| | | {
|
| | | return x.ItemPlace == godBeastModel.ItemPlace;
|
| | | });
|
| | | JumpIndex = Index;
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (GodBeastList.Count > 0)
|
| | | {
|
| | | CurrentlySelected = GodBeastList[0].LocationMarker;
|
| | | GetDogZBagIndex();
|
| | | JumpIndex = 0; |
| | | }
|
| | | } |
| | | OnCreateGridLineCell(m_ScrollerController);
|
| | | m_GodBeastSlidingList.Init(); |
| | | m_GodBeastAttributes.Init(); |
| | | m_GodBeastAttributes.GetGodBeastLocationMarker(CurrentlySelected); |
| | | m_GodBeastAttributes.GetGodBeastLocationMarker(CurrentlySelected);
|
| | | m_ScrollerController.JumpIndex(JumpIndex);
|
| | |
|
| | |
|
| | |
|
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | playerPack.RefreshItemCountAct += RefreshItemCountAct; |
| | | playerPack.RefreshItemCountAct += RefreshItemCountAct;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent += MakeItemAnswerEvent; |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | | {
|
| | | JumpIndex = 0;
|
| | | godBeastModel.ItemPlace = -1;
|
| | | // godBeastModel.Absorption_Dic.Clear();
|
| | | playerPack.RefreshItemCountAct -= RefreshItemCountAct;
|
| | | m_ScrollerController.OnRefreshCell -= OnRefreshGridCell; |
| | | m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
|
| | | DTC0721_tagMakeItemAnswer.MakeItemAnswerEvent -= MakeItemAnswerEvent; |
| | | }
|
| | |
|
| | | private void MakeItemAnswerEvent(H0721_tagMakeItemAnswer obj)
|
| | | {
|
| | | if ((int)obj.MakeType == (int)MakeType.Def_mitDogzEquipPlus)
|
| | | {
|
| | | m_UIEffect.Play();
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshItemCountAct(PackType arg1, int arg2, int arg3)
|
| | | {
|
| | | if (arg1 == PackType.rptDogzEquip)
|
| | | {
|
| | | OnCreateGridLineCell(m_ScrollerController);
|
| | | //OnCreateGridLineCell(m_ScrollerController);
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | m_GodBeastSlidingList.Init();
|
| | | m_GodBeastAttributes.Init();
|
| | | m_GodBeastAttributes.GetGodBeastLocationMarker(CurrentlySelected);
|
| | |
| | | {
|
| | | if (DogzEquipDict[key] == 1)
|
| | | {
|
| | | |
| | |
|
| | | List<ItemModel> itemModel = dogz_model.GetDogzEquips(key);
|
| | | for (int i = 0; i < itemModel.Count; i++)
|
| | | {
|
| | |
| | | godBeastClass.GodBeastQuality = itemModel[i].chinItemModel.ItemColor;
|
| | | godBeastClass.GodBeastStar = itemModel[i].chinItemModel.StarLevel;
|
| | | godBeastClass.EquipScore = itemModel[i].equipScore;
|
| | | godBeastClass.ItemPlace = itemModel[i].itemInfo.ItemPlace;
|
| | | var IudetDogzEquipPlus = itemModel[i].GetUseDataModel((int)ItemUseDataKey.Def_IudetDogzEquipPlus);// 神兽装备强化信息列表 [强化等级, 强化熟练度]
|
| | | if (IudetDogzEquipPlus == null)
|
| | | {
|
| | |
| | | {
|
| | | godBeastClass.GodBeastLv = IudetDogzEquipPlus[0];
|
| | | godBeastClass.GodBeasProficiency = IudetDogzEquipPlus[1];
|
| | | } |
| | | godBeastClass.LocationMarker=itemModel[i].EquipPlace*100+key;
|
| | | }
|
| | | godBeastClass.LocationMarker = itemModel[i].EquipPlace * 100 + key;
|
| | | GodBeastList.Add(godBeastClass);
|
| | | }
|
| | | }
|
| | |
| | | int locationMarker = cell.index;
|
| | | godBeastEntry.GetGodBeastLocationMarker(locationMarker, CurrentlySelected);
|
| | | godBeastEntry.GodBeastButton.RemoveAllListeners();
|
| | | godBeastEntry.GodBeastButton.AddListener(()=> |
| | | godBeastEntry.GodBeastButton.AddListener(() =>
|
| | | {
|
| | | if (locationMarker != CurrentlySelected)
|
| | | {
|
| | | CurrentlySelected = locationMarker;
|
| | | GetDogZBagIndex();
|
| | | m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
|
| | | if (ChooseToModify != null)
|
| | | {
|
| | | ChooseToModify(CurrentlySelected);
|
| | | }
|
| | | } |
| | | }
|
| | | });
|
| | | } |
| | | |
| | | private void GetDogZBagIndex()//获取选择的神兽装备的装备下标
|
| | | {
|
| | | for (int i = 0; i < GodBeastList.Count; i++)
|
| | | {
|
| | | if (CurrentlySelected == GodBeastList[i].LocationMarker)
|
| | | {
|
| | | godBeastModel.DogZBagIndex = GodBeastList[i].ItemPlace;
|
| | | // DebugEx.LogError(godBeastModel.DogZBagIndex);
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | {
|
| | | if (equipWashModel.IsWashFull(_itemModel, _washProModel, _tagWashModel))
|
| | | {
|
| | | _washFullLvText.text = Language.Get("EquipWash113", _itemModel.chinItemModel.LV, equipWashModel.GetWashFullLv(_itemModel.chinItemModel.LV));
|
| | | if(_washProModel.XLAttrLV >= equipWashModel.GetMaxWashLv()
|
| | | && _washProModel.XLAttrLV <= equipWashModel.GetWashFullLv(_itemModel.chinItemModel.LV))
|
| | | {
|
| | | _washFullLvText.text = Language.Get("WashLevelFulled");
|
| | | }
|
| | | else
|
| | | {
|
| | | _washFullLvText.text = Language.Get("EquipWash113", _itemModel.chinItemModel.LV, equipWashModel.GetWashFullLv(_itemModel.chinItemModel.LV));
|
| | | }
|
| | | ObjHideOrShow(false, false, false, false, true);
|
| | | }
|
| | | else
|
| | |
| | | ObjHideOrShow(false, false, false, false, true);
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | PlusNum1.gameObject.SetActive(false);
|
| | | PlusNum2.gameObject.SetActive(false);
|
| | | StopCoroutine("AkeyRefining");
|
| | | UI3DModelExhibition.Instance.StopShowWing();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | // RoleCameraCtrl.GetInstance().OnDestroyModel();
|
| | | playerPack.RefreshPackAct -= ItemsToRefresh;//背包物品刷新
|
| | | playerPack.ItemCntReduceAct -= BackpackRefresh;//背包物品清理
|
| | |
| | | _wingRawImage.gameObject.SetActive(true);
|
| | | var config = Config.Instance.Get<WingRefineExpConfig>((int)itemModel.itemInfo.ItemID);
|
| | | int _modelID = config.Model;
|
| | | UI3DModelExhibition.Instance.BeginShowWing(_modelID, Vec, _wingRawImage);
|
| | | UI3DModelExhibition.Instance.ShowWing(_modelID, Vec, _wingRawImage);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | [SerializeField] GameObject bgObj;
|
| | |
|
| | | SetPrivateModel privateModel { get { return ModelCenter.Instance.GetModel<SetPrivateModel>(); } }
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | |
|
| | | public void SetModel(int dailyId)
|
| | | {
|
| | | string title = "";
|
| | | string weekDay = "";
|
| | | string openTime = "";
|
| | | privateModel.GetDailyInfoById(dailyId,out title,out weekDay,out openTime);
|
| | | privateModel.GetDailyInfoById(dailyId, out title, out weekDay, out openTime);
|
| | | nameText.text = title;
|
| | | weekDayText.text = weekDay;
|
| | | timeText.text = openTime;
|
| | | int index = privateModel.GetSwitchIndexById(dailyId);
|
| | | pushBtn.SetInit(index,privateModel.GetSwitchStateByIndex(index));
|
| | | pushBtn.switchBtn.RemoveAllListeners();
|
| | | pushBtn.switchBtn.AddListener(() =>
|
| | |
|
| | | var quests = dailyQuestModel.GetDailyQuests(DailyQuestModel.DailyQuestCategory.TimeLimit);
|
| | | int index = privateModel.GetSwitchIndexById(dailyId, quests);
|
| | | pushBtn.SetInit(index, privateModel.GetSwitchStateByIndex(index));
|
| | | pushBtn.switchBtn.SetListener(() =>
|
| | | {
|
| | | if (pushBtn.onObj.activeInHierarchy)
|
| | | {
|
| | |
| | | }
|
| | | });
|
| | |
|
| | | if(this.index % 2 == 0)
|
| | | {
|
| | | bgObj.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | bgObj.SetActive(false);
|
| | | }
|
| | | bgObj.SetActive(this.index % 2 == 0);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | public class SetPrivateModel : Model, IBeforePlayerDataInitialize, IAfterPlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | DailyQuestModel m_dailyModel;
|
| | | DailyQuestModel dailyModel
|
| | | {
|
| | | get { return m_dailyModel ?? (m_dailyModel = ModelCenter.Instance.GetModel<DailyQuestModel>()); }
|
| | | }
|
| | | DailyQuestModel dailyModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | | VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
|
| | |
|
| | | public List<int> hangUpPushlist = new List<int>();
|
| | |
| | | List<int> dailyIdlist = GetOpenDailyIdlist(true);
|
| | | for (int i = 0; i < dailyIdlist.Count; i++)
|
| | | {
|
| | | bool isOpen = GetSwitchStateByIndex(GetSwitchIndexById(dailyIdlist[i]));
|
| | | bool isOpen = GetSwitchStateByIndex(GetSwitchIndexById(dailyIdlist[i], dailyIdlist));
|
| | | if (isOpen)
|
| | | {
|
| | | List<JsonData> pushNotifylist = GetPushJsonData(dailyIdlist[i]);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public int GetSwitchIndexById(int id)
|
| | | public int GetSwitchIndexById(int id, List<int> quests)
|
| | | {
|
| | | var quests = dailyModel.GetDailyQuests(DailyQuestModel.DailyQuestCategory.TimeLimit);
|
| | | for (int i = 0; i < quests.Count; i++)
|
| | | {
|
| | | if (quests[i] == id)
|
| | |
| | |
|
| | | private void RefreshDailyQuest()
|
| | | {
|
| | | foreach (var dailyQuest in dailyModel.GetDailyQuestlist().Values)
|
| | | var quests = dailyModel.GetDailyQuests(DailyQuestModel.DailyQuestCategory.TimeLimit);
|
| | | foreach (var dailyQuest in dailyModel.GetDailyQuests())
|
| | | {
|
| | | var isUnLocked = TestDailyQuestUnLock(dailyQuest.id);
|
| | | var isUnLocked = TestDailyQuestUnLock(dailyQuest);
|
| | | if (isUnLocked)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<SetPrivateModel>().CheckActivityOpenTime(dailyQuest.id);
|
| | | CheckActivityOpenTime(dailyQuest, quests);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public bool TestDailyQuestUnLock(int _dailyQuestId)
|
| | | {
|
| | | switch ((DailyQuestType)_dailyQuestId)
|
| | |
| | | }
|
| | |
|
| | |
|
| | | public void CheckActivityOpenTime(int dailyId)
|
| | | public void CheckActivityOpenTime(int dailyId, List<int> quests)
|
| | | {
|
| | | bool isOpen = GetSwitchStateByIndex(GetSwitchIndexById(dailyId));
|
| | |
|
| | | bool isOpen = GetSwitchStateByIndex(GetSwitchIndexById(dailyId, quests));
|
| | |
|
| | | if (!isOpen)
|
| | | return;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | var minLevel = 1;
|
| | | var maxLevel = 1;
|
| | | var maxLevel = GeneralConfig.Instance.playerMaxLevel;
|
| | |
|
| | | if (_mission != myTeam.mission)
|
| | | {
|
| | |
| | | {
|
| | | var dungeonId = ModelCenter.Instance.GetModel<DungeonModel>().GetDungeonId(_mission.mapId, _mission.mapEx);
|
| | | var dungeonConfig = Config.Instance.Get<DungeonConfig>(dungeonId);
|
| | | minLevel = dungeonConfig.LVLimitMin;
|
| | | maxLevel = dungeonConfig.LVLimitMax;
|
| | | if (dungeonConfig != null)
|
| | | {
|
| | | minLevel = dungeonConfig.LVLimitMin;
|
| | | maxLevel = dungeonConfig.LVLimitMax;
|
| | | }
|
| | | }
|
| | |
|
| | | missionBuf = _mission;
|
| | |
| | | if (Input.touchCount > 1 || NewBieCenter.Instance.inGuiding
|
| | | || WindowCenter.Instance.CheckOpen<TreasureNewStageWin>()
|
| | | || WindowCenter.Instance.CheckOpen<PotentialItemUseWin>()
|
| | | || WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>())
|
| | | || WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>()
|
| | | || WindowCenter.Instance.CheckOpen<GetItemPathWin>())
|
| | | {
|
| | | m_StartDrag = false;
|
| | | return;
|
| | |
| | | GetCurrentAchievement();
|
| | | if (treasure.state != TreasureState.Collected)
|
| | | {
|
| | | int unlocktreasureId = 0;
|
| | | var list = model.GetTreasureCategory(TreasureCategory.Human);
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | //int unlocktreasureId = 0;
|
| | | //var list = model.GetTreasureCategory(TreasureCategory.Human);
|
| | | //for (int i = 0; i < list.Count; i++)
|
| | | //{
|
| | | // Treasure _treasure;
|
| | | // if(model.TryGetTreasure(list[i], out _treasure))
|
| | | // {
|
| | | // var index = _treasure.treasureStages.FindIndex((x) =>
|
| | | // {
|
| | | // return x.unlockType == TreasureStageUnlock.Treasure && x.treasure == treasure.id;
|
| | | // });
|
| | | // if (index != -1)
|
| | | // {
|
| | | // unlocktreasureId = list[i];
|
| | | // break;
|
| | | // }
|
| | | // }
|
| | | //}
|
| | |
|
| | | //var unlockTreasureConfig = Config.Instance.Get<TreasureConfig>(unlocktreasureId);
|
| | |
|
| | | var config = Config.Instance.Get<TreasureConfig>(treasure.id);
|
| | | var requireCondition = 0;
|
| | | if (config != null)
|
| | | {
|
| | | Treasure _treasure;
|
| | | if(model.TryGetTreasure(list[i], out _treasure))
|
| | | var successConfig = Config.Instance.Get<SuccessConfig>(config.Achievements.Length > 0 ? config.Achievements[0] : 0);
|
| | | if (successConfig != null)
|
| | | {
|
| | | var index = _treasure.treasureStages.FindIndex((x) =>
|
| | | {
|
| | | return x.unlockType == TreasureStageUnlock.Treasure && x.treasure == treasure.id;
|
| | | });
|
| | | if (index != -1)
|
| | | {
|
| | | unlocktreasureId = list[i];
|
| | | break;
|
| | | }
|
| | | requireCondition = successConfig.NeedCnt;
|
| | | }
|
| | | }
|
| | |
|
| | | var unlockTreasureConfig = Config.Instance.Get<TreasureConfig>(unlocktreasureId);
|
| | |
|
| | | m_AchievementGetBtn.gameObject.SetActive(false);
|
| | | m_ActiveBtn.gameObject.SetActive(false);
|
| | | m_GotoGet.gameObject.SetActive(false);
|
| | | m_ContainerLocked.gameObject.SetActive(true);
|
| | | m_LockedDescription.text = Language.Get("BlastFurnaceGet", unlockTreasureConfig == null ? string.Empty : unlockTreasureConfig.Name);
|
| | | m_LockedDescription.text = Language.Get("BlastFurnaceGet", requireCondition);
|
| | | m_ContainerAchievement.gameObject.SetActive(false);
|
| | | }
|
| | | else if (currentAchievement == null || treasure.stage >= 1)
|
| | |
| | | m_ItemBehaviour.SetItem(potentialBook.itemId, 1);
|
| | | m_CostCount.text = StringUtility.Contact(own, "/", need);
|
| | | m_CostCount.color = own >= need ? UIHelper.GetUIColor(TextColType.White) : UIHelper.GetUIColor(TextColType.Red);
|
| | | m_Click.interactable = own >= need;
|
| | | //m_Click.interactable = own >= need;
|
| | | m_AddBtnText.color = own >= need ? UIHelper.GetUIColor(TextColType.NavyBrown) : UIHelper.GetUIColor(TextColType.White);
|
| | | m_Click.image.material = own >= need ? m_SmoothMask.imageMaterials[0] : m_SmoothMask.imageMaterials[1];
|
| | | //m_Click.image.material = own >= need ? m_SmoothMask.imageMaterials[0] : m_SmoothMask.imageMaterials[1];
|
| | | var config = Config.Instance.Get<TreasureSkillConfig>(potentialBook.levelUpId);
|
| | | var upRate = potentialBook.successRate - config.InitialRate;
|
| | | m_SuccessRatio.text = Language.Get("HallowsWin_UpSuccess", StringUtility.Contact((upRate * 0.01f).ToString("f0"), "%"));
|
| | |
| | |
|
| | | private void SelectPotentialBook()
|
| | | {
|
| | | if (own >= need)
|
| | | {
|
| | | //if (own >= need)
|
| | | //{
|
| | | model.selectedPotentialBook = potentialBook.itemId;
|
| | | WindowCenter.Instance.Close<PotentialItemUseWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("SPItemNotEnough");
|
| | | }
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // SysNotifyMgr.Instance.ShowTip("SPItemNotEnough");
|
| | | //}
|
| | | }
|
| | |
|
| | | private void Awake()
|
| | |
| | | public const int TREASURE_DATAMAPID = 41110;
|
| | | public const int TREASURE_MAPID = 41110;
|
| | | public const int TREASURE_GUIDE_ID = 102;
|
| | | public const int TREASURE_SOUL_ID = 115;
|
| | |
|
| | | const int TREASURE_REDPOINTID = 7000;
|
| | | readonly static int[] CATEGORY_REDPOINTIDS = { 7001, 7002, 7003, 7004, 7005 };
|
| | |
| | | Redpoint zergRedpoint = new Redpoint(TREASURE_REDPOINTID, CATEGORY_REDPOINTIDS[(int)TreasureCategory.Zerg - 1]);
|
| | |
|
| | | public Redpoint stoveRedpoint = new Redpoint(CATEGORY_REDPOINTIDS[(int)TreasureCategory.Fairy - 1], 7200);
|
| | | public Redpoint treasureSoulRedpoint = new Redpoint(1, TREASURE_SOUL_ID);
|
| | |
|
| | | public event Action<int> treasureCollectProgressUpdateEvent;
|
| | | public event Action<int> treasureSelectedEvent;
|
| | |
| | |
|
| | | private void SelectPotential()
|
| | | {
|
| | | if (potential == null || !model.IsPotentialUnlock(model.selectedTreasure, potential.id))
|
| | | if (potential == null/* || !model.IsPotentialUnlock(model.selectedTreasure, potential.id)*/)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | var level = potential.level;
|
| | | var isMax = level >= config.SkillMaxLV;
|
| | | m_PotentialMaxLevelTip.gameObject.SetActive(isMax);
|
| | | m_ContainerUpgrade.gameObject.SetActive(!isMax && FuncOpen.Instance.IsFuncOpen(82));
|
| | | m_ContainerUpgrade.gameObject.SetActive(!isMax &&
|
| | | FuncOpen.Instance.IsFuncOpen(82) && model.IsPotentialUnlock(m_Treasure.id, selectedPotential));
|
| | | m_ContainerRequirement.gameObject.SetActive(!isMax);
|
| | |
|
| | | if (!isMax)
|
| | |
| | | DisplayUpgradeCost();
|
| | | DisplayGetSkill();
|
| | | DisplaySuccessRatio();
|
| | | m_UpgradeImage.gray = !TestPotentialLevelUp();
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | if (config.InitialRate >= 100)
|
| | | {
|
| | | model.selectedPotentialBook = 0;
|
| | | return;
|
| | | }
|
| | | var itemId = config.Meterial2ID.Length > 0 ? config.Meterial2ID[0] : 0;
|
| | | if (itemId != 0)
|
| | | {
|
| | | var own = playerPack.GetItemCountByID(PackType.rptItem, itemId);
|
| | | var need = config.MeterialNum2[0];
|
| | | //var own = playerPack.GetItemCountByID(PackType.rptItem, itemId);
|
| | | //var need = config.MeterialNum2[0];
|
| | | var rate = config.Rate[0];
|
| | | if (rate >= 60 && own >= need)
|
| | | if (rate >= 60)
|
| | | {
|
| | | model.selectedPotentialBook = itemId;
|
| | | }
|
| | |
| | | m_SPOwn.text = UIHelper.ReplaceLargeNum(spOwn);
|
| | | m_SPNeed.text = StringUtility.Contact("/", UIHelper.ReplaceLargeNum(spNeed));
|
| | | m_SPOwn.color = spOwn >= spNeed ? UIHelper.GetUIColor(TextColType.DarkGreen) : UIHelper.GetUIColor(TextColType.Red);
|
| | | m_UpgradeImage.gray = spOwn < spNeed;
|
| | | }
|
| | |
|
| | | private void DisplayGetSkill(bool _levelUp = false)
|
| | |
| | | {
|
| | | var levelUpConfig = GetPotentialLevelUpConfig();
|
| | | m_SuccessRatio.text = StringUtility.Contact((levelUpConfig.rate * 0.01f).ToString("f0"), "%");
|
| | | m_RatioUp.gameObject.SetActive(model.selectedPotentialBook != 0);
|
| | | m_SuccessRatio.color = UIHelper.GetUIColor(model.selectedPotentialBook != 0 ? TextColType.DarkGreen : TextColType.LightYellow);
|
| | | m_UpgradeImage.gray = !TestPotentialLevelUp();
|
| | | m_RatioUp.gameObject.SetActive(model.selectedPotentialBook != 0 && levelUpConfig.rate > 0 && levelUpConfig.materilaKind > 1);
|
| | | m_SuccessRatio.color = UIHelper.GetUIColor(model.selectedPotentialBook != 0 && levelUpConfig.rate > 0
|
| | | ? TextColType.DarkGreen : TextColType.LightYellow);
|
| | | m_UpgradeImage.gray = levelUpConfig.rate == 0 && model.selectedPotentialBook == 0;
|
| | | m_Upgrade.interactable = levelUpConfig.rate != 0 || model.selectedPotentialBook != 0;
|
| | | }
|
| | |
|
| | | private void DisplayAddBookRedpoint()
|
| | |
| | | private void OnSpNeedItem()
|
| | | {
|
| | | var levelUpConfig = GetPotentialLevelUpConfig();
|
| | | if (levelUpConfig.rate < 10000 || model.selectedPotentialBook != 0)
|
| | | if (levelUpConfig.rate >= 10000)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("SPSuccessHint");
|
| | | return;
|
| | | }
|
| | | if (model.selectedPotentialBook == 0)
|
| | | {
|
| | | WindowCenter.Instance.Open<PotentialItemUseWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("SPSuccessHint");
|
| | | //DesignDebug.Log("成功率已经够高了,不需要再增加概率了!");
|
| | | if (levelUpConfig.materilaKind > 1)
|
| | | {
|
| | | WindowCenter.Instance.Open<PotentialItemUseWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(model.selectedPotentialBook);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | m_PotentialBook.gameObject.SetActive(_potentialBookId != 0);
|
| | | m_PotentialCount.gameObject.SetActive(_potentialBookId != 0);
|
| | | m_RemoveBook.gameObject.SetActive(_potentialBookId != 0);
|
| | | m_RemoveBook.gameObject.SetActive(false);
|
| | | m_AddBookSign.gameObject.SetActive(_potentialBookId == 0);
|
| | | if (_potentialBookId != 0)
|
| | | {
|
| | |
| | | m_PotentialBook.SetItem(_potentialBookId, 1);
|
| | |
|
| | | var levelUpConfig = GetPotentialLevelUpConfig();
|
| | | m_PotentialCount.text = StringUtility.Contact(levelUpConfig.own, "/", levelUpConfig.need);
|
| | | bool satisfy = levelUpConfig.own >= levelUpConfig.need;
|
| | | m_PotentialCount.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(satisfy ?
|
| | | TextColType.LightYellow : TextColType.Red, levelUpConfig.own.ToString()), "/", levelUpConfig.need);
|
| | | m_RemoveBook.gameObject.SetActive(levelUpConfig.materilaKind > 1);
|
| | | }
|
| | |
|
| | | DisplaySuccessRatio();
|
| | |
| | | if (packType == PackType.rptItem && config != null && config.Type == 6)
|
| | | {
|
| | | var levelUpConfig = GetPotentialLevelUpConfig();
|
| | | if (levelUpConfig.own < levelUpConfig.need)
|
| | | if (_id == model.selectedPotentialBook)
|
| | | {
|
| | | model.selectedPotentialBook = 0;
|
| | | DisplayPotentialBook(model.selectedPotentialBook);
|
| | | }
|
| | | //if (levelUpConfig.own < levelUpConfig.need)
|
| | | //{
|
| | | // model.selectedPotentialBook = 0;
|
| | | //}
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | break;
|
| | | case 3:
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("Hallows_SpUnEnough"));
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(148);
|
| | | //MessageWin.Inst.ShowFixedTip(Language.Get("Hallows_SpUnEnough"));
|
| | | break;
|
| | | case 4:
|
| | | SysNotifyMgr.Instance.ShowTip("TreasureUnsealed");
|
| | | break;
|
| | | case 6:
|
| | | SysNotifyMgr.Instance.ShowTip("LevelUpZeroRate");
|
| | | if (model.selectedPotentialBook != 0)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(model.selectedPotentialBook);
|
| | | }
|
| | | else
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LevelUpZeroRate");
|
| | | }
|
| | | break;
|
| | | }
|
| | |
|
| | |
| | | var config = Config.Instance.Get<TreasureSkillConfig>(levelupId);
|
| | | if (config == null)
|
| | | {
|
| | | return new PotentialLevelUpConfig(0, 0, 0, 0);
|
| | | return new PotentialLevelUpConfig(0, 0, 0, 0, 0);
|
| | | }
|
| | | if (model.selectedPotentialBook == 0)
|
| | | {
|
| | | return new PotentialLevelUpConfig(config.InitialRate, 0, 0, 0);
|
| | | return new PotentialLevelUpConfig(config.InitialRate, 0, 0, 0, 0);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | var need = config.MeterialNum2[index];
|
| | | var ratio = own >= need ? config.Rate[index] : config.InitialRate;
|
| | |
|
| | | return new PotentialLevelUpConfig(ratio, index + 1, own, need);
|
| | | return new PotentialLevelUpConfig(ratio, index + 1, own, need, config.Meterial2ID.Length);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | var levelUpConfig = GetPotentialLevelUpConfig();
|
| | | if (levelUpConfig.own < levelUpConfig.need || !ContainsPotentialBook(model.selectedPotentialBook))
|
| | | if (!ContainsPotentialBook(model.selectedPotentialBook))
|
| | | {
|
| | | model.selectedPotentialBook = 0;
|
| | | AutoSelectPotentialBook();
|
| | | //model.selectedPotentialBook = 0;
|
| | | }
|
| | |
|
| | | var curconfig = Config.Instance.Get<SkillConfig>(potential.id);
|
| | |
| | | m_SPOwn.text = UIHelper.ReplaceLargeNum(spOwn);
|
| | | m_SPNeed.text = StringUtility.Contact("/", UIHelper.ReplaceLargeNum(spNeed));
|
| | | m_SPOwn.color = spOwn >= spNeed ? UIHelper.GetUIColor(TextColType.DarkGreen) : UIHelper.GetUIColor(TextColType.Red);
|
| | | m_UpgradeImage.gray = !TestPotentialLevelUp();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
| | | public int rate;
|
| | | public int need;
|
| | | public int own;
|
| | | public int materilaKind;
|
| | |
|
| | | public PotentialLevelUpConfig(int _rate, int _materilaIndex, int _own, int _need)
|
| | | public PotentialLevelUpConfig(int _rate, int _materilaIndex, int _own, int _need,int materilaKind)
|
| | | {
|
| | | this.rate = _rate;
|
| | | this.materilaIndex = _materilaIndex;
|
| | | this.need = _need;
|
| | | this.own = _own;
|
| | | this.materilaKind = materilaKind;
|
| | | }
|
| | | }
|
| | | [Serializable]
|
| | |
| | | {
|
| | | public class TreasureSoulModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | {
|
| | | public const int TREASURE_SOUL_ID = 115;
|
| | | Redpoint treasureSoulRedpoint = new Redpoint(1, TREASURE_SOUL_ID);
|
| | | Redpoint treasureSoulNewGotRedpoint = new Redpoint(TREASURE_SOUL_ID, 115100);
|
| | |
|
| | | Dictionary<int, TreasureSpecialData> treasureSoulDict = new Dictionary<int, TreasureSpecialData>();
|
| | | List<int> treasureSouls = new List<int>();
|
| | | public Dictionary<int, int> signAddProperty = new Dictionary<int, int>();
|
| | |
| | |
|
| | | public int gotoSoul { get; set; }
|
| | |
|
| | | public int newGotSoul { get; set; }
|
| | |
|
| | | public bool serverInited { get; private set; }
|
| | |
|
| | | PlayerPackModel packModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
| | | {
|
| | | packModel.RefreshItemCountAct += RefreshItemCountAct;
|
| | | PlayerStrengthengDatas.RefreshEquipUpgradLvAct += RefreshEquipSTRLv;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | ParseConfig();
|
| | | }
|
| | |
|
| | |
| | | special.itemGet = false;
|
| | | special.active = false;
|
| | | }
|
| | | treasureSoulNewGotRedpoint.state = RedPointState.None;
|
| | | }
|
| | |
|
| | | public void OnPlayerLoginOk()
|
| | |
| | | {
|
| | | packModel.RefreshItemCountAct -= RefreshItemCountAct;
|
| | | PlayerStrengthengDatas.RefreshEquipUpgradLvAct -= RefreshEquipSTRLv;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChangeEvent;
|
| | | }
|
| | |
|
| | | void ParseConfig()
|
| | |
| | | {
|
| | | signAddProperty.Add(int.Parse(_key), int.Parse(jsonData[_key].ToString()));
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetViewTreasureNewGot()
|
| | | {
|
| | | treasureSoulNewGotRedpoint.state = RedPointState.None;
|
| | | }
|
| | |
|
| | | public List<int> GetTreasureSouls()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void OnFuncStateChangeEvent(int func)
|
| | | {
|
| | | if (func == 126)
|
| | | {
|
| | | UpdateRedpoints();
|
| | | }
|
| | | }
|
| | |
|
| | | public void UpdateTreasurePrivilege(HA353_tagMCMWPrivilegeDataInfo package)
|
| | | {
|
| | | for (int i = 0; i < package.Count; i++)
|
| | |
| | | }
|
| | | bool beforeActived = special.active;
|
| | | special.active = _data.State == 1;
|
| | | //if (!beforeActived && special.active && serverInited && WindowCenter.Instance.CheckOpen<TreasureSoulWin>()
|
| | | // && !WindowCenter.Instance.CheckOpen<TreasureSoulActiveWin>() && !NewBieCenter.Instance.inGuiding)
|
| | | //{
|
| | | // TreasureSoulActiveWin.treasureSoulId = (int)_data.PriID;
|
| | | // WindowCenter.Instance.Open<TreasureSoulActiveWin>();
|
| | | //}
|
| | | if (!beforeActived && special.active && serverInited
|
| | | && !WindowCenter.Instance.CheckOpen<TreasureSoulWin>())
|
| | | {
|
| | | treasureSoulNewGotRedpoint.state = RedPointState.Simple;
|
| | | newGotSoul = (int)_data.PriID;
|
| | | }
|
| | | if ((TreasurePrivilege)_data.PriID == TreasurePrivilege.StrengthenAdd)
|
| | | {
|
| | | if (treasureSoulEvent != null)
|
| | |
| | | totalProgress = configs[configs.Count - 1].countNeed;
|
| | | }
|
| | |
|
| | | redpoint = new Redpoint(TreasureModel.TREASURE_SOUL_ID, TreasureModel.TREASURE_SOUL_ID * 100 + (int)type);
|
| | | redpoint = new Redpoint(TreasureSoulModel.TREASURE_SOUL_ID, TreasureSoulModel.TREASURE_SOUL_ID * 100 + (int)type);
|
| | | switch (_type)
|
| | | {
|
| | | case TreasurePrivilege.DemonJarAtk:
|
| | |
| | | model.treasureSoulEvent += TreasureSoulEvent;
|
| | | m_TreasureSoulBtn.state = TitleBtnState.Click;
|
| | | Display();
|
| | | model.SetViewTreasureNewGot();
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | |
| | | m_TreasureSouls[i].Dispose();
|
| | | }
|
| | | m_SelectSoul = model.selectSoul;
|
| | | model.newGotSoul = 0;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | _select = sortSouls[i];
|
| | | }
|
| | | }
|
| | | if (model.newGotSoul != 0 && sortSouls.Contains(model.newGotSoul))
|
| | | {
|
| | | _select = model.newGotSoul;
|
| | | model.newGotSoul = 0;
|
| | | }
|
| | | _select = _select == 0 ? sortSouls[0] : _select;
|
| | | return _select;
|
| | | }
|
| | |
| | | {
|
| | | int _weaponId = firstTimeRechargeModel.TryOutDic[job];
|
| | | var config = Config.Instance.Get<ItemConfig>(_weaponId);
|
| | | UI3DModelExhibition.Instance.BeginShowEquipment(config.ChangeOrd, _angle, _rawImage);
|
| | | UI3DModelExhibition.Instance.ShowEquipment(config.ChangeOrd, _angle, _rawImage);
|
| | | ItemCellModel ItemModel = new ItemCellModel(_weaponId,true,0,1);
|
| | | m_ItemCell.Init(ItemModel);
|
| | | m_ItemCell.cellBtn.RemoveAllListeners();
|
| | |
| | | {
|
| | | model.firstChargeRewardEvent -= UpdateButtonState;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= PlayerDataRefreshInfoEvent;
|
| | | UI3DModelExhibition.Instance.StopShowEquipment();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | |
| | | }
|
| | | }
|
| | | var config = Config.Instance.Get<ItemConfig>(_weaponId);
|
| | | UI3DModelExhibition.Instance.BeginShowEquipment(config.ChangeOrd, _angle, _rawImage);
|
| | | UI3DModelExhibition.Instance.ShowEquipment(config.ChangeOrd, _angle, _rawImage);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowEquipment();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | m_RewardInformationImage.SetActive(false);
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | m_RawImageBoy.gameObject.SetActive(true);
|
| | | m_RawImageGirl.gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.BeginShowEquipment(itemConfig.ChangeOrd, Vec3, m_RawImageBoy);
|
| | | UI3DModelExhibition.Instance.ShowEquipment(itemConfig.ChangeOrd, Vec3, m_RawImageBoy);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_RawImageBoy.gameObject.SetActive(false);
|
| | | m_RawImageGirl.gameObject.SetActive(true);
|
| | | UI3DModelExhibition.Instance.BeginShowEquipment(itemConfig.ChangeOrd, Vec3, m_RawImageGirl);
|
| | | UI3DModelExhibition.Instance.ShowEquipment(itemConfig.ChangeOrd, Vec3, m_RawImageGirl);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowEquipment();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | MainInterfaceWin.IsCopyOfThePanel -= IsCopyOfThePanel;
|
| | | FirstTimeRechargeModel.FirstTimeRechargeTiime -= FirstTimeRechargeTiime;
|
| | | FirstTimeRechargeModel.FirstTimeRecharEffect -= FirstTimeRecharEffect;
|
| | |
| | | {
|
| | | m_RawImageBoy.gameObject.SetActive(true);
|
| | | m_RawImageGirl.gameObject.SetActive(false);
|
| | | UI3DModelExhibition.Instance.BeginShowEquipment(itemConfig.ChangeOrd, Vec3, m_RawImageBoy);
|
| | | UI3DModelExhibition.Instance.ShowEquipment(itemConfig.ChangeOrd, Vec3, m_RawImageBoy);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_RawImageBoy.gameObject.SetActive(false);
|
| | | m_RawImageGirl.gameObject.SetActive(true);
|
| | | UI3DModelExhibition.Instance.BeginShowEquipment(itemConfig.ChangeOrd, Vec3, m_RawImageGirl);
|
| | | UI3DModelExhibition.Instance.ShowEquipment(itemConfig.ChangeOrd, Vec3, m_RawImageGirl);
|
| | | }
|
| | |
|
| | | }
|
| | | else
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowEquipment();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | m_RewardInformationImage.SetActive(false);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowEquipment();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | m_RewardInformationImage.SetActive(false);
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | LocalSave.SetBool("FirstTimeRechargeBool", false);
|
| | | m_RewardInformationImage.SetActive(false);
|
| | | UI3DModelExhibition.Instance.StopShowEquipment();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | | private void OnClickFirstFlush()
|
| | | {
|
| | | LocalSave.SetBool("FirstTimeRechargeBool", false);
|
| | | UI3DModelExhibition.Instance.StopShowEquipment();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | m_RewardInformationImage.SetActive(false);
|
| | | if (WindowCenter.Instance.CheckOpen<MainInterfaceWin>() && !NewBieCenter.Instance.inGuiding)
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<MainInterfaceWin>();
|
| | | }
|
| | | UI3DModelExhibition.Instance.StopShowEquipment();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | if (WindowCenter.Instance.CheckOpen<FirstTimeRechargeWin>())
|
| | | {
|
| | | WindowCenter.Instance.CloseImmediately<FirstTimeRechargeWin>();
|
| | |
| | | m_TimeText.text = obj;
|
| | | if (NewBieCenter.Instance.inGuiding || ModelCenter.Instance.GetModel<TreasureModel>().newGotShowing)
|
| | | {
|
| | | UI3DModelExhibition.Instance.StopShowEquipment();
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | m_RewardInformationImage.SetActive(false);
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | GlobalTimeEvent.Instance.secondEvent -= secondEvent;
|
| | | OperationTimeHepler.Instance.dayResetEvent -= DayResetEvent;
|
| | | m_Time.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | private void DayResetEvent(int resetType)
|
| | |
| | | public void RequestGetToken()
|
| | | {
|
| | | var url = "https://openapi.baidu.com/oauth/2.0/token?grant_type=client_credentials" + "&client_id=" + apiKey + "&client_secret=" + secretKey;
|
| | | HttpRequest.Instance.RequestWWW(url, 2, OnGetToken);
|
| | | HttpRequest.Instance.RequestHttpGet(url, HttpRequest.defaultHttpContentType, 2, OnGetToken);
|
| | | }
|
| | |
|
| | | private void OnGetToken(bool _ok, string _result)
|
| | |
| | | day = int.Parse(dateArray[2].Trim())
|
| | | };
|
| | | }
|
| | | else if (dateArray != null && dateArray.Length == 1)
|
| | | {
|
| | | var time = TimeUtility.openServerTime;
|
| | | if (time.Equals(default(DateTime)))
|
| | | {
|
| | | DebugEx.Log("服务期开服时间下发顺序有问题");
|
| | | }
|
| | | var days = 0;
|
| | | int.TryParse(date, out days);
|
| | | days = Mathf.Max(1, days);
|
| | | time = time.AddDays(days - 1);
|
| | | return new OperationDate()
|
| | | {
|
| | | year = time.Year,
|
| | | month = time.Month,
|
| | | day = time.Day,
|
| | | };
|
| | | }
|
| | | //else if (dateArray != null && dateArray.Length == 1)
|
| | | //{
|
| | | // var time = TimeUtility.openServerTime;
|
| | | // if (time.Equals(default(DateTime)))
|
| | | // {
|
| | | // DebugEx.Log("服务期开服时间下发顺序有问题");
|
| | | // }
|
| | | // var days = 0;
|
| | | // int.TryParse(date, out days);
|
| | | // days = Mathf.Max(1, days);
|
| | | // time = time.AddDays(days - 1);
|
| | | // return new OperationDate()
|
| | | // {
|
| | | // year = time.Year,
|
| | | // month = time.Month,
|
| | | // day = time.Day,
|
| | | // };
|
| | | //}
|
| | | return default(OperationDate);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.Log(string.Format("{0} 窗口已经打开!", typeof(T)));
|
| | | DebugEx.LogFormat("{0} 窗口已经打开!", typeof(T));
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.Log(string.Format("{0} 窗口已经打开!", typeof(T)));
|
| | | DebugEx.LogFormat("{0} 窗口已经打开!", typeof(T));
|
| | | }
|
| | |
|
| | | return (T)win;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.Log(string.Format("{0} 窗口已经关闭!", typeof(T)));
|
| | | DebugEx.LogFormat("{0} 窗口已经关闭!", typeof(T));
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | asyncLoad.StopTask(typeof(T).Name);
|
| | | DebugEx.Log(string.Format("{0} 窗口无法获得!", typeof(T)));
|
| | | DebugEx.LogFormat("{0} 窗口无法获得!", typeof(T));
|
| | | }
|
| | |
|
| | | return win;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.Log(string.Format("{0} 窗口已经关闭!", typeof(T)));
|
| | | DebugEx.LogFormat("{0} 窗口已经关闭!", typeof(T));
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | asyncLoad.StopTask(typeof(T).Name);
|
| | | DebugEx.Log(string.Format("{0} 窗口无法获得!", typeof(T)));
|
| | | DebugEx.LogFormat("{0} 窗口无法获得!", typeof(T));
|
| | | }
|
| | |
|
| | | return win;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.Log(string.Format("{0} 窗口无法获得!", typeof(T)));
|
| | | DebugEx.LogFormat("{0} 窗口无法获得!", typeof(T));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.Log(string.Format("{0} 窗口已经打开!", typeof(T)));
|
| | | DebugEx.LogFormat("{0} 窗口已经打开!", typeof(T));
|
| | | }
|
| | |
|
| | | return (T)win;
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | DebugEx.Log(string.Format("{0} 窗口已经打开!", typeof(T)));
|
| | | DebugEx.LogFormat("{0} 窗口已经打开!", typeof(T));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | public bool IsJumpState { get; private set; }
|
| | | private int jumpPhase = 0;
|
| | |
|
| | | public int jumpType { get; private set; }
|
| | | public void GetPreAllOpenWin()
|
| | | {
|
| | | jumpPhase += 1;
|
| | |
| | | {
|
| | | IsJumpState = false;
|
| | | jumpPhase = 0;
|
| | | jumpType = 0;
|
| | | openWindows.Clear();
|
| | | jumpWinNameDict.Clear();
|
| | | WindowCenter.Instance.jumpWindowCloseEvent -= CloseWindow;
|
| | |
| | | case JumpUIType.SkillFunc1:
|
| | | case JumpUIType.SkillFunc2:
|
| | | case JumpUIType.SkillFunc3:
|
| | | case JumpUIType.SkillFunc2Type2:
|
| | | SetJumpLogic<SkillPanel>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.StrengthFunc1:
|
| | |
| | | SetJumpLogic<FindPreciousFrameWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.LootPreciousFrameFunc1:
|
| | | case JumpUIType.DogzDungeon:
|
| | | SetJumpLogic<LootPreciousFrameWin>(_tagWinSearchModel.TABID);
|
| | | break;
|
| | | case JumpUIType.LootPreciousFrameSpec:
|
| | |
| | | SetJumpLogic<TreasureLevelUpWin>(0);
|
| | | break;
|
| | | case JumpUIType.Kylin:
|
| | | dungeonModel.currentDungeon = new Dungeon(31190, 0);
|
| | | SetJumpLogic<MultipleDifficultyDungeonWin>(0);
|
| | | break;
|
| | | case JumpUIType.Kylin1:
|
| | |
| | | IsJumpState = false;
|
| | | openWindows.Clear();
|
| | | jumpWinNameDict.Clear();
|
| | | jumpType = 0;
|
| | | jumpPhase = 0;
|
| | | break;
|
| | | }
|
| | |
| | |
|
| | | private void SetJumpLogic<T>(int _functionalOrder = 0, bool _forceSync = true) where T : Window
|
| | | {
|
| | |
|
| | | string curOpenWin = typeof(T).Name;
|
| | | jumpWinNameDict.Add(jumpPhase, curOpenWin);
|
| | | jumpType = _tagWinSearchModel.Type;
|
| | | switch (_tagWinSearchModel.Type)
|
| | | {
|
| | | case 1:
|
| | |
| | | }
|
| | | DebugEx.Log("关闭界面类型:" + _tagWinSearchModel.Type);
|
| | | WindowCenter.Instance.jumpWindowCloseEvent -= CloseWindow;
|
| | |
|
| | | jumpType = _tagWinSearchModel.Type;
|
| | | int i = 0;
|
| | | List<string> openWinlist = null;
|
| | | switch (_tagWinSearchModel.Type)
|
| | |
| | | KnapSackFunc4 = 8,
|
| | | SkillFunc1 = 9,
|
| | | SkillFunc2 = 10,
|
| | | SkillFunc2Type2 = 243, //被动技能界面
|
| | | SkillFunc3 = 11,
|
| | | StrengthFunc1 = 12,
|
| | | StrengthFunc2 = 13,
|
| | |
| | | WelfareFunc1 = 102, //签到
|
| | | WelfareFunc2 = 103, //祈愿
|
| | | LootPreciousFrameFunc1 = 104, //封魔坛
|
| | | DogzDungeon = 242, //异兽之地
|
| | | SystemSettingFunc1 = 109,//挂机设置
|
| | |
|
| | | RebornOpenBag = 113,//死亡复活打开背包
|
| | |
| | | private List<GameObject> pathNodeBehaviours = new List<GameObject>(); //寻路点池
|
| | | List<LocalMapTag> tagBehaviours = new List<LocalMapTag>();
|
| | |
|
| | | MapModel model { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | | MapModel model { get { return ModelCenter.Instance.GetModel<MapModel>(); } }
|
| | |
|
| | | int mapId = 0;
|
| | | public void Init(int _mapId)
|
| | |
| | |
|
| | | mapId = _mapId;
|
| | | var tagChinMap = Config.Instance.Get<MapConfig>(mapId);
|
| | | var mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig();
|
| | |
|
| | | MapResourcesConfig mapResConfig = null;
|
| | | if (mapId == PlayerDatas.Instance.baseData.MapID)
|
| | | {
|
| | | mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig();
|
| | | }
|
| | | else
|
| | | {
|
| | | mapResConfig = DTCA127_tagMCStartChangeMap.GetMapResourcesConfig(mapId, 0);
|
| | | }
|
| | |
|
| | | var mapWidth = mapResConfig.MapScale.x;
|
| | | var mapHeight = mapResConfig.MapScale.y;
|
| | |
|
| | |
| | |
|
| | | WorldMapAreaBehaviour playerAtBehaviour = null;
|
| | | var currentMapId = PlayerDatas.Instance.baseData.MapID;
|
| | |
|
| | | m_ContainerPlayerHead.gameObject.SetActive(false);
|
| | | for (int i = 0; i < m_AreaBehaviours.Length; i++)
|
| | | {
|
| | | var behaviourTable = m_AreaBehaviours[i];
|
| | |
| | | behaviourTable.areaBehaviour.Init(area);
|
| | | if (behaviourTable.id == currentMapId.ToString())
|
| | | {
|
| | | m_ContainerPlayerHead.gameObject.SetActive(true);
|
| | | playerAtBehaviour = behaviourTable.areaBehaviour;
|
| | | m_ContainerPlayerHead.SetParentEx(behaviourTable.areaBehaviour.playerHead, Vector3.zero, Vector3.zero, Vector3.one);
|
| | | }
|
| | |
| | | [SerializeField] ColorCorrectionCurves m_CameraColor;
|
| | |
|
| | | public bool interactable {
|
| | | get {
|
| | | return m_Interactable;
|
| | | }
|
| | | set {
|
| | | m_Interactable = value;
|
| | | }
|
| | | get { return m_Interactable; }
|
| | | set { m_Interactable = value; }
|
| | | }
|
| | |
|
| | | UI3DShowHero playerModel = new UI3DShowHero();
|
| | |
| | | GameObject npcModel = null;
|
| | | SFXController m_NpcEffect;
|
| | | public GameObject NpcModelPet {
|
| | | get {
|
| | | return npcModel;
|
| | | }
|
| | | set {
|
| | | npcModel = value;
|
| | | }
|
| | | get { return npcModel; }
|
| | | set { npcModel = value; }
|
| | | }
|
| | |
|
| | | int m_WingModelId = 0;
|
| | | GameObject wingModel = null;
|
| | |
|
| | |
| | |
|
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
|
| | | public static UI3DModelExhibition Instance {
|
| | | get; set;
|
| | | }
|
| | | public static UI3DModelExhibition Instance { get; private set; }
|
| | |
|
| | | public static void CreateStage()
|
| | | {
|
| | | var gameObject = GameObject.Instantiate(Resources.Load<GameObject>("UI/Prefabs/UI3DModelExhibitionStage"));
|
| | | var prefab = Resources.Load<GameObject>("UI/Prefabs/UI3DModelExhibitionStage");
|
| | | var gameObject = GameObject.Instantiate(prefab);
|
| | | Instance = gameObject.GetComponent<UI3DModelExhibition>();
|
| | | Instance.transform.position = new Vector3(1000, 2000, 3000);
|
| | | Instance.name = "UI3DModelExhibitionStage";
|
| | |
| | | DontDestroyOnLoad(gameObject);
|
| | | }
|
| | |
|
| | | public void BeginShowLoginPlayer(RawImage _rawImage, int _job)
|
| | | public void ShowLoginPlayer(RawImage _rawImage, int _job)
|
| | | {
|
| | | var clothesItemId = 0;
|
| | | var weaponItemId = 0;
|
| | | var wingsItemId = 0;
|
| | | var secondaryItemId = 0;
|
| | | var _suitLevel = 0;
|
| | | var suitLevel = 0;
|
| | | var equipInfos = PlayerDatas.Instance.loginInfo.EquipInfo;
|
| | |
|
| | | for (int i = 0; i < equipInfos.Length; i++)
|
| | | {
|
| | | var equipInfo = equipInfos[i];
|
| | |
| | |
|
| | | if (equipInfo.IsSuite == 1)
|
| | | {
|
| | | Dictionary<int, List<int>> _userDataDict = ConfigParse.Analysis(equipInfo.UserData);
|
| | | if (_userDataDict.ContainsKey(30))
|
| | | var userDataDict = ConfigParse.Analysis(equipInfo.UserData);
|
| | | if (userDataDict.ContainsKey(30))
|
| | | {
|
| | | _suitLevel = _userDataDict[30][0];
|
| | | suitLevel = userDataDict[30][0];
|
| | | }
|
| | | }
|
| | | break;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | BeginShowPlayer(_rawImage, _job, clothesItemId, _suitLevel, weaponItemId, wingsItemId, secondaryItemId, false);
|
| | | var data = new UI3DPlayerExhibitionData
|
| | | {
|
| | | job = _job,
|
| | | clothesId = clothesItemId,
|
| | | suitLevel = suitLevel,
|
| | | weaponId = weaponItemId,
|
| | | wingsId = wingsItemId,
|
| | | secondaryId = secondaryItemId,
|
| | | isDialogue = false,
|
| | | };
|
| | |
|
| | | ShowPlayer(_rawImage, data);
|
| | | }
|
| | |
|
| | | public void BeginShowPlayer(RawImage _rawImage, int _job, bool _isDialogue = false)
|
| | | public void ShowPlayer(RawImage _rawImage, int _job, bool _isDialogue = false)
|
| | | {
|
| | | var clothes = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retClothes);
|
| | | var clothesId = clothes == null ? 0 : (int)clothes.itemInfo.ItemID;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | BeginShowPlayer(_rawImage, _job, clothesId, _suitLevel, weaponId, wingsId, secondaryId, _isDialogue);
|
| | | var data = new UI3DPlayerExhibitionData
|
| | | {
|
| | | job = _job,
|
| | | clothesId = clothesId,
|
| | | suitLevel = _suitLevel,
|
| | | weaponId = weaponId,
|
| | | wingsId = wingsId,
|
| | | secondaryId = secondaryId,
|
| | | isDialogue = _isDialogue,
|
| | | };
|
| | |
|
| | | ShowPlayer(_rawImage, data);
|
| | | }
|
| | |
|
| | | public void BeginShowPlayer(RawImage _rawImage, int _job, RoleEquipType _exceptEquip)
|
| | | public void ShowPlayer(RawImage _rawImage, int _job, RoleEquipType _exceptEquip)
|
| | | {
|
| | | var clothes = _exceptEquip == RoleEquipType.retClothes ?
|
| | | null : playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retClothes);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | BeginShowPlayer(_rawImage, _job, clothesId, _suitLevel, weaponId, wingsId, secondaryId, false);
|
| | | var data = new UI3DPlayerExhibitionData
|
| | | {
|
| | | job = _job,
|
| | | clothesId = clothesId,
|
| | | suitLevel = _suitLevel,
|
| | | weaponId = weaponId,
|
| | | wingsId = wingsId,
|
| | | secondaryId = secondaryId,
|
| | | isDialogue = false,
|
| | | };
|
| | |
|
| | | ShowPlayer(_rawImage, data);
|
| | | }
|
| | |
|
| | | public void BeginShowPlayer(RawImage _rawImage, int _job, int _clothesId, int suitLevel, int _weaponId, int _wingsId, int _secondaryId, bool _isDialogue = false)
|
| | | public void ShowPlayer(RawImage _rawImage, UI3DPlayerExhibitionData data)
|
| | | {
|
| | | StopShow();
|
| | |
|
| | | var instance = playerModel.Show(_job, _clothesId, suitLevel, _weaponId, _wingsId, _secondaryId, _isDialogue ? m_DialogPoint : m_PlayerShowPoint);
|
| | | var job = data.job;
|
| | | var clothesId = data.clothesId;
|
| | | var suitLevel = data.suitLevel;
|
| | | var weaponId = data.weaponId;
|
| | | var wingsId = data.wingsId;
|
| | | var secondaryId = data.secondaryId;
|
| | | var isDialogue = data.isDialogue;
|
| | |
|
| | | interactable = !_isDialogue;
|
| | | var instance = playerModel.Show(job, clothesId, suitLevel, weaponId, wingsId, secondaryId, isDialogue ? m_DialogPoint : m_PlayerShowPoint);
|
| | |
|
| | | interactable = !isDialogue;
|
| | | m_PlayerShowPoint.localEulerAngles = Vector3.zero;
|
| | |
|
| | | if (_isDialogue)
|
| | | if (isDialogue)
|
| | | {
|
| | | instance.transform.localPosition = GeneralConfig.Instance.heroDialogueOffset;
|
| | | instance.transform.localEulerAngles = GeneralConfig.Instance.heroDialogueRotation;
|
| | |
| | |
|
| | | if (_rawImage != null)
|
| | | {
|
| | | _rawImage.rectTransform.sizeDelta = new Vector2(_rawImage.rectTransform.rect.height * 4f / 3, _rawImage.rectTransform.rect.height);
|
| | | m_InteractProcessor.rectTransform = _rawImage.rectTransform;
|
| | | var x = _rawImage.rectTransform.rect.height * 4f / 3;
|
| | | var y = _rawImage.rectTransform.rect.height;
|
| | | _rawImage.rectTransform.sizeDelta = new Vector2(x, y);
|
| | | _rawImage.texture = m_ShowCamera.targetTexture;
|
| | | _rawImage.material = MaterialUtility.GetGUIRenderTextureMaterial();
|
| | | m_InteractProcessor.rectTransform = _rawImage.rectTransform;
|
| | | }
|
| | | }
|
| | |
|
| | | public void BeginShowOtherPlayer(RawImage _rawImage, int _job, int _clothesId, int suitEffect, int _weaponId, int _wingsId, int _secondaryId)
|
| | | public void ShowOtherPlayer(RawImage _rawImage, UI3DPlayerExhibitionData data)
|
| | | {
|
| | | StopShow();
|
| | |
|
| | | playerModel.Show(_job, _clothesId, suitEffect, _weaponId, _wingsId, _secondaryId, m_PlayerShowPoint);
|
| | | var job = data.job;
|
| | | var clothesId = data.clothesId;
|
| | | var suitLevel = data.suitLevel;
|
| | | var weaponId = data.weaponId;
|
| | | var wingsId = data.wingsId;
|
| | | var secondaryId = data.secondaryId;
|
| | |
|
| | | playerModel.Show(job, clothesId, suitLevel, weaponId, wingsId, secondaryId, m_PlayerShowPoint);
|
| | | playerModel.UnloadClothedEffect();
|
| | | playerModel.PutOnEffect(suitEffect);
|
| | | playerModel.PutOnEffect(suitLevel);
|
| | |
|
| | | interactable = true;
|
| | | m_PlayerShowPoint.localEulerAngles = Vector3.zero;
|
| | |
| | |
|
| | | if (_rawImage != null)
|
| | | {
|
| | | _rawImage.rectTransform.sizeDelta = new Vector2(_rawImage.rectTransform.rect.height * 4f / 3, _rawImage.rectTransform.rect.height);
|
| | | m_InteractProcessor.rectTransform = _rawImage.rectTransform;
|
| | | var x = _rawImage.rectTransform.rect.height * 4f / 3;
|
| | | var y = _rawImage.rectTransform.rect.height;
|
| | | _rawImage.rectTransform.sizeDelta = new Vector2(x, y);
|
| | | _rawImage.texture = m_ShowCamera.targetTexture;
|
| | | _rawImage.material = MaterialUtility.GetGUIRenderTextureMaterial();
|
| | | m_InteractProcessor.rectTransform = _rawImage.rectTransform;
|
| | | }
|
| | | }
|
| | |
|
| | | public void BeginShowSitDownPlayer(RawImage _rawImage, int _job)
|
| | | public void ShowSitDownPlayer(RawImage _rawImage, int _job)
|
| | | {
|
| | | BeginShowPlayer(_rawImage, _job);
|
| | | ShowPlayer(_rawImage, _job);
|
| | | if (playerModel != null)
|
| | | {
|
| | | playerModel.SitDown();
|
| | | }
|
| | | }
|
| | |
|
| | | public void StopShowPlayer()
|
| | | {
|
| | | StopShow();
|
| | | }
|
| | |
|
| | | public void BeginShowHourse(int _modelId, RawImage _rawImage)
|
| | | public void ShowHourse(int _modelId, RawImage _rawImage)
|
| | | {
|
| | | StopShow();
|
| | | m_ShowCamera.enabled = true;
|
| | |
|
| | | if (_rawImage != null)
|
| | | {
|
| | | _rawImage.rectTransform.sizeDelta = new Vector2(_rawImage.rectTransform.rect.height * 4f / 3, _rawImage.rectTransform.rect.height);
|
| | | m_InteractProcessor.rectTransform = _rawImage.rectTransform;
|
| | | var x = _rawImage.rectTransform.rect.height * 4f / 3;
|
| | | var y = _rawImage.rectTransform.rect.height;
|
| | | _rawImage.rectTransform.sizeDelta = new Vector2(x, y);
|
| | | _rawImage.texture = m_ShowCamera.targetTexture;
|
| | | _rawImage.material = MaterialUtility.GetGUIRenderTextureMaterial();
|
| | | m_InteractProcessor.rectTransform = _rawImage.rectTransform;
|
| | | }
|
| | |
|
| | | var instance = UI3DModelFactory.LoadUIHorse(_modelId);
|
| | |
| | | horseModel = instance;
|
| | |
|
| | | m_HorseShowPoint.rotation = Quaternion.identity;
|
| | |
|
| | | var modelConfig = Config.Instance.Get<ModelResConfig>(_modelId);
|
| | | instance.transform.SetParentEx(m_HorseShowPoint, modelConfig.UIOffset, modelConfig.UIRotation, Vector3.one * modelConfig.UIScale);
|
| | | var position = modelConfig.UIOffset;
|
| | | var rotation = modelConfig.UIRotation;
|
| | | var scale = Vector3.one * modelConfig.UIScale;
|
| | | instance.transform.SetParentEx(m_HorseShowPoint, position, rotation, scale);
|
| | | instance.SetActive(true);
|
| | | ResetCameraColor();
|
| | | }
|
| | |
|
| | | public void StopShowHourse()
|
| | | {
|
| | | StopShow();
|
| | | }
|
| | |
|
| | | private GameObject ObjEquipment;
|
| | | public void BeginShowEquipment(int _modelId, Vector3 _localEulerAngles, RawImage _rawImage)
|
| | | public void ShowEquipment(int _modelId, Vector3 _localEulerAngles, RawImage _rawImage)
|
| | | {
|
| | | var instance = UI3DModelFactory.LoadUIWing(_modelId);
|
| | | ObjEquipment = instance;
|
| | |
| | | ResetCameraColor();
|
| | | if (_rawImage != null)
|
| | | {
|
| | | _rawImage.rectTransform.sizeDelta = new Vector2(_rawImage.rectTransform.rect.height * 4f / 3, _rawImage.rectTransform.rect.height);
|
| | | m_InteractProcessor.rectTransform = _rawImage.rectTransform;
|
| | | var x = _rawImage.rectTransform.rect.height * 4f / 3;
|
| | | var y = _rawImage.rectTransform.rect.height;
|
| | | _rawImage.rectTransform.sizeDelta = new Vector2(x, y);
|
| | | _rawImage.texture = m_ShowCamera.targetTexture;
|
| | | _rawImage.material = MaterialUtility.GetGUIRenderTextureMaterial();
|
| | | m_InteractProcessor.rectTransform = _rawImage.rectTransform;
|
| | | }
|
| | | }
|
| | |
|
| | | public void StopShowEquipment()
|
| | | public void ShowWing(int _modelId, Vector3 _localEulerAngles, RawImage _rawImage)
|
| | | {
|
| | | StopShow();
|
| | | }
|
| | |
|
| | | public void BeginShowWing(int _modelId, Vector3 _localEulerAngles, RawImage _rawImage)
|
| | | {
|
| | | StopShow();
|
| | | m_ShowCamera.enabled = true;
|
| | |
|
| | | if (_rawImage != null)
|
| | | {
|
| | | _rawImage.rectTransform.sizeDelta = new Vector2(_rawImage.rectTransform.rect.height * 4f / 3, _rawImage.rectTransform.rect.height);
|
| | | m_InteractProcessor.rectTransform = _rawImage.rectTransform;
|
| | | var x = _rawImage.rectTransform.rect.height * 4f / 3;
|
| | | var y = _rawImage.rectTransform.rect.height;
|
| | | _rawImage.rectTransform.sizeDelta = new Vector2(x, y);
|
| | | _rawImage.texture = m_ShowCamera.targetTexture;
|
| | | _rawImage.material = MaterialUtility.GetGUIRenderTextureMaterial();
|
| | | m_InteractProcessor.rectTransform = _rawImage.rectTransform;
|
| | | }
|
| | |
|
| | | var instance = UI3DModelFactory.LoadUIWing(_modelId);
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | m_ShowCamera.enabled = true;
|
| | | isShowWing = true;
|
| | | interactable = true;
|
| | |
|
| | |
| | |
|
| | | m_WingShowPoint.rotation = Quaternion.identity;
|
| | | var modelConfig = Config.Instance.Get<ModelResConfig>(_modelId);
|
| | | instance.transform.SetParentEx(m_WingShowPoint, modelConfig.UIOffset, modelConfig.UIRotation, Vector3.one * modelConfig.UIScale);
|
| | | var position = modelConfig.UIOffset;
|
| | | var rotation = modelConfig.UIRotation;
|
| | | var scale = Vector3.one * modelConfig.UIScale;
|
| | | instance.transform.SetParentEx(m_WingShowPoint, position, rotation, scale);
|
| | |
|
| | | instance.SetActive(true);
|
| | | ResetCameraColor();
|
| | | var animator = instance.GetComponent<Animator>();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void StopShowWing()
|
| | | public void ShowNPC(int _npcId, Vector3 _localEulerAngles, RawImage _rawImage, bool _gray = false, bool _isDialogue = false)
|
| | | {
|
| | | StopShow();
|
| | | ShowNPC(_npcId, Vector3.zero, _localEulerAngles, _rawImage, _gray, _isDialogue);
|
| | | }
|
| | |
|
| | | public void BeginShowNPC(int _npcId, Vector3 _localEulerAngles, RawImage _rawImage, bool _gray = false, bool _isDialogue = false)
|
| | | {
|
| | | BeginShowNPC(_npcId, Vector3.zero, _localEulerAngles, _rawImage, _gray, _isDialogue);
|
| | | }
|
| | |
|
| | | public void BeginShowNPC(int _npcId, Vector3 _offset, Vector3 _localEulerAngles, RawImage _rawImage, bool _gray = false, bool _isDialogue = false)
|
| | | public void ShowNPC(int _npcId, Vector3 _offset, Vector3 _localEulerAngles, RawImage _rawImage, bool _gray = false, bool _isDialogue = false)
|
| | | {
|
| | | StopShow();
|
| | | m_ShowCamera.enabled = true;
|
| | |
|
| | | if (_rawImage != null)
|
| | | {
|
| | | _rawImage.rectTransform.sizeDelta = new Vector2(_rawImage.rectTransform.rect.height * 4f / 3, _rawImage.rectTransform.rect.height);
|
| | | m_InteractProcessor.rectTransform = _rawImage.rectTransform;
|
| | | var x = _rawImage.rectTransform.rect.height * 4f / 3;
|
| | | var y = _rawImage.rectTransform.rect.height;
|
| | | _rawImage.rectTransform.sizeDelta = new Vector2(x, y);
|
| | | _rawImage.texture = m_ShowCamera.targetTexture;
|
| | | _rawImage.material = MaterialUtility.GetGUIRenderTextureMaterial();
|
| | | m_InteractProcessor.rectTransform = _rawImage.rectTransform;
|
| | | }
|
| | |
|
| | | var instance = UI3DModelFactory.LoadUINPC(_npcId);
|
| | |
| | | ResetCameraColor(_gray);
|
| | | m_CameraColor.saturation = _gray ? 0.08f : 1f;
|
| | |
|
| | | }
|
| | |
|
| | | public void StopShowNPC()
|
| | | {
|
| | | StopShow();
|
| | | }
|
| | |
|
| | | public void StopShow()
|
| | |
| | | {
|
| | | if (isShowinEquipment && ObjEquipment != null)
|
| | | {
|
| | | if (WindowCenter.Instance.CheckOpen<FirstTimeRechargeWin>())
|
| | | if (WindowCenter.Instance.CheckOpen("FirstTimeRechargeWin"))
|
| | | {
|
| | | ObjEquipment.transform.Rotate(WindowCenter.Instance.Get<FirstTimeRechargeWin>().RotateVector * 1f, Space.Self);
|
| | | }
|
| | | if (WindowCenter.Instance.CheckOpen<FirstChargeTrialWin>())
|
| | | if (WindowCenter.Instance.CheckOpen("FirstChargeTrialWin"))
|
| | | {
|
| | | ObjEquipment.transform.Rotate(WindowCenter.Instance.Get<FirstChargeTrialWin>().RotateVector * 1f, Space.Self);
|
| | | }
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public struct UI3DPlayerExhibitionData
|
| | | {
|
| | | public int job;
|
| | | public int clothesId;
|
| | | public int suitLevel;
|
| | | public int weaponId;
|
| | | public int wingsId;
|
| | | public int secondaryId;
|
| | | public bool isDialogue;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | animator.enabled = false;
|
| | | }
|
| | |
|
| | | if (model)
|
| | | {
|
| | | model.transform.localScale = Vector3.one;
|
| | | }
|
| | |
|
| | | var prefab = InstanceResourcesLoader.LoadNpcPrefab(id);
|
| | | if (prefab)
|
| | | {
|
| | |
| | | RuntimeAnimatorController cacheClothedAC;
|
| | |
|
| | | Transform showPoint;
|
| | |
|
| | | List<SFXController> closthesSFXList = new List<SFXController>();
|
| | |
|
| | | public GameObject Show(int _job, int _clothes, int suitID, int _weaponId, int _wingsId, int _secondaryId, Transform _showPoint)
|
| | |
| | | wingsId = newWings;
|
| | | }
|
| | |
|
| | | private PlayerSuitModel _suitModel;
|
| | | private PlayerSuitModel SuitModel
|
| | | {
|
| | | get { return _suitModel ?? (_suitModel = ModelCenter.Instance.GetModel<PlayerSuitModel>()); }
|
| | | }
|
| | |
|
| | | private PlayerPackModel m_PlayerBackModel;
|
| | | private PlayerPackModel PlayerBackModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_PlayerBackModel ?? (m_PlayerBackModel = ModelCenter.Instance.GetModel<PlayerPackModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | private PlayerSuitModel SuitModel { get { return ModelCenter.Instance.GetModel<PlayerSuitModel>(); } }
|
| | | private PlayerPackModel PlayerBackModel { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
|
| | | public void LoadClothesEffect(int clothedID, int suitLevel)
|
| | | {
|
| | |
| | | PersonalBoss = 25,
|
| | | ElderGodArea = 26,
|
| | | FairyGrabBoss = 27,
|
| | | KillMonster=28,
|
| | | }
|
| | |
|
| | | public enum ActivityPrepareType
|
| | |
| | | Def_mitRefine = 18, // 炼丹
|
| | | Def_mitMWUpLevel = 19, //法宝进阶
|
| | | Def_DanRecycle = 20, //丹药回收
|
| | | Def_mitDogzEquipPlus=21,// 神兽装备强化 |
| | | }
|
| | | /// <summary>
|
| | | /// 金钱类型(虚拟物品)
|
| | |
| | | public static readonly int BossShow = LayerMask.NameToLayer("BossShow"); |
| | | public static readonly int BossShowMask = 1 << BossShow; |
| | | |
| | | public static readonly int BattleEffect = LayerMask.NameToLayer("BattleEffect"); |
| | | public static readonly int BattleEffectMask = 1 << BattleEffect; |
| | | public static readonly int BattleEffectLow = LayerMask.NameToLayer("BattleEffectLow"); |
| | | public static readonly int BattleEffectLowMask = 1 << BattleEffectLow; |
| | | public static readonly int BattleEffectMid = LayerMask.NameToLayer("BattleEffectMid"); |
| | | public static readonly int BattleEffectMidMask = 1 << BattleEffectMid; |
| | | public static readonly int BattleEffectHigh = LayerMask.NameToLayer("BattleEffectHigh"); |
| | | public static readonly int BattleEffectHighMask = 1 << BattleEffectHigh; |
| | | |
| | | public static readonly int Hide = LayerMask.NameToLayer("Hide"); |
| | | public static readonly int HideMask = 1 << Hide; |
| | |
| | |
|
| | | public static class TimeUtility
|
| | | {
|
| | | private static DateTime _serverTime = DateTime.Now;
|
| | | private static DateTime s_ServerTime = DateTime.Now;
|
| | |
|
| | | private static float _checkTime = 0;
|
| | | /// <summary>
|
| | |
| | | get
|
| | | {
|
| | | float tick = Time.realtimeSinceStartup - _checkTime;
|
| | | DateTime real = _serverTime.AddSeconds(tick);
|
| | | DateTime real = s_ServerTime.AddSeconds(tick);
|
| | | return real;
|
| | | }
|
| | | private set { _serverTime = value; }
|
| | | private set { s_ServerTime = value; }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | get; private set;
|
| | | }
|
| | |
|
| | | public static DateTime openServerTime;
|
| | | public static DayOfWeek openServerDayOfWeek;
|
| | |
|
| | | public static int OpenWeekCnt
|
| | | {
|
| | |
| | | public static void OnRefreshServerTime(HA004_tagServerDateTime vNetData)
|
| | | {
|
| | | DateTime n = new DateTime(vNetData.Year, vNetData.Month, vNetData.Day, vNetData.Hour, vNetData.Minute, vNetData.Second);
|
| | | _serverTime = n;
|
| | | DebugEx.Log("OnRefreshServerTime月份:" + _serverTime.Month);
|
| | | s_ServerTime = n;
|
| | | DebugEx.Log("OnRefreshServerTime月份:" + s_ServerTime.Month);
|
| | | _checkTime = Time.realtimeSinceStartup;
|
| | | if (OnServerTimeRefresh != null) OnServerTimeRefresh();
|
| | | if (OnServerTimeRefresh != null)
|
| | | {
|
| | | OnServerTimeRefresh();
|
| | | }
|
| | | TimeDownMgr.Instance.Begin(TimeDownMgr.CoolTimeType.SyncServerTime, 60, (float tick) =>
|
| | | {
|
| | | SyncServerTime();
|
| | |
| | | OpenDay = package.Day;
|
| | | IsMixServer = package.IsMixServer == 1;
|
| | | MixOpenDay = package.MixDay;
|
| | | DateTime.TryParse(package.OpenServerTime, out openServerTime);
|
| | | openServerDayOfWeek = package.OpenWeekday == 7 ? DayOfWeek.Sunday : (DayOfWeek)package.OpenWeekday;
|
| | | OnRefreshServerTime(new HA004_tagServerDateTime()
|
| | | {
|
| | | Year = package.NowYear,
|
| | | Month = package.NowMonth,
|
| | | Day = package.NowDay,
|
| | | Hour = package.NowHour,
|
| | | Minute = package.NowMinute,
|
| | | Second = package.NowSecond,
|
| | | MicSecond = package.NowMicSecond,
|
| | | });
|
| | | //DateTime.TryParse(package.OpenServerTime, out openServerTime);
|
| | | if (OnServerOpenDayRefresh != null)
|
| | | {
|
| | | OnServerOpenDayRefresh();
|
| | |
| | | public static readonly Color32 s_BrightBlueColor = new Color32(0, 107, 227, 255);
|
| | | public static readonly Color32 s_BrightOrangeColor = new Color32(255, 103, 1, 255); //FF6701FF
|
| | | public static readonly Color32 s_BrightWhiteColor = new Color32(104, 104, 104, 255); //686868
|
| | | public static readonly Color32 s_BrightGreenColor = new Color32(16, 157, 6, 255);
|
| | | public static readonly Color32 s_BrightGreenColor = new Color32(16, 157, 6, 255); //109d06
|
| | |
|
| | | public static readonly Color32 s_DarkPinkColor = new Color32(255, 124, 124, 255);
|
| | | public static readonly Color32 s_DarkRedColor = new Color32(250, 1, 1, 255);
|