视角切换,路线规划
This commit is contained in:
parent
34dfaf90b3
commit
dd19d54dd0
|
@ -40,7 +40,7 @@ Material:
|
|||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
m_Texture: {fileID: 2800000, guid: e1c10d947473169409cd40fe73c2577b, type: 3}
|
||||
m_Texture: {fileID: 2800000, guid: ade5e4e2ad056e24989fd274f0a1f59b, type: 3}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
|
|
|
@ -28,7 +28,7 @@ Transform:
|
|||
m_GameObject: {fileID: 555760222174720032}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 2, y: 2, z: 2}
|
||||
m_LocalScale: {x: 10, y: 10, z: 10}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
|
@ -0,0 +1,92 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ade5e4e2ad056e24989fd274f0a1f59b
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -48,8 +48,7 @@ MonoBehaviour:
|
|||
camera: {fileID: 0}
|
||||
selectedObject: {fileID: 0}
|
||||
lineRenderer: {fileID: 0}
|
||||
positions: []
|
||||
FireSpeed: 20
|
||||
unmannedAerialVehicleManage: {fileID: 0}
|
||||
--- !u!120 &1925857787081531138
|
||||
LineRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -92,7 +91,7 @@ LineRenderer:
|
|||
m_Positions: []
|
||||
m_Parameters:
|
||||
serializedVersion: 3
|
||||
widthMultiplier: 1
|
||||
widthMultiplier: 5
|
||||
widthCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
|
|
|
@ -93,7 +93,7 @@ LineRenderer:
|
|||
m_Positions: []
|
||||
m_Parameters:
|
||||
serializedVersion: 3
|
||||
widthMultiplier: 1
|
||||
widthMultiplier: 5
|
||||
widthCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
|
|
|
@ -46,6 +46,9 @@ public class ToolsBootstrap : MonoSingleton<ToolsBootstrap>
|
|||
simpleCameraController = syncPlayer.GetComponent<SimpleCameraController>();
|
||||
}
|
||||
|
||||
private Vector3 recordPosition = new Vector3();
|
||||
private Vector3 recordeulerAngles = new Vector3();
|
||||
|
||||
/// <summary>
|
||||
/// 1-3D 2-2D
|
||||
/// </summary>
|
||||
|
@ -58,8 +61,8 @@ public class ToolsBootstrap : MonoSingleton<ToolsBootstrap>
|
|||
if (state == 1)
|
||||
{
|
||||
buleInstruct.SetActive(false);
|
||||
mCamera.transform.position = new Vector3(-118f, 163f, -409f);
|
||||
mCamera.transform.eulerAngles = new Vector3(23f, 0f, 0f);
|
||||
mCamera.transform.position = recordPosition;
|
||||
mCamera.transform.eulerAngles = recordeulerAngles;
|
||||
mCamera.orthographic = false;
|
||||
simpleCameraController.enabled = true;
|
||||
Switch2DModel(false);
|
||||
|
@ -67,6 +70,8 @@ public class ToolsBootstrap : MonoSingleton<ToolsBootstrap>
|
|||
}
|
||||
else if (state == 2)
|
||||
{
|
||||
recordPosition = mCamera.transform.position;
|
||||
recordeulerAngles = mCamera.transform.eulerAngles;
|
||||
buleInstruct.SetActive(true);
|
||||
mCamera.transform.position = new Vector3(0, 556f, -10f);
|
||||
mCamera.transform.eulerAngles = new Vector3(90f, 0f, 0f);
|
||||
|
|
|
@ -18,7 +18,7 @@ public class DistanceMeasurement : MonoBehaviour
|
|||
{
|
||||
if (isPathCanBePlanned)
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
if (Input.GetMouseButtonDown(0)&& IsPointerOverUI())
|
||||
{
|
||||
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
||||
RaycastHit hit;
|
||||
|
@ -27,7 +27,7 @@ public class DistanceMeasurement : MonoBehaviour
|
|||
AddMarker(hit.point);
|
||||
}
|
||||
}
|
||||
if (Input.GetMouseButtonDown(1))
|
||||
if (Input.GetMouseButtonDown(1) && IsPointerOverUI())
|
||||
{
|
||||
ClearMarkers();
|
||||
}
|
||||
|
@ -35,6 +35,12 @@ public class DistanceMeasurement : MonoBehaviour
|
|||
|
||||
}
|
||||
|
||||
bool IsPointerOverUI()
|
||||
{
|
||||
// 检测当前鼠标位置是否在UI上
|
||||
return UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject();
|
||||
}
|
||||
|
||||
void AddMarker(Vector3 position)
|
||||
{
|
||||
// 创建一个新的游戏对象作为标记点
|
||||
|
|
Loading…
Reference in New Issue