Merge branch 'master' into JadeDynastyTower
| | |
| | | public int id; |
| | | [HideInInspector] |
| | | public Evt.E_EventType type; |
| | | |
| | | #if UNITY_EDITOR |
| | | |
| | | [HideInInspector] |
| | | protected bool showDetail = false; |
| | | |
| | | #if UNITY_EDITOR |
| | | public abstract bool DrawUI(GUISkin guiSkin); |
| | | public virtual void Save(BinaryWriter bw) |
| | | { |
| | |
| | | public int conditionParam; |
| | | [HideInInspector] |
| | | public int overParam; |
| | | [HideInInspector] |
| | | private bool showMonsterList = false; |
| | | |
| | | #if UNITY_EDITOR |
| | | |
| | | [HideInInspector] |
| | | private bool showMonsterList = false; |
| | | |
| | | public override void Save(BinaryWriter bw) |
| | | { |
| | |
| | | EditorGUILayout.BeginVertical(guiSkin.box); |
| | | EditorGUILayout.BeginHorizontal(GUILayout.Height(22)); |
| | | EditorGUI.indentLevel += 1; |
| | | showDetail = EditorGUILayout.Foldout(showDetail, " ID:" + id + " | Type: " + type, true, guiSkin.toggle); |
| | | showDetail = EditorGUILayout.Foldout(showDetail, " ID:" + id + " | Type: " + type, true, guiSkin.customStyles[3]); |
| | | if (GUILayout.Button("定位", guiSkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | | { |
| | | Selection.activeGameObject = gameObject; |
| | |
| | | |
| | | EditorGUILayout.BeginVertical(guiSkin.customStyles[1]); |
| | | EditorGUILayout.BeginHorizontal(GUILayout.Height(22)); |
| | | showMonsterList = EditorGUILayout.Foldout(showMonsterList, " 刷怪列表", true, guiSkin.toggle); |
| | | showMonsterList = EditorGUILayout.Foldout(showMonsterList, " 刷怪列表", true, guiSkin.customStyles[3]); |
| | | if (GUILayout.Button("添加", guiSkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | | { |
| | | var _go = new GameObject("RefreshMonster"); |
| | |
| | | RaycastHit _hit; |
| | | |
| | | Ray _ray = new Ray(_pos + Vector3.up * 100, Vector3.down); |
| | | if (Physics.Raycast(_ray, out _hit, 200, 1 << LayerMask.NameToLayer("Walkable"))) |
| | | if (Physics.Raycast(_ray, out _hit, 200, LayerUtility.WalkbleMask)) |
| | | { |
| | | monsterList[i].transform.position = _hit.point; |
| | | } |
| New file |
| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using System.IO; |
| | | |
| | | #if UNITY_EDITOR |
| | | using UnityEditor; |
| | | #endif |
| | | |
| | | namespace H2Engine |
| | | { |
| | | public class Bhv_Evt_RefreshSceneObject : Bhv_Evt |
| | | { |
| | | [HideInInspector] |
| | | public List<Bhv_SceneObjectData> sceneObjList = new List<Bhv_SceneObjectData>(); |
| | | |
| | | #if UNITY_EDITOR |
| | | |
| | | [HideInInspector] |
| | | private bool showSceneObjList = false; |
| | | [HideInInspector] |
| | | private string newSceneObjResName = ""; |
| | | |
| | | public override bool DrawUI(GUISkin guiSkin) |
| | | { |
| | | bool _result = false; |
| | | EditorGUILayout.BeginVertical(guiSkin.box); |
| | | EditorGUILayout.BeginHorizontal(GUILayout.Height(22)); |
| | | EditorGUI.indentLevel += 1; |
| | | showDetail = EditorGUILayout.Foldout(showDetail, " ID:" + id + " | Type: " + type, true, guiSkin.customStyles[3]); |
| | | if (GUILayout.Button("定位", guiSkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | | { |
| | | Selection.activeGameObject = gameObject; |
| | | if (Selection.activeGameObject) |
| | | { |
| | | SceneView.lastActiveSceneView.LookAt(Selection.activeGameObject.transform.position); |
| | | } |
| | | } |
| | | if (GUILayout.Button("删除", guiSkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | | { |
| | | _result = true; |
| | | } |
| | | EditorGUILayout.EndHorizontal(); |
| | | |
| | | if (showDetail) |
| | | { |
| | | EditorGUILayout.BeginVertical(guiSkin.customStyles[1]); |
| | | EditorGUILayout.BeginHorizontal(GUILayout.Height(22)); |
| | | if (sceneObjList.Count > 0) |
| | | { |
| | | showSceneObjList = EditorGUILayout.Foldout(showSceneObjList, " 场景物件列表", true, guiSkin.customStyles[3]); |
| | | } |
| | | else |
| | | { |
| | | EditorGUILayout.LabelField(" 场景物件列表:", guiSkin.customStyles[0], GUILayout.Height(22), GUILayout.Width(100)); |
| | | GUILayout.FlexibleSpace(); |
| | | } |
| | | EditorGUILayout.LabelField("ResName:", guiSkin.customStyles[0], GUILayout.Height(22), GUILayout.Width(60)); |
| | | newSceneObjResName = EditorGUILayout.TextField(newSceneObjResName, guiSkin.textField, GUILayout.Width(100), GUILayout.Height(20)); |
| | | if (GUILayout.Button("添加", guiSkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | | { |
| | | Debug.Log("!!!"); |
| | | var _sceneObject = CreateSceneObject(); |
| | | if (_sceneObject) |
| | | { |
| | | sceneObjList.Add(_sceneObject); |
| | | showSceneObjList = true; |
| | | } |
| | | } |
| | | EditorGUILayout.EndHorizontal(); |
| | | |
| | | if (showSceneObjList) |
| | | { |
| | | |
| | | } |
| | | EditorGUILayout.EndVertical(); |
| | | } |
| | | |
| | | EditorGUI.indentLevel -= 1; |
| | | 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 |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2dbb0276e4facaa42986e94f476fc552 |
| | | timeCreated: 1547811633 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | EditorGUILayout.BeginVertical(guiSkin.box); |
| | | EditorGUILayout.BeginHorizontal(GUILayout.Height(22)); |
| | | EditorGUI.indentLevel += 1; |
| | | showDetail = EditorGUILayout.Foldout(showDetail, " 触发器ID:" + id, true, guiSkin.toggle); |
| | | showDetail = EditorGUILayout.Foldout(showDetail, " 触发器ID:" + id, true, guiSkin.customStyles[3]); |
| | | if (GUILayout.Button("查找", guiSkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | | { |
| | | Selection.activeGameObject = gameObject; |
| | |
| | | EditorGUILayout.EndHorizontal(); |
| | | EditorGUILayout.BeginVertical(guiSkin.customStyles[1]); |
| | | EditorGUILayout.BeginHorizontal(GUILayout.Height(22)); |
| | | showEventList = EditorGUILayout.Foldout(showEventList, " 触发事件列表", true, guiSkin.toggle); |
| | | showEventList = EditorGUILayout.Foldout(showEventList, " 触发事件列表", true, guiSkin.customStyles[3]); |
| | | if (GUILayout.Button("添加", guiSkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | | { |
| | | eventIDList.Add(0); |
| | |
| | | { |
| | | bw.Write(npcID); |
| | | bw.Write(ai); |
| | | bw.Write((float)System.Math.Round(transform.position.x)); |
| | | bw.Write((float)System.Math.Round(transform.position.y)); |
| | | bw.Write((float)System.Math.Round(transform.position.z)); |
| | | bw.Write(Mathf.Round(transform.position.x)); |
| | | bw.Write(Mathf.Round(transform.position.y)); |
| | | bw.Write(Mathf.Round(transform.position.z)); |
| | | } |
| | | |
| | | public void Load(BinaryReader br) |
| | |
| | | float _y = br.ReadSingle(); |
| | | float _z = br.ReadSingle(); |
| | | transform.position = new Vector3(_x, _y, _z); |
| | | name = npcID + "_RefreshMonster"; |
| | | name = "RefreshMonster_" + npcID; |
| | | } |
| | | |
| | | public void Export(BinaryWriter bw) |
| New file |
| | |
| | | using System.IO; |
| | | using UnityEngine; |
| | | |
| | | public class Bhv_SceneObjectData : MonoBehaviour |
| | | { |
| | | public string resName; |
| | | |
| | | public void Save(BinaryWriter bw) |
| | | { |
| | | bw.Write(resName); |
| | | } |
| | | |
| | | public void Load(BinaryReader br) |
| | | { |
| | | resName = br.ReadString(); |
| | | name = "RefreshMonster_" + resName; |
| | | } |
| | | |
| | | public void Export(BinaryWriter bw) |
| | | { |
| | | Save(bw); |
| | | } |
| | | } |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: f67c2459d3466914fa155e24aeaf5eb0 |
| | | timeCreated: 1547812535 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | EditorGUILayout.BeginVertical(guiSkin.box); |
| | | EditorGUILayout.BeginHorizontal(GUILayout.Height(20)); |
| | | EditorGUI.indentLevel += 1; |
| | | showDetail = EditorGUILayout.Foldout(showDetail, " No." + mapData.transferList.IndexOf(this), true, guiSkin.toggle); |
| | | showDetail = EditorGUILayout.Foldout(showDetail, " No." + mapData.transferList.IndexOf(this), true, guiSkin.customStyles[3]); |
| | | if (GUILayout.Button("删除", guiSkin.button, GUILayout.Width(60), GUILayout.Height(20))) |
| | | { |
| | | _result = true; |
| | |
| | | { |
| | | public enum E_EventType |
| | | { |
| | | Enemy |
| | | Enemy, |
| | | SceneObject |
| | | } |
| | | |
| | | public int id; |
| | |
| | | --- !u!114 &11400000 |
| | | MonoBehaviour: |
| | | m_ObjectHideFlags: 0 |
| | | m_CorrespondingSourceObject: {fileID: 0} |
| | | m_PrefabParentObject: {fileID: 0} |
| | | m_PrefabInternal: {fileID: 0} |
| | | m_GameObject: {fileID: 0} |
| | | m_Enabled: 1 |
| | |
| | | m_FixedHeight: 0 |
| | | m_StretchWidth: 1 |
| | | m_StretchHeight: 0 |
| | | - m_Name: foldout |
| | | m_Normal: |
| | | m_Background: {fileID: 2800000, guid: 01e032f4a2cce914faef70fb2d628a27, type: 3} |
| | | m_ScaledBackgrounds: [] |
| | | m_TextColor: {r: 1, g: 1, b: 1, a: 1} |
| | | m_Hover: |
| | | m_Background: {fileID: 2800000, guid: 01e032f4a2cce914faef70fb2d628a27, type: 3} |
| | | m_ScaledBackgrounds: [] |
| | | m_TextColor: {r: 1, g: 1, b: 1, a: 1} |
| | | m_Active: |
| | | m_Background: {fileID: 2800000, guid: 2c7e968c8a062644f8f0634fbfcbaf6f, type: 3} |
| | | m_ScaledBackgrounds: [] |
| | | m_TextColor: {r: 1, g: 1, b: 1, a: 1} |
| | | m_Focused: |
| | | m_Background: {fileID: 2800000, guid: 01e032f4a2cce914faef70fb2d628a27, type: 3} |
| | | m_ScaledBackgrounds: [] |
| | | m_TextColor: {r: 1, g: 1, b: 1, a: 1} |
| | | m_OnNormal: |
| | | m_Background: {fileID: 2800000, guid: 2c7e968c8a062644f8f0634fbfcbaf6f, type: 3} |
| | | m_ScaledBackgrounds: [] |
| | | m_TextColor: {r: 1, g: 1, b: 1, a: 1} |
| | | m_OnHover: |
| | | m_Background: {fileID: 2800000, guid: 2c7e968c8a062644f8f0634fbfcbaf6f, type: 3} |
| | | m_ScaledBackgrounds: [] |
| | | m_TextColor: {r: 1, g: 1, b: 1, a: 1} |
| | | m_OnActive: |
| | | m_Background: {fileID: 2800000, guid: 2c7e968c8a062644f8f0634fbfcbaf6f, type: 3} |
| | | m_ScaledBackgrounds: [] |
| | | m_TextColor: {r: 1, g: 1, b: 1, a: 1} |
| | | m_OnFocused: |
| | | m_Background: {fileID: 2800000, guid: 2c7e968c8a062644f8f0634fbfcbaf6f, type: 3} |
| | | m_ScaledBackgrounds: [] |
| | | m_TextColor: {r: 1, g: 1, b: 1, a: 1} |
| | | m_Border: |
| | | m_Left: 16 |
| | | m_Right: 0 |
| | | m_Top: 16 |
| | | m_Bottom: 0 |
| | | m_Margin: |
| | | m_Left: 4 |
| | | m_Right: 4 |
| | | m_Top: 4 |
| | | m_Bottom: 4 |
| | | m_Padding: |
| | | m_Left: 15 |
| | | m_Right: 0 |
| | | m_Top: 3 |
| | | m_Bottom: 0 |
| | | m_Overflow: |
| | | m_Left: 0 |
| | | m_Right: 0 |
| | | m_Top: 0 |
| | | m_Bottom: 0 |
| | | m_Font: {fileID: 0} |
| | | m_FontSize: 12 |
| | | m_FontStyle: 0 |
| | | m_Alignment: 0 |
| | | m_WordWrap: 0 |
| | | m_RichText: 1 |
| | | m_TextClipping: 1 |
| | | m_ImagePosition: 0 |
| | | m_ContentOffset: {x: 0, y: 0} |
| | | m_FixedWidth: 0 |
| | | m_FixedHeight: 0 |
| | | m_StretchWidth: 1 |
| | | m_StretchHeight: 0 |
| | | m_Settings: |
| | | m_DoubleClickSelectsWord: 1 |
| | | m_TripleClickSelectsLine: 1 |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 2c7e968c8a062644f8f0634fbfcbaf6f |
| | | timeCreated: 1547802123 |
| | | licenseType: Pro |
| | | TextureImporter: |
| | | fileIDToRecycleName: {} |
| | | serializedVersion: 4 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 1 |
| | | sRGBTexture: 1 |
| | | linearTexture: 0 |
| | | fadeOut: 0 |
| | | borderMipMap: 0 |
| | | mipMapFadeDistanceStart: 1 |
| | | mipMapFadeDistanceEnd: 3 |
| | | bumpmap: |
| | | convertToNormalMap: 0 |
| | | externalNormalMap: 0 |
| | | heightScale: 0.25 |
| | | normalMapFilter: 0 |
| | | isReadable: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 6 |
| | | cubemapConvolution: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: 1 |
| | | maxTextureSize: 2048 |
| | | textureSettings: |
| | | filterMode: -1 |
| | | aniso: -1 |
| | | mipBias: -1 |
| | | wrapMode: -1 |
| | | nPOTScale: 1 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 0 |
| | | spriteExtrude: 1 |
| | | spriteMeshType: 1 |
| | | alignment: 0 |
| | | spritePivot: {x: 0.5, y: 0.5} |
| | | spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
| | | spritePixelsToUnits: 100 |
| | | alphaUsage: 1 |
| | | alphaIsTransparency: 0 |
| | | spriteTessellationDetail: -1 |
| | | textureType: 0 |
| | | textureShape: 1 |
| | | maxTextureSizeSet: 0 |
| | | compressionQualitySet: 0 |
| | | textureFormatSet: 0 |
| | | platformSettings: |
| | | - buildTarget: DefaultTexturePlatform |
| | | maxTextureSize: 2048 |
| | | textureFormat: -1 |
| | | textureCompression: 1 |
| | | compressionQuality: 50 |
| | | crunchedCompression: 0 |
| | | allowsAlphaSplitting: 0 |
| | | overridden: 0 |
| | | spriteSheet: |
| | | serializedVersion: 2 |
| | | sprites: [] |
| | | outline: [] |
| | | spritePackingTag: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 01e032f4a2cce914faef70fb2d628a27 |
| | | timeCreated: 1547802123 |
| | | licenseType: Pro |
| | | TextureImporter: |
| | | fileIDToRecycleName: {} |
| | | serializedVersion: 4 |
| | | mipmaps: |
| | | mipMapMode: 0 |
| | | enableMipMap: 1 |
| | | sRGBTexture: 1 |
| | | linearTexture: 0 |
| | | fadeOut: 0 |
| | | borderMipMap: 0 |
| | | mipMapFadeDistanceStart: 1 |
| | | mipMapFadeDistanceEnd: 3 |
| | | bumpmap: |
| | | convertToNormalMap: 0 |
| | | externalNormalMap: 0 |
| | | heightScale: 0.25 |
| | | normalMapFilter: 0 |
| | | isReadable: 0 |
| | | grayScaleToAlpha: 0 |
| | | generateCubemap: 6 |
| | | cubemapConvolution: 0 |
| | | seamlessCubemap: 0 |
| | | textureFormat: 1 |
| | | maxTextureSize: 2048 |
| | | textureSettings: |
| | | filterMode: -1 |
| | | aniso: -1 |
| | | mipBias: -1 |
| | | wrapMode: -1 |
| | | nPOTScale: 1 |
| | | lightmap: 0 |
| | | compressionQuality: 50 |
| | | spriteMode: 0 |
| | | spriteExtrude: 1 |
| | | spriteMeshType: 1 |
| | | alignment: 0 |
| | | spritePivot: {x: 0.5, y: 0.5} |
| | | spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
| | | spritePixelsToUnits: 100 |
| | | alphaUsage: 1 |
| | | alphaIsTransparency: 0 |
| | | spriteTessellationDetail: -1 |
| | | textureType: 0 |
| | | textureShape: 1 |
| | | maxTextureSizeSet: 0 |
| | | compressionQualitySet: 0 |
| | | textureFormatSet: 0 |
| | | platformSettings: |
| | | - buildTarget: DefaultTexturePlatform |
| | | maxTextureSize: 2048 |
| | | textureFormat: -1 |
| | | textureCompression: 1 |
| | | compressionQuality: 50 |
| | | crunchedCompression: 0 |
| | | allowsAlphaSplitting: 0 |
| | | overridden: 0 |
| | | spriteSheet: |
| | | serializedVersion: 2 |
| | | sprites: [] |
| | | outline: [] |
| | | spritePackingTag: |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | EditorGUILayout.BeginVertical(gUISkin.box); |
| | | EditorGUILayout.BeginHorizontal(GUILayout.Height(22)); |
| | | EditorGUI.indentLevel += 1; |
| | | _mapData.showTriggerList = EditorGUILayout.Foldout(_mapData.showTriggerList, " 触发器列表", true, gUISkin.toggle); |
| | | _mapData.showTriggerList = EditorGUILayout.Foldout(_mapData.showTriggerList, " 触发器列表", true, gUISkin.customStyles[3]); |
| | | EditorGUI.indentLevel -= 1; |
| | | if (GUILayout.Button("添加", gUISkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | | { |
| | |
| | | EditorGUILayout.BeginVertical(gUISkin.box); |
| | | EditorGUILayout.BeginHorizontal(GUILayout.Height(22)); |
| | | EditorGUI.indentLevel += 1; |
| | | _mapData.showEventList = EditorGUILayout.Foldout(_mapData.showEventList, " 事件列表", true, gUISkin.toggle); |
| | | _mapData.showEventList = EditorGUILayout.Foldout(_mapData.showEventList, " 事件列表", true, gUISkin.customStyles[3]); |
| | | EditorGUI.indentLevel -= 1; |
| | | eventType = (Evt.E_EventType)EditorGUILayout.EnumPopup(eventType, gUISkin.box, GUILayout.Height(22), GUILayout.Width(100)); |
| | | if (GUILayout.Button("添加", gUISkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | |
| | | EditorGUILayout.BeginVertical(gUISkin.box); |
| | | EditorGUILayout.BeginHorizontal(GUILayout.Height(22)); |
| | | EditorGUI.indentLevel += 1; |
| | | _mapData.showTransferList = EditorGUILayout.Foldout(_mapData.showTransferList, " 传送组列表", true, gUISkin.toggle); |
| | | _mapData.showTransferList = EditorGUILayout.Foldout(_mapData.showTransferList, " 传送组列表", true, gUISkin.customStyles[3]); |
| | | EditorGUI.indentLevel -= 1; |
| | | if (GUILayout.Button("添加", gUISkin.button, GUILayout.Width(60), GUILayout.Height(22))) |
| | | { |
| | |
| | | /// 传送点列表 End |
| | | /// -------------------------------------------------------------------------------- |
| | | |
| | | /// -------------------------------------------------------------------------------- |
| | | /// 场景物件列表 Start |
| | | |
| | | /// 场景物件列表 End |
| | | /// -------------------------------------------------------------------------------- |
| | | |
| | | EditorGUILayout.EndVertical(); |
| | | |
| | | if (GUI.changed) |
| | |
| | | |
| | | if (type == Evt.E_EventType.Enemy) |
| | | { |
| | | var _event = CreateNewGO(Bhv_MapData.NodeName_Event + RequestEventID()); |
| | | var _event = CreateNewGO(Bhv_MapData.NodeName_Event + "RefreshEvemy_" + RequestEventID()); |
| | | var _eventBhv = _event.AddComponent<Bhv_Evt_RefreshMonster>(); |
| | | _eventBhv.type = type; |
| | | _event.transform.SetParent(_mapData.transform.Find(Bhv_MapData.NodeName_EventList)); |
| | | _mapData.eventList.Add(_eventBhv); |
| | | |
| | | _event.transform.position = SceneCameraRaycastPosition(); |
| | | } |
| | | else if (type == Evt.E_EventType.SceneObject) |
| | | { |
| | | var _event = CreateNewGO(Bhv_MapData.NodeName_Event + "RefreshSceneObject_" + RequestEventID()); |
| | | var _eventBhv = _event.AddComponent<Bhv_Evt_RefreshSceneObject>(); |
| | | _eventBhv.type = type; |
| | | _event.transform.SetParent(_mapData.transform.Find(Bhv_MapData.NodeName_EventList)); |
| | | _mapData.eventList.Add(_eventBhv); |
| | | |
| | | _event.transform.position = SceneCameraRaycastPosition(); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static Vector3 SceneCameraRaycastPosition() |
| | | { |
| | | RaycastHit _hit; |
| | | Ray _ray = SceneView.lastActiveSceneView.camera.ViewportPointToRay(new Vector3(.5f, .5f, 0)); |
| | | if (Physics.Raycast(_ray, out _hit, 1000f, LayerUtility.WalkbleMask)) |
| | | { |
| | | return _hit.point; |
| | | } |
| | | |
| | | return Vector3.zero; |
| | | } |
| | | } |
| | | } |
| | |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | }
|
| | | if (vNetData.socketType == GameNetSystem.SocketType.CrossSever)
|
| | | {
|
| | | if (vNetData.RefreshType == (int)PlayerDataRefresh.FightPower)
|
| | | {
|
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | | if (vNetData.RefreshType == (int)PlayerDataRefresh.OfficialRank) |
| | | { |
| | |
| | | {
|
| | | onFreePlatformLogoutOk();
|
| | | }
|
| | | FreePlatformInfo = null;
|
| | | break;
|
| | | case CodeA2U.FreePlatformLogoutFail:
|
| | | if (onFreePlatformLogoutFail != null)
|
| | |
| | | * ClientPackage向sdk发送分包id
|
| | | */
|
| | | public const int ClientPackage = 400;
|
| | | /**
|
| | | * 发送事件
|
| | | */
|
| | | public static int SendRegistEvent = 500;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | m_Json.Clear();
|
| | | m_Json["code"] = CodeU2A.FreePlatformLogout;
|
| | | SendMessageToSDK(m_Json);
|
| | | if (ChannelPlatform == E_ChannelPlatform.Yl)
|
| | | {
|
| | | FreePlatformLogin();
|
| | | }
|
| | | #endif
|
| | | }
|
| | |
|
| | |
| | | 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();
|
| | |
| | | Do("global.define"); |
| | | Do("global.stringutil"); |
| | | Do("protocol.LuaProtocalRegister"); |
| | | Do("hotfix.hotfix"); |
| | | |
| | | #if !UNITY_EDITOR |
| | | Do("hotfix.hotfix"); |
| | | #endif |
| | | lastGCTime = 0f; |
| | | } |
| | | |
| | |
| | | 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;
|
| | | }
|
| | |
|
| | |
| | | var _hero = PlayerDatas.Instance.hero;
|
| | | if (_hero != null)
|
| | | {
|
| | | _hero.Behaviour.StopHandupAI();
|
| | | _hero.Behaviour.StopHandupAI(true);
|
| | | SnxxzGame.Instance.StartCoroutine(Co_HeroMoveToPos(new Vector3(_buffPos.x, 0, _buffPos.y),
|
| | | _help.fairyWarBuffs[_index].NPCID));
|
| | | }
|
| | |
| | | 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;
|
| | | }
|
| | |
| | | {
|
| | | RemainingNum = (WeekPartyAction.TotalTimes - rewardNum) / WeekPartyAction.SingleTimes;
|
| | | }
|
| | | if (WeekPartyAction.TotalTimes -carryOutNum> 0)
|
| | | if (WeekPartyAction.TotalTimes -carryOutNum> 0 && RemainingNum>0)
|
| | | {
|
| | | m_TextA.text = Language.Get("OSA_1", RemainingNum);
|
| | | }
|
| | |
| | | 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; |