修改更新
This commit is contained in:
parent
e75e885416
commit
4558ccec21
|
|
@ -28,7 +28,6 @@
|
||||||
public bool canMoveTargetPos = true;
|
public bool canMoveTargetPos = true;
|
||||||
public bool isLimitAroundPos = false;
|
public bool isLimitAroundPos = false;
|
||||||
public bool isLimitMoveArea = false;
|
public bool isLimitMoveArea = false;
|
||||||
|
|
||||||
#region Field and Property
|
#region Field and Property
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Around center.
|
/// Around center.
|
||||||
|
|
@ -131,8 +130,9 @@
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
//判断相机是否进入房间内
|
//判断相机是否进入房间内
|
||||||
if (transform.position.y > 3)
|
if (transform.position.y > 4)
|
||||||
{
|
{
|
||||||
|
//Debug.Log(transform.position.y);
|
||||||
isNear = false;
|
isNear = false;
|
||||||
//显示空间Icon
|
//显示空间Icon
|
||||||
ModelManager.instance.CameraNear(false);
|
ModelManager.instance.CameraNear(false);
|
||||||
|
|
@ -143,18 +143,18 @@
|
||||||
//隐藏空间Icon
|
//隐藏空间Icon
|
||||||
ModelManager.instance.CameraNear(true);
|
ModelManager.instance.CameraNear(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.A))
|
if (Input.GetKeyDown(KeyCode.A))
|
||||||
{
|
{
|
||||||
Debug.Log(transform.position.x + "," + transform.position.y + "," + transform.position.z + "," + AroundPos.x + "," + AroundPos.y + "," + AroundPos.z);
|
Debug.Log(transform.position.x + "," + transform.position.y + "," + transform.position.z + "," + AroundPos.x + "," + AroundPos.y + "," + AroundPos.z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
AroundPos = GetIntersectWithLineAndPlane(transform.position, transform.forward, Vector3.up, transform.up * 3);
|
AroundPos = GetIntersectWithLineAndPlane(transform.position, transform.forward, Vector3.up, transform.up * 3);
|
||||||
Debug.Log("围绕中心点"+AroundPos);
|
Debug.Log("围绕中心点" + AroundPos);
|
||||||
CurrentDistance = targetDistance = Vector3.Distance(transform.position, AroundPos);
|
CurrentDistance = targetDistance = Vector3.Distance(transform.position, AroundPos);
|
||||||
CurrentAngles = targetAngles = transform.eulerAngles;
|
CurrentAngles = targetAngles = transform.eulerAngles;
|
||||||
CurrentAroundPos = targetAroundPos = AroundPos;
|
CurrentAroundPos = targetAroundPos = AroundPos;
|
||||||
|
|
@ -163,8 +163,9 @@
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 重新计算中心点
|
/// 重新计算中心点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void InitTarget() {
|
public void InitTarget()
|
||||||
AroundPos = transform.position+ transform.forward*3;
|
{
|
||||||
|
AroundPos = transform.position + transform.forward * 3;
|
||||||
//Debug.Log("围绕中心点"+AroundPos);
|
//Debug.Log("围绕中心点"+AroundPos);
|
||||||
CurrentDistance = targetDistance = Vector3.Distance(transform.position, AroundPos);
|
CurrentDistance = targetDistance = Vector3.Distance(transform.position, AroundPos);
|
||||||
CurrentAngles = targetAngles = transform.eulerAngles;
|
CurrentAngles = targetAngles = transform.eulerAngles;
|
||||||
|
|
@ -175,11 +176,11 @@
|
||||||
public void SetControlModeUIRect(RectTransform rect)
|
public void SetControlModeUIRect(RectTransform rect)
|
||||||
{
|
{
|
||||||
_controlMode = ControlMode.UIRect;
|
_controlMode = ControlMode.UIRect;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected virtual void LateUpdate()
|
protected virtual void LateUpdate()
|
||||||
{
|
{
|
||||||
|
|
@ -200,7 +201,7 @@
|
||||||
}
|
}
|
||||||
transform.position = targetPos;
|
transform.position = targetPos;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (_controlMode == ControlMode.ALL)
|
if (_controlMode == ControlMode.ALL)
|
||||||
|
|
@ -446,7 +447,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -482,7 +483,7 @@
|
||||||
|
|
||||||
#region 移动相机视角 author:wm
|
#region 移动相机视角 author:wm
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public static bool isMobile = false;
|
public static bool isMobile = false;
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ Material:
|
||||||
- _EnableGeometricSpecularAA: 0
|
- _EnableGeometricSpecularAA: 0
|
||||||
- _EnergyConservingSpecularColor: 1
|
- _EnergyConservingSpecularColor: 1
|
||||||
- _GlossMapScale: 1
|
- _GlossMapScale: 1
|
||||||
- _Glossiness: 0
|
- _Glossiness: 1
|
||||||
- _GlossyReflections: 1
|
- _GlossyReflections: 1
|
||||||
- _HeightAmplitude: 0.02
|
- _HeightAmplitude: 0.02
|
||||||
- _HeightCenter: 0.5
|
- _HeightCenter: 0.5
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ Material:
|
||||||
- _EnableGeometricSpecularAA: 0
|
- _EnableGeometricSpecularAA: 0
|
||||||
- _EnergyConservingSpecularColor: 1
|
- _EnergyConservingSpecularColor: 1
|
||||||
- _GlossMapScale: 1
|
- _GlossMapScale: 1
|
||||||
- _Glossiness: 0.59
|
- _Glossiness: 0.794
|
||||||
- _GlossyReflections: 1
|
- _GlossyReflections: 1
|
||||||
- _HeightAmplitude: 0.02
|
- _HeightAmplitude: 0.02
|
||||||
- _HeightCenter: 0.5
|
- _HeightCenter: 0.5
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ Material:
|
||||||
- _EnableGeometricSpecularAA: 0
|
- _EnableGeometricSpecularAA: 0
|
||||||
- _EnergyConservingSpecularColor: 1
|
- _EnergyConservingSpecularColor: 1
|
||||||
- _GlossMapScale: 1
|
- _GlossMapScale: 1
|
||||||
- _Glossiness: 0.368
|
- _Glossiness: 0.079
|
||||||
- _GlossyReflections: 1
|
- _GlossyReflections: 1
|
||||||
- _HeightAmplitude: 0.02
|
- _HeightAmplitude: 0.02
|
||||||
- _HeightCenter: 0.5
|
- _HeightCenter: 0.5
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ Material:
|
||||||
- _EnableGeometricSpecularAA: 0
|
- _EnableGeometricSpecularAA: 0
|
||||||
- _EnergyConservingSpecularColor: 1
|
- _EnergyConservingSpecularColor: 1
|
||||||
- _GlossMapScale: 1
|
- _GlossMapScale: 1
|
||||||
- _Glossiness: 0
|
- _Glossiness: 0.602
|
||||||
- _GlossyReflections: 1
|
- _GlossyReflections: 1
|
||||||
- _HeightAmplitude: 0.02
|
- _HeightAmplitude: 0.02
|
||||||
- _HeightCenter: 0.5
|
- _HeightCenter: 0.5
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -12562,12 +12562,12 @@ GameObject:
|
||||||
- component: {fileID: 1293563870}
|
- component: {fileID: 1293563870}
|
||||||
- component: {fileID: 1293563869}
|
- component: {fileID: 1293563869}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: WuDing
|
m_Name: "\u540A\u9876"
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 4294967295
|
m_StaticEditorFlags: 4294967295
|
||||||
m_IsActive: 0
|
m_IsActive: 1
|
||||||
--- !u!4 &1293563868
|
--- !u!4 &1293563868
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -214868,6 +214868,7 @@ MonoBehaviour:
|
||||||
camList: []
|
camList: []
|
||||||
clients: []
|
clients: []
|
||||||
counters: []
|
counters: []
|
||||||
|
_spaceArea: {fileID: 0}
|
||||||
iconPanel: {fileID: 0}
|
iconPanel: {fileID: 0}
|
||||||
heatPoints: []
|
heatPoints: []
|
||||||
m_Vector3s: []
|
m_Vector3s: []
|
||||||
|
|
@ -438388,7 +438389,7 @@ GameObject:
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 0
|
m_IsActive: 1
|
||||||
--- !u!223 &1926564803572105914
|
--- !u!223 &1926564803572105914
|
||||||
Canvas:
|
Canvas:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -438422,10 +438423,10 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_UiScaleMode: 0
|
m_UiScaleMode: 1
|
||||||
m_ReferencePixelsPerUnit: 100
|
m_ReferencePixelsPerUnit: 100
|
||||||
m_ScaleFactor: 1
|
m_ScaleFactor: 1
|
||||||
m_ReferenceResolution: {x: 800, y: 600}
|
m_ReferenceResolution: {x: 1920, y: 1080}
|
||||||
m_ScreenMatchMode: 0
|
m_ScreenMatchMode: 0
|
||||||
m_MatchWidthOrHeight: 0
|
m_MatchWidthOrHeight: 0
|
||||||
m_PhysicalUnit: 3
|
m_PhysicalUnit: 3
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ using UnityEngine.EventSystems;
|
||||||
|
|
||||||
public class ClientClick : MonoBehaviour
|
public class ClientClick : MonoBehaviour
|
||||||
{
|
{
|
||||||
//人员编号
|
//人员编号
|
||||||
public int index;
|
public int index;
|
||||||
//是否允许单体化展示
|
//是否允许单体化展示
|
||||||
public bool isSingle = false;
|
public bool isSingle = false;
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
|
|
@ -26,11 +26,11 @@ public class ClientClick : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (EventSystem.current.IsPointerOverGameObject())
|
if (EventSystem.current.IsPointerOverGameObject())
|
||||||
{
|
{
|
||||||
Debug.Log("鼠标在UI上");
|
Debug.Log("鼠标在UI上");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ViewCenter();
|
ViewCenter();
|
||||||
//智慧运营模块
|
//智慧运营模块
|
||||||
if (Main.intance.curModuleIndex == 1)
|
if (Main.intance.curModuleIndex == 1)
|
||||||
Main.intance.m_htmlPanel.CallFunction("showOverTimeTip");
|
Main.intance.m_htmlPanel.CallFunction("showOverTimeTip");
|
||||||
if (!isSingle)
|
if (!isSingle)
|
||||||
|
|
@ -40,14 +40,14 @@ public class ClientClick : MonoBehaviour
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 视角居中
|
/// 视角居中
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void ViewCenter()
|
void ViewCenter()
|
||||||
{
|
{
|
||||||
Debug.Log("model" + transform.name);
|
Debug.Log("model" + transform.name);
|
||||||
//获取模型中心点位置(加上模型方向*3)X轴方向朝前
|
//获取模型中心点位置(加上模型方向*3)X轴方向朝前
|
||||||
Vector3 playerPos = transform.position + transform.right * 3;
|
Vector3 playerPos = transform.position + transform.right * 3;
|
||||||
//相机面向设备
|
//相机面向设备
|
||||||
Quaternion angle = Quaternion.LookRotation(-transform.right);
|
Quaternion angle = Quaternion.LookRotation(-transform.right);
|
||||||
Debug.Log("pos" + playerPos + ";angle" + angle);
|
Debug.Log("pos" + playerPos + ";angle" + angle);
|
||||||
//Main.intance.mainCamera.GetComponent<CameraView>().CameraMoveTarget(playerPos, angle);
|
//Main.intance.mainCamera.GetComponent<CameraView>().CameraMoveTarget(playerPos, angle);
|
||||||
|
|
@ -55,37 +55,34 @@ public class ClientClick : MonoBehaviour
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 单体化展示
|
/// 单体化展示
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void ShowSingle()
|
void ShowSingle()
|
||||||
{
|
{
|
||||||
//设备信息弹窗
|
//设备信息弹窗
|
||||||
Main.intance.m_htmlPanel.CallFunction("U3DShowPeopleDetails", 0);
|
Main.intance.m_htmlPanel.CallFunction("U3DShowPeopleDetails", 0);
|
||||||
|
|
||||||
//将上一个单体化物体隐藏
|
//将上一个单体化物体隐藏
|
||||||
if (Main.intance.CurentSingleObj != null)
|
if (Main.intance.CurentSingleObj != null)
|
||||||
{
|
{
|
||||||
Main.intance.singleCam.GetComponent<Camera360>().ChangeObjLayer(Main.intance.CurentSingleObj, "Default");
|
Main.intance.singleCam.GetComponent<Camera360>().ChangeObjLayer(Main.intance.CurentSingleObj, "Default");
|
||||||
}
|
}
|
||||||
//显示单体化展示页面
|
//显示单体化展示页面
|
||||||
Main.intance.CurentSinglePage.SetActive(true);
|
Main.intance.CurentSinglePage.SetActive(true);
|
||||||
//将当前物体设置为单体化360观察的物体
|
//将当前物体设置为单体化360观察的物体
|
||||||
Main.intance.CurentSingleObj = gameObject;
|
Main.intance.CurentSingleObj = gameObject;
|
||||||
Main.intance.singleCam.GetComponent<Camera360>().SetTarget(transform);
|
Main.intance.singleCam.GetComponent<Camera360>().SetTarget(transform);
|
||||||
Main.intance.singleCam.GetComponent<Camera360>().ChangeObjLayer(Main.intance.CurentSingleObj, "single360");
|
Main.intance.singleCam.GetComponent<Camera360>().ChangeObjLayer(Main.intance.CurentSingleObj, "single360");
|
||||||
Main.intance.ShowSingleModel(true);
|
Main.intance.ShowSingleModel(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 在自身添加碰撞体
|
/// 在自身添加碰撞体
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="gameObject"></param>
|
/// <param name="gameObject"></param>
|
||||||
public void AddGameObjectCollider()
|
public void AddGameObjectCollider()
|
||||||
{
|
{
|
||||||
|
|
||||||
//获取物体的最小包围盒
|
//获取物体的最小包围盒
|
||||||
Bounds itemBound = GetLocalBounds(gameObject);
|
Bounds itemBound = GetLocalBounds(gameObject);
|
||||||
|
|
||||||
if (!gameObject.GetComponent<Collider>())
|
if (!gameObject.GetComponent<Collider>())
|
||||||
|
|
@ -97,7 +94,7 @@ public class ClientClick : MonoBehaviour
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获得对象的最小包围盒
|
/// 获得对象的最小包围盒
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static Bounds GetLocalBounds(GameObject target)
|
public static Bounds GetLocalBounds(GameObject target)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ public class Main : UIBase
|
||||||
//切换视角时相机移动速度
|
//切换视角时相机移动速度
|
||||||
private float camMoveSpeed=6;
|
private float camMoveSpeed=6;
|
||||||
//待机时长
|
//待机时长
|
||||||
private float waitTime=120;
|
private float waitTime=8;
|
||||||
|
|
||||||
Tweener t_camAnimAngle;
|
Tweener t_camAnimAngle;
|
||||||
Tweener t_camAnimPos;
|
Tweener t_camAnimPos;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public class ModelManager : MonoBehaviour
|
||||||
//空间Icon特效光圈
|
//空间Icon特效光圈
|
||||||
private List<GameObject> spaceEffectList;
|
private List<GameObject> spaceEffectList;
|
||||||
//分区
|
//分区
|
||||||
private GameObject _spaceArea;
|
public GameObject _spaceArea;
|
||||||
|
|
||||||
//异常Icon
|
//异常Icon
|
||||||
private List<Exception3DIcon> expIconList;
|
private List<Exception3DIcon> expIconList;
|
||||||
|
|
@ -62,9 +62,9 @@ public class ModelManager : MonoBehaviour
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
expIconList = new List<Exception3DIcon>();
|
expIconList = new List<Exception3DIcon>();
|
||||||
wuDing = transform.Find("WuDing");
|
wuDing = transform.Find("吊顶");
|
||||||
iconPanel = transform.Find("3DIconPanel");
|
iconPanel = transform.Find("3DIconPanel");
|
||||||
_spaceArea = transform.Find("fenqu").gameObject;
|
//_spaceArea = transform.Find("fenqu").gameObject;
|
||||||
changePage = transform.Find("ChangeHeatmapEffect").GetComponent<ParticleSystem>();
|
changePage = transform.Find("ChangeHeatmapEffect").GetComponent<ParticleSystem>();
|
||||||
heatmap = GetComponentInChildren<Heatmap>(true);
|
heatmap = GetComponentInChildren<Heatmap>(true);
|
||||||
m_heatpoint = GetComponentInChildren<HeatPointManager>(true);
|
m_heatpoint = GetComponentInChildren<HeatPointManager>(true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue