Merge branch 'master' into JadeDynastyBoss
| | |
| | | newSceneObjResName = EditorGUILayout.TextField(newSceneObjResName, guiSkin.textField, GUILayout.Width(100), GUILayout.Height(20)); |
| | | if (GUILayout.Button("添加", guiSkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | | { |
| | | var _go = new GameObject("RefreshSceneObj"); |
| | | _go.transform.SetParent(transform); |
| | | RaycastHit _hit; |
| | | Ray _ray = SceneView.lastActiveSceneView.camera.ViewportPointToRay(new Vector3(.5f, .5f, 0)); |
| | | if (Physics.Raycast(_ray, out _hit, 1000f, LayerUtility.WalkbleMask)) |
| | | Debug.Log("!!!"); |
| | | var _sceneObject = CreateSceneObject(); |
| | | if (_sceneObject) |
| | | { |
| | | _go.transform.position = _hit.point; |
| | | sceneObjList.Add(_sceneObject); |
| | | showSceneObjList = true; |
| | | } |
| | | _go.transform.eulerAngles = Vector3.zero; |
| | | _go.transform.localScale = Vector3.one; |
| | | |
| | | var _sceneObject = _go.AddComponent<Bhv_SceneObjectData>(); |
| | | sceneObjList.Add(_sceneObject); |
| | | |
| | | showSceneObjList = true; |
| | | } |
| | | EditorGUILayout.EndHorizontal(); |
| | | |
| | |
| | | EditorGUILayout.EndVertical(); |
| | | return _result; |
| | | } |
| | | |
| | | private Bhv_SceneObjectData CreateSceneObject() |
| | | { |
| | | if (!string.IsNullOrEmpty(newSceneObjResName)) |
| | | { |
| | | string _path = "Assets/ResourcesOut/Mob/Prefab_Race_" + newSceneObjResName + ".prefab"; |
| | | var _obj = AssetDatabase.LoadAssetAtPath<GameObject>(_path); |
| | | if (!_obj) |
| | | { |
| | | Debug.LogError("所要创建的资源不存在: " + _path); |
| | | return null; |
| | | } |
| | | _obj = Instantiate(_obj); |
| | | var _sceneObjData = _obj.AddComponent<Bhv_SceneObjectData>(); |
| | | _sceneObjData.resName = newSceneObjResName; |
| | | RaycastHit _hit; |
| | | Ray _ray = SceneView.lastActiveSceneView.camera.ViewportPointToRay(new Vector3(.5f, .5f, 0)); |
| | | if (Physics.Raycast(_ray, out _hit, 1000f, LayerUtility.WalkbleMask)) |
| | | { |
| | | _sceneObjData.transform.position = _hit.point; |
| | | } |
| | | _sceneObjData.transform.SetParent(transform); |
| | | _sceneObjData.transform.eulerAngles = Vector3.zero; |
| | | _sceneObjData.transform.localScale = Vector3.one; |
| | | |
| | | Selection.activeGameObject = _sceneObjData.gameObject; |
| | | if (Selection.activeGameObject) |
| | | { |
| | | SceneView.lastActiveSceneView.LookAt(Selection.activeGameObject.transform.position); |
| | | } |
| | | |
| | | return _sceneObjData; |
| | | } |
| | | return null; |
| | | } |
| | | #endif |
| | | |
| | | } |
| | |
| | | if (AssetSource.sceneFromEditor) |
| | | { |
| | | #if UNITY_EDITOR |
| | | var path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, "Scene/", folder, "/", name, ".png"); |
| | | var path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, "Scene/", folder, "/", name, ".jpg"); |
| | | texture2D = UnityEditor.AssetDatabase.LoadAssetAtPath<Texture2D>(path); |
| | | #endif |
| | | } |
| | |
| | | * ClientPackage向sdk发送分包id
|
| | | */
|
| | | public const int ClientPackage = 400;
|
| | | /**
|
| | | * 发送事件
|
| | | */
|
| | | public static int SendRegistEvent = 500;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | SendMessageToSDK(m_Json);
|
| | | }
|
| | |
|
| | | public void SendRegistEvent()
|
| | | {
|
| | | m_Json.Clear();
|
| | | m_Json["code"] = CodeU2A.SendRegistEvent;
|
| | | SendMessageToSDK(m_Json);
|
| | | }
|
| | |
|
| | | public void CreateRoleOk(string roleID, string roleName, string time)
|
| | | {
|
| | | m_Json.Clear();
|
| | |
| | |
|
| | | SoundPlayer.Instance.UnLoadMusic(mapResConfig.Music);
|
| | | SoundPlayer.Instance.PlayBackGroundMusic(mapResConfig.Music);
|
| | |
|
| | | SceneResourcesReplace();
|
| | | // 做一些前期战斗的预加载
|
| | | // if (!PreFightMission.Instance.IsFinished())
|
| | | // {
|
| | |
| | |
|
| | | private void SceneResourceReplace10010()
|
| | | {
|
| | | var config = Config.Instance.Get<SceneReplaceConfig>(100101);
|
| | | if (config != null)
|
| | | for (var i = 100101; i <= 100109; i++)
|
| | | {
|
| | | var groundTexture = SceneLoader.LoadTexture(config.folder, config.resourceName);
|
| | | var @object = GameObject.Find(config.objectPath);
|
| | | var config = Config.Instance.Get<SceneReplaceConfig>(i);
|
| | | if (config != null)
|
| | | {
|
| | | var groundTexture = SceneLoader.LoadTexture(config.folder, config.resourceName);
|
| | | var @object = GameObject.Find(config.objectPath);
|
| | |
|
| | | var renderer = @object.GetComponent<Renderer>();
|
| | | renderer.material.SetTexture("_MainTex", groundTexture);
|
| | | var renderer = @object.GetComponent<Renderer>();
|
| | | renderer.material.SetTexture("_MainTex", groundTexture);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
| | | Do("global.define"); |
| | | Do("global.stringutil"); |
| | | Do("protocol.LuaProtocalRegister"); |
| | | Do("hotfix.hotfix"); |
| | | |
| | | #if !UNITY_EDITOR |
| | | Do("hotfix.hotfix"); |
| | | #endif |
| | | lastGCTime = 0f; |
| | | } |
| | | |
| | |
| | | {
|
| | | ChatCtrl.Inst.presentChatType = ChatInfoType.Fairy;
|
| | | }
|
| | | if (ChatCtrl.Inst.presentChatType == ChatInfoType.CrossServer
|
| | | && !FuncOpen.Instance.IsFuncOpen(162))
|
| | | {
|
| | | ChatCtrl.Inst.presentChatType = ChatInfoType.World;
|
| | | }
|
| | | WindowCenter.Instance.Open<ChatWin>();
|
| | | }
|
| | |
|
| | |
| | | using UnityEngine; |
| | | using Snxxz.UI; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public class CrossServerUtility |
| | | { |
| | | |
| | |
| | | |
| | | public void RequestEnter() |
| | | { |
| | | if (PlayerDatas.Instance.extersion.bossState == 1) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("CrossMap11"); |
| | | return; |
| | | } |
| | | |
| | | var sendInfo = new CC105_tagCMEnterCrossServer(); |
| | | sendInfo.DataMapID = DATA_MAPID; |
| | | |
| | |
| | | {
|
| | | Number = key;
|
| | | }
|
| | | if (CrossServerOneVsOnePKSeason.Instance.SeasonState == 2 && !isbool)
|
| | |
|
| | | if (CrossServerOneVsOnePKSeason.Instance.SeasonState == 2 && CrossServerOneVsOnePlayerInfo.Instance.Score != 0 && !isbool)
|
| | | {
|
| | | if ((MyRank > -1 && MyRank < Number) || SeasonRewardConfigDic.ContainsKey(Danlv))
|
| | | {
|
| | | Isbool = true;
|
| | | }
|
| | | }
|
| | |
|
| | | if (Isbool)
|
| | | {
|
| | | redPointStre2.state = RedPointState.Simple;
|
| | |
| | | private bool IsOnTheList()
|
| | | {
|
| | | bool Isbool = false;
|
| | | int Number = 0;
|
| | | var keyList = crossServerRewardModel.SeasonRewardDic.AwardDic.Keys.ToList();
|
| | | for (int i = 0; i < keyList.Count; i++)
|
| | |
|
| | | if (CrossServerOneVsOnePlayerInfo.Instance.Score > 0) |
| | | {
|
| | | Number = keyList[i];
|
| | | int Number = 0;
|
| | | var keyList = crossServerRewardModel.SeasonRewardDic.AwardDic.Keys.ToList();
|
| | | for (int i = 0; i < keyList.Count; i++)
|
| | | {
|
| | | Number = keyList[i];
|
| | | }
|
| | |
|
| | | if (crossServerRewardModel.MyRank > -1 && crossServerRewardModel.MyRank < Number)
|
| | | {
|
| | | Isbool = true;
|
| | | } |
| | | }
|
| | | if (crossServerRewardModel.MyRank > -1 && crossServerRewardModel.MyRank < Number)
|
| | | {
|
| | | Isbool = true;
|
| | | }
|
| | |
|
| | | return Isbool;
|
| | | }
|
| | |
|
| | |
| | | public SDKUtility.FP_LoginOk sdkLoginResult;
|
| | | public SDKUtility.FP_CheckIDAuthentication sdkIDCheckIDAuthentication;
|
| | |
|
| | | public string localSaveAccountName {
|
| | | public string localSaveAccountName
|
| | | {
|
| | | get { return LocalSave.GetString(USER_ACCOUNT); }
|
| | | set { LocalSave.SetString(USER_ACCOUNT, value); }
|
| | | }
|
| | |
| | | public event Action accountBindOkEvent;
|
| | |
|
| | | bool m_ReconnecBackGround = false;
|
| | | public bool reconnectBackGround {
|
| | | public bool reconnectBackGround
|
| | | {
|
| | | get { return m_ReconnecBackGround; }
|
| | | set { m_ReconnecBackGround = value; }
|
| | | }
|
| | |
|
| | | bool m_OnCreateRole = false;
|
| | | public bool onCreateRole {
|
| | | public bool onCreateRole
|
| | | {
|
| | | get { return m_OnCreateRole; }
|
| | | set { m_OnCreateRole = value; }
|
| | | }
|
| | |
|
| | | bool m_Busy = false;
|
| | | public bool busy {
|
| | | public bool busy
|
| | | {
|
| | | get { return m_Busy; }
|
| | | set { m_Busy = value; }
|
| | | }
|
| | |
| | | if (sdkLogined)
|
| | | {
|
| | | AccountLogin(sdkLoginResult.account, _ip, _port, _gamePort);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Yl)
|
| | | {
|
| | | SDKUtility.Instance.FreePlatformLogin();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | SDKUtility.Yj_AppID + "|" +
|
| | | SDKUtility.Instance.FreePlatformInfo.accountID);
|
| | | send.ExtraLen = (byte)send.Extra.Length;
|
| | | }else if(SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Yl)
|
| | | }
|
| | | else if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Yl)
|
| | | {
|
| | | send.IDType = 6;
|
| | | }
|
| | |
| | | using Snxxz.UI; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class RichShowPlayerEvent : TRichTextEvent |
| | | { |
| | | public RichShowPlayerEvent() |
| | | { |
| | | RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.SHOWPLAYER, this); |
| | | } |
| | | public override bool Execute(RichTextEventEnum type, RichTextMgr.HrefInfo href) |
| | | { |
| | | switch (type) |
| | | { |
| | | case RichTextEventEnum.SHOWPLAYER: |
| | | { |
| | | uint id = 0; |
| | | if (uint.TryParse(href.mSplits["showplayer"], out id)) |
| | | { |
| | | if (id == PlayerDatas.Instance.baseData.PlayerID) |
| | | { |
| | | return false; |
| | | } |
| | | PlayerDetails.ShowPlayerDetails((int)id, null); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public override string GetDisplay(RichTextEventEnum type, Dictionary<string, string> dic) |
| | | { |
| | | return string.Empty; |
| | | } |
| | | } |
| | | using Snxxz.UI;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | |
|
| | | public class RichShowPlayerEvent : TRichTextEvent
|
| | | {
|
| | | public RichShowPlayerEvent()
|
| | | {
|
| | | RichTextMgr.Inst.RegisterEvent(RichTextEventEnum.SHOWPLAYER, this);
|
| | | }
|
| | | public override bool Execute(RichTextEventEnum type, RichTextMgr.HrefInfo href)
|
| | | {
|
| | | switch (type)
|
| | | {
|
| | | case RichTextEventEnum.SHOWPLAYER:
|
| | | {
|
| | | uint id = 0;
|
| | | if (uint.TryParse(href.mSplits["showplayer"], out id))
|
| | | {
|
| | | if (id == PlayerDatas.Instance.baseData.PlayerID)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | var serverGroupId = 0;
|
| | | if (href.mSplits.ContainsKey("servergroupid"))
|
| | | {
|
| | | int.TryParse(href.mSplits["servergroupid"], out serverGroupId);
|
| | | }
|
| | | if (serverGroupId != 0 && serverGroupId != PlayerDatas.Instance.baseData.ServerGroupId)
|
| | | {
|
| | | var name = string.Empty;
|
| | | if (href.mSplits.ContainsKey("name"))
|
| | | {
|
| | | name = href.mSplits["name"];
|
| | | }
|
| | | var level = 0;
|
| | | if (href.mSplits.ContainsKey("level"))
|
| | | {
|
| | | int.TryParse(href.mSplits["level"], out level);
|
| | | }
|
| | | PlayerDetails.ShowCrossServerPlayer((int)id, level, name, serverGroupId);
|
| | | }
|
| | | else
|
| | | {
|
| | | PlayerDetails.ShowPlayerDetails((int)id, null);
|
| | | }
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public override string GetDisplay(RichTextEventEnum type, Dictionary<string, string> dic)
|
| | | {
|
| | | return string.Empty;
|
| | | }
|
| | | }
|
| | |
| | | } |
| | | } |
| | | |
| | | public static void ShowCrossServerPlayer(int playerId, int level, string name, int serverGroupId)
|
| | | {
|
| | | openType = OpenType.CrossPlayer;
|
| | | PlayerID = playerId; |
| | | LV = level; |
| | | Job = 1; |
| | | RealmLV = 0; |
| | | PlayerName = name; |
| | | OnlineType = 0; |
| | | IsInTeam = 0; |
| | | ServerGroupId = serverGroupId; |
| | | |
| | | if (!WindowCenter.Instance.IsOpen<PlayerDetailWin>()) |
| | | { |
| | | WindowCenter.Instance.Open<PlayerDetailWin>(); |
| | | }
|
| | | } |
| | | |
| | | public static void ShowAreaPlayer(int _playerId)
|
| | | {
|
| | | openType = OpenType.Default; |
| | |
| | | var intArray = new int[strArray.Length]; |
| | | for (var i = 0; i < strArray.Length; i++) |
| | | { |
| | | intArray[i] = int.Parse(strArray[i]); |
| | | int.TryParse(strArray[i], out intArray[i]); |
| | | } |
| | | |
| | | return intArray; |
| | |
| | | } |
| | | |
| | | sb.Remove(sb.Length - 1, 1); |
| | | |
| | | PlayerPrefs.SetString(key, sb.ToString()); |
| | | } |
| | | |
| | |
| | | var array = new float[strArray.Length]; |
| | | for (var i = 0; i < strArray.Length; i++) |
| | | { |
| | | array[i] = float.Parse(strArray[i]); |
| | | float.TryParse(strArray[i], out array[i]); |
| | | } |
| | | |
| | | return array; |