| | |
| | | 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))) |
| | | { |
| | | 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)) |
| | | { |
| | | _go.transform.position = _hit.point; |
| | | } |
| | | _go.transform.eulerAngles = Vector3.zero; |
| | | _go.transform.localScale = Vector3.one; |
| | | |
| | | var _sceneObject = _go.AddComponent<Bhv_SceneObjectData>(); |
| | | sceneObjList.Add(_sceneObject); |
| | | |
| | | showSceneObjList = true; |
| | | } |
| | | EditorGUILayout.EndHorizontal(); |
| | | |
| | | if (showSceneObjList) |
| | | { |
| | | |
| | | } |
| | | EditorGUILayout.EndVertical(); |
| | | } |
| | | |
| | | EditorGUI.indentLevel -= 1; |
| | | EditorGUILayout.EndVertical(); |
| | | return _result; |
| | | } |
| | | #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; |
| | | } |
| | | } |
| | | } |