Browse Source

提示设置在下风向的问题修改。

固定水炮添加旋转,合成文档添加水炮设置的内容。
develop
曹衍涛 4 years ago
parent
commit
f55bca0095
  1. BIN
      Assets/Scene/Dummy.unity
  2. BIN
      Assets/Scene/MainScene_New.unity
  3. 4
      Assets/Scripts/DisasterSetting/FireAlongWindCheck.cs
  4. 299
      Assets/Scripts/DisasterSetting/ZDSP/FCGSPControl.cs
  5. 462
      Assets/Scripts/DisasterSetting/ZDSP/ZDSPControl.cs
  6. 5
      Assets/Scripts/InputSystem/InputManager/InputManager.cs
  7. 4
      Assets/Scripts/Tool/OnDragAlongWindCheck.cs
  8. BIN
      Assets/Sky/Materials/azure[Sky].mat
  9. 4
      Assets/StreamingAssets/Data/DisasterInfos.xml
  10. BIN
      ProjectSettings/ProjectSettings.asset
  11. BIN
      电子沙盘合成文档.docx

BIN
Assets/Scene/Dummy.unity

Binary file not shown.

BIN
Assets/Scene/MainScene_New.unity

Binary file not shown.

4
Assets/Scripts/DisasterSetting/FireAlongWindCheck.cs

@ -61,6 +61,10 @@ public class FireAlongWindCheck : MonoBehaviour {
default:
break;
}
if (weatherMgr.TianQiSettingData.fengli==FengLi.)
{
data.value = 0;
}
return data;
}
}

299
Assets/Scripts/DisasterSetting/ZDSP/FCGSPControl.cs

@ -1,9 +1,16 @@
using AX.MessageSystem;
using AX.InputSystem;
using AX.MessageSystem;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum RotateAxis
{
X,
Y,
Z,
}
public class FCGSPControl : ObjDoubleClick
{
public bool IsWartering;
@ -11,8 +18,17 @@ public class FCGSPControl : ObjDoubleClick
private long id;
public GameObject part;
public GameObject water;
public Transform Hrotate;
public Transform Vrotate;
public RotateAxis HAxis;
public RotateAxis VAxis;
public string Hpath;
public string Vpath;
public float MaxV;
public float MinV;
private void Awake()
{
//sp/sp_bi/sp_tou
int num = int.Parse(name.Substring(4,name.Length-4));
////if (gameObject.name.Split('_').Length > 0)
@ -29,18 +45,219 @@ public class FCGSPControl : ObjDoubleClick
water = GameObject.Instantiate(part, transform);
}
particle = transform.GetComponentInChildren<ParticleControlOfType>(true).transform;
Hrotate = transform.Find(Hpath);
Vrotate = transform.Find(Vpath);
if (particle.gameObject.activeInHierarchy)
{
particle.gameObject.SetActive(false);
}
}
// Start is called before the first frame update
void Start()
{
MessageDispatcher.AddListener("ReplayFrame", ReplayFrameZDSP);
MessageDispatcher.AddListener("ReplayEvent", ReplayEventZDSP);
MessageDispatcher.AddListener("EQUALS_COMMAND", PressureUp);
MessageDispatcher.AddListener("MINUS_COMMAND", PressureDown);
MessageDispatcher.AddListener("U_COMMAND", U);
MessageDispatcher.AddListener("J_COMMAND", J);
MessageDispatcher.AddListener("H_COMMAND", H);
MessageDispatcher.AddListener("K_COMMAND", K);
}
private void OnDestroy()
{
MessageDispatcher.RemoveListener("ReplayFrame", ReplayFrameZDSP);
MessageDispatcher.RemoveListener("ReplayEvent", ReplayEventZDSP);
MessageDispatcher.RemoveListener("EQUALS_COMMAND", PressureUp);
MessageDispatcher.RemoveListener("MINUS_COMMAND", PressureDown);
MessageDispatcher.RemoveListener("U_COMMAND", U);
MessageDispatcher.RemoveListener("J_COMMAND", J);
MessageDispatcher.RemoveListener("H_COMMAND", H);
MessageDispatcher.RemoveListener("K_COMMAND", K);
}
private void K(IMessage obj)
{
if (Hrotate==null)
{
return;
}
var gameObjID = (long)obj.Sender;
if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
{
var speed = ((WeightCmdArgs)obj.Data).Weight * 2f;
switch (HAxis)
{
case RotateAxis.X:
//var x = CheckV(Vrotate.localEulerAngles.x);
Hrotate.localEulerAngles += new Vector3(speed, 0, 0);
break;
case RotateAxis.Y:
Hrotate.localEulerAngles += new Vector3(0, speed, 0);
break;
case RotateAxis.Z:
Hrotate.localEulerAngles += new Vector3(0, 0, speed);
break;
default:
break;
}
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
}
}
private void H(IMessage obj)
{
if (Hrotate == null)
{
return;
}
var gameObjID = (long)obj.Sender;
if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
{
var speed = ((WeightCmdArgs)obj.Data).Weight * 2f;
switch (HAxis)
{
case RotateAxis.X:
//var x = CheckV(Vrotate.localEulerAngles.x);
Hrotate.localEulerAngles -= new Vector3(speed, 0, 0);
break;
case RotateAxis.Y:
Hrotate.localEulerAngles -= new Vector3(0, speed, 0);
break;
case RotateAxis.Z:
Hrotate.localEulerAngles -= new Vector3(0, 0, speed);
break;
default:
break;
}
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
}
}
private void J(IMessage obj)
{
if (Vrotate==null)
{
return;
}
var gameObjID = (long)obj.Sender;
if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
{
var speed = ((WeightCmdArgs)obj.Data).Weight * 2f;
switch (VAxis)
{
case RotateAxis.X:
var x = CheckV(Vrotate.localEulerAngles.x);
if (x < MinV)
{
Vrotate.localEulerAngles = new Vector3(MinV, Vrotate.localEulerAngles.y, Vrotate.localEulerAngles.z);
return;
}
Vrotate.localEulerAngles -= new Vector3(speed, 0, 0);
break;
case RotateAxis.Y:
var y = CheckV(Vrotate.localEulerAngles.y);
if (y < MinV)
{
Vrotate.localEulerAngles = new Vector3(Vrotate.localEulerAngles.x, y, Vrotate.localEulerAngles.z);
return;
}
Vrotate.localEulerAngles -= new Vector3(0, speed, 0);
break;
case RotateAxis.Z:
var z = CheckV(Vrotate.localEulerAngles.z);
if (z < MinV)
{
Vrotate.localEulerAngles = new Vector3(Vrotate.localEulerAngles.x, Vrotate.localEulerAngles.y, z);
return;
}
Vrotate.localEulerAngles -= new Vector3(0, 0, speed);
break;
default:
break;
}
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
}
}
private void U(IMessage obj)
{
if (Vrotate == null)
{
return;
}
var gameObjID = (long)obj.Sender;
if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
{
var speed = ((WeightCmdArgs)obj.Data).Weight * 2f;
switch (VAxis)
{
case RotateAxis.X:
var x = CheckV(Vrotate.localEulerAngles.x);
if (x>MaxV)
{
Vrotate.localEulerAngles = new Vector3(MaxV, Vrotate.localEulerAngles.y, Vrotate.localEulerAngles.z);
return;
}
Vrotate.localEulerAngles += new Vector3( speed, 0,0);
break;
case RotateAxis.Y:
var y = CheckV(Vrotate.localEulerAngles.y);
if (y > MaxV)
{
Vrotate.localEulerAngles = new Vector3(Vrotate.localEulerAngles.x, y, Vrotate.localEulerAngles.z);
return;
}
Vrotate.localEulerAngles += new Vector3( 0,speed, 0);
break;
case RotateAxis.Z:
var z = CheckV(Vrotate.localEulerAngles.z);
if (z > MaxV)
{
Vrotate.localEulerAngles = new Vector3(Vrotate.localEulerAngles.x, Vrotate.localEulerAngles.y, z);
return;
}
Vrotate.localEulerAngles += new Vector3(0, 0,speed);
break;
default:
break;
}
ZDSPData data = GetData();
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(data));
}
}
private void PressureDown(IMessage obj)
{
var gameObjID = (long)obj.Sender;
if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
{
var speed = ((WeightCmdArgs)obj.Data).Weight*0.1f;
float size = particle.GetComponent<ParticleControlOfType>().GetScaleValue();
particle.GetComponent<ParticleControlOfType>().SetScaleValue(size - speed);
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
}
}
private void PressureUp(IMessage obj)
{
if (SelectedObjs.selectedObj == gameObject && ReplaySetting.PlayStatus != PlayStatus.isReplay)
{
var gameObjID = (long)obj.Sender;
if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
{
var speed = ((WeightCmdArgs)obj.Data).Weight*0.1f;
float size= particle.GetComponent<ParticleControlOfType>().GetScaleValue();
particle.GetComponent<ParticleControlOfType>().SetScaleValue(size+speed);
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
}
}
}
private void ReplayEventZDSP(IMessage obj)
@ -70,8 +287,36 @@ public class FCGSPControl : ObjDoubleClick
GetComponent<BaseGameObjInfo>().gameObjID = data.id;
IsWartering = data.isWatering;
particle.GetComponent<ParticleControlOfType>().SetScaleValue(data.scale);
// Body.localEulerAngles = new Vector3(Body.localEulerAngles.x, Body.localEulerAngles.y, data.xRoate);
// Pao.localEulerAngles = new Vector3(data.yRoate, Pao.localEulerAngles.y, Pao.localEulerAngles.z);
switch (HAxis)
{
case RotateAxis.X:
Hrotate.localEulerAngles = new Vector3(data.HRoate, Hrotate.localEulerAngles.y, Hrotate.localEulerAngles.z);
break;
case RotateAxis.Y:
Hrotate.localEulerAngles = new Vector3( Hrotate.localEulerAngles.x, data.HRoate, Hrotate.localEulerAngles.z);
break;
case RotateAxis.Z:
Hrotate.localEulerAngles = new Vector3(Hrotate.localEulerAngles.x, Hrotate.localEulerAngles.y, data.HRoate);
break;
default:
break;
}
switch (VAxis)
{
case RotateAxis.X:
Vrotate.localEulerAngles = new Vector3(data.VRoate, Vrotate.localEulerAngles.y, Vrotate.localEulerAngles.z);
break;
case RotateAxis.Y:
Vrotate.localEulerAngles = new Vector3(Vrotate.localEulerAngles.x, data.VRoate, Vrotate.localEulerAngles.z);
break;
case RotateAxis.Z:
Vrotate.localEulerAngles = new Vector3(Vrotate.localEulerAngles.x, Vrotate.localEulerAngles.y, data.VRoate);
break;
default:
break;
}
//Hrotate.localEulerAngles = new Vector3(Hrotate.localEulerAngles.x, Hrotate.localEulerAngles.y, data.xRoate);
// Pao.localEulerAngles = new Vector3(data.yRoate, Pao.localEulerAngles.y, Pao.localEulerAngles.z);
if (IsWartering)
particle.gameObject.SetActive(true);
else
@ -85,7 +330,7 @@ public class FCGSPControl : ObjDoubleClick
public override void ClickFunc()
{
base.ClickFunc();
Debug.Log(111);
if (!IsWartering)
ResourceLoadWindow.Instance.LoadTipWindow("开启喷水?", () =>
{
@ -103,14 +348,54 @@ public class FCGSPControl : ObjDoubleClick
}
public ZDSPData GetData()
{
return new ZDSPData()
ZDSPData data = new ZDSPData
{
name = gameObject.name,
id = this.id,
isWatering = IsWartering,
scale = particle.GetComponent<ParticleControlOfType>().GetScaleValue(),
//xRoate = Body.localEulerAngles.z,
// yRoate = Pao.localEulerAngles.x
HAxis = HAxis,
VAxis = VAxis,
// xRoate = Hrotate.localEulerAngles.z,
// yRoate = Vrotate.localEulerAngles.x
};
switch (data.VAxis)
{
case RotateAxis.X:
data.VRoate= Vrotate.localEulerAngles.x;
break;
case RotateAxis.Y:
data.VRoate = Vrotate.localEulerAngles.y;
break;
case RotateAxis.Z:
data.VRoate = Vrotate.localEulerAngles.z;
break;
default:
break;
}
switch (data.HAxis)
{
case RotateAxis.X:
data.HRoate = Hrotate.localEulerAngles.x;
break;
case RotateAxis.Y:
data.HRoate = Hrotate.localEulerAngles.y;
break;
case RotateAxis.Z:
data.HRoate = Hrotate.localEulerAngles.z;
break;
default:
break;
}
return data;
}
private float CheckV(float x)
{
if (x >= 180 && x <= 360)
{
x = x - 360;
}
return x;
}
}

462
Assets/Scripts/DisasterSetting/ZDSP/ZDSPControl.cs

@ -11,246 +11,248 @@ public class ZDSPData
public string name;
public long id;
public bool isWatering;
public float xRoate;
public float yRoate;
public float HRoate;
public float VRoate;
public RotateAxis HAxis;
public RotateAxis VAxis;
public float scale;
}
public class ZDSPControl : ObjDoubleClick
{
public bool IsWartering;
public Transform Body;
public Transform Pao;
private ZDSPParticle particle;
private long id;
private void Awake()
{
if (gameObject.name.Split('_').Length > 0)
{
id = 1990199019901990 + (long.Parse)(gameObject.name.Split('_')[1]);
GetComponent<BaseGameObjInfo>().gameObjID = id;
gameObject.name = id.ToString();
}
EntitiesManager.Instance.AddEntity(id, gameObject);
if (!SelectedObjs.gameObjs.Contains(gameObject))
SelectedObjs.gameObjs.Add(gameObject);
}
private void Start()
{
Body = transform.Find("PaoShen");
Pao = Body.transform.Find("PaoGuan");
// particle = Pao.transform.Find("WaterStraight").GetComponent<ZDSPParticle>();
particle = transform.GetComponentInChildren<ZDSPParticle>();
Debug.Log(particle.name);
MessageDispatcher.AddListener("EQUALS_COMMAND", PressureUp);
MessageDispatcher.AddListener("MINUS_COMMAND", PressureDown);
MessageDispatcher.AddListener("U_COMMAND", U);
MessageDispatcher.AddListener("J_COMMAND", J);
MessageDispatcher.AddListener("H_COMMAND", H);
MessageDispatcher.AddListener("K_COMMAND", K);
MessageDispatcher.AddListener("ReplayFrame", ReplayFrameZDSP);
MessageDispatcher.AddListener("ReplayEvent", ReplayEventZDSP);
}
public ZDSPData GetData()
{
return new ZDSPData()
{
name = gameObject.name,
id = this.id,
isWatering = IsWartering,
scale = particle.GetScaleValue(),
xRoate = Body.localEulerAngles.z,
yRoate = Pao.localEulerAngles.x
};
}
void SetData(ZDSPData data)
{
id = data.id;
GetComponent<BaseGameObjInfo>().gameObjID = data.id;
IsWartering = data.isWatering;
particle.SetScaleValue(data.scale);
Body.localEulerAngles = new Vector3(Body.localEulerAngles.x, Body.localEulerAngles.y, data.xRoate);
Pao.localEulerAngles = new Vector3(data.yRoate, Pao.localEulerAngles.y, Pao.localEulerAngles.z);
if (IsWartering)
particle.gameObject.SetActive(true);
else
particle.gameObject.SetActive(false);
}
private void ReplayEventZDSP(IMessage obj)
{
var eventData = (EventData)obj.Data;
if (eventData.eventType == RecordEventType.ZDSP)
{
ZDSPData data = JsonUtility.FromJson<ZDSPData>(eventData.json);
if (data.name == gameObject.name)
SetData(data);
}
}
//public bool IsWartering;
//public Transform Body;
//public Transform Pao;
//private ZDSPParticle particle;
//private long id;
//private void Awake()
//{
// if (gameObject.name.Split('_').Length > 0)
// {
// id = 1990199019901990 + (long.Parse)(gameObject.name.Split('_')[1]);
// GetComponent<BaseGameObjInfo>().gameObjID = id;
// gameObject.name = id.ToString();
// }
// EntitiesManager.Instance.AddEntity(id, gameObject);
// if (!SelectedObjs.gameObjs.Contains(gameObject))
// SelectedObjs.gameObjs.Add(gameObject);
//}
//private void Start()
//{
// Body = transform.Find("PaoShen");
// Pao = Body.transform.Find("PaoGuan");
// // particle = Pao.transform.Find("WaterStraight").GetComponent<ZDSPParticle>();
// particle = transform.GetComponentInChildren<ZDSPParticle>();
// Debug.Log(particle.name);
// MessageDispatcher.AddListener("EQUALS_COMMAND", PressureUp);
// MessageDispatcher.AddListener("MINUS_COMMAND", PressureDown);
// MessageDispatcher.AddListener("U_COMMAND", U);
// MessageDispatcher.AddListener("J_COMMAND", J);
// MessageDispatcher.AddListener("H_COMMAND", H);
// MessageDispatcher.AddListener("K_COMMAND", K);
// MessageDispatcher.AddListener("ReplayFrame", ReplayFrameZDSP);
// MessageDispatcher.AddListener("ReplayEvent", ReplayEventZDSP);
//}
//public ZDSPData GetData()
//{
// return new ZDSPData()
// {
// name = gameObject.name,
// id = this.id,
// isWatering = IsWartering,
// scale = particle.GetScaleValue(),
// xRoate = Body.localEulerAngles.z,
// yRoate = Pao.localEulerAngles.x
// };
//}
//void SetData(ZDSPData data)
//{
// id = data.id;
// GetComponent<BaseGameObjInfo>().gameObjID = data.id;
// IsWartering = data.isWatering;
// particle.SetScaleValue(data.scale);
// Body.localEulerAngles = new Vector3(Body.localEulerAngles.x, Body.localEulerAngles.y, data.xRoate);
// Pao.localEulerAngles = new Vector3(data.yRoate, Pao.localEulerAngles.y, Pao.localEulerAngles.z);
// if (IsWartering)
// particle.gameObject.SetActive(true);
// else
// particle.gameObject.SetActive(false);
//}
//private void ReplayEventZDSP(IMessage obj)
//{
// var eventData = (EventData)obj.Data;
// if (eventData.eventType == RecordEventType.ZDSP)
// {
// ZDSPData data = JsonUtility.FromJson<ZDSPData>(eventData.json);
// if (data.name == gameObject.name)
// SetData(data);
// }
//}
private void ReplayFrameZDSP(IMessage obj)
{
var objectData = (ObjectData)obj.Data;
if (objectData.cloneObjType == CloneObjType.ZDSP)
{
ZDSPData data = JsonUtility.FromJson<ZDSPData>(objectData.json);
if (data.name == gameObject.name)
SetData(data);
}
}
//private void ReplayFrameZDSP(IMessage obj)
//{
// var objectData = (ObjectData)obj.Data;
// if (objectData.cloneObjType == CloneObjType.ZDSP)
// {
// ZDSPData data = JsonUtility.FromJson<ZDSPData>(objectData.json);
// if (data.name == gameObject.name)
// SetData(data);
// }
//}
private void PressureDown(IMessage obj)
{
if (IsWartering && SelectedObjs.selectedObj == gameObject && ReplaySetting.PlayStatus != PlayStatus.isReplay)
particle.Decrease(0.1f);
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
}
//private void PressureDown(IMessage obj)
//{
// if (IsWartering && SelectedObjs.selectedObj == gameObject && ReplaySetting.PlayStatus != PlayStatus.isReplay)
// particle.Decrease(0.1f);
// RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
//}
private void PressureUp(IMessage obj)
{
if (IsWartering && SelectedObjs.selectedObj == gameObject && ReplaySetting.PlayStatus != PlayStatus.isReplay)
particle.Increase(0.1f);
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
}
//private void PressureUp(IMessage obj)
//{
// if (IsWartering && SelectedObjs.selectedObj == gameObject && ReplaySetting.PlayStatus != PlayStatus.isReplay)
// particle.Increase(0.1f);
// RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
//}
private void K(IMessage obj)
{
if (SelectedObjs.selectedObj == gameObject && ReplaySetting.PlayStatus != PlayStatus.isReplay)
{
var gameObjID = (long)obj.Sender;
if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
{
var speed = ((WeightCmdArgs)obj.Data).Weight;
speed = speed * 2;
float x = Body.localEulerAngles.x;
float y = Body.localEulerAngles.y;
float z = Body.localEulerAngles.z;
z = CheckValue(z);
z += speed;
if (z >= 360)
{
z -= 360;
}
if (z <= -360)
{
z += 360;
}
Body.localEulerAngles = new Vector3(x, y, z);
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
}
}
}
//private void K(IMessage obj)
//{
// if (SelectedObjs.selectedObj == gameObject && ReplaySetting.PlayStatus != PlayStatus.isReplay)
// {
// var gameObjID = (long)obj.Sender;
// if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
// {
// var speed = ((WeightCmdArgs)obj.Data).Weight;
// speed = speed * 2;
// float x = Body.localEulerAngles.x;
// float y = Body.localEulerAngles.y;
// float z = Body.localEulerAngles.z;
// z = CheckValue(z);
// z += speed;
// if (z >= 360)
// {
// z -= 360;
// }
// if (z <= -360)
// {
// z += 360;
// }
// Body.localEulerAngles = new Vector3(x, y, z);
// RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
// }
// }
//}
private void H(IMessage obj)
{
if (SelectedObjs.selectedObj == gameObject && ReplaySetting.PlayStatus != PlayStatus.isReplay)
{
var gameObjID = (long)obj.Sender;
if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
{
var speed = ((WeightCmdArgs)obj.Data).Weight;
speed = speed * 2;
float x = Body.localEulerAngles.x;
float y = Body.localEulerAngles.y;
float z = Body.localEulerAngles.z;
z = CheckValue(z);
z -= speed;
if (z >= 360)
{
z -= 360;
}
if (z <= -360)
{
z += 360;
}
Body.localEulerAngles = new Vector3(x, y, z);
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
}
}
}
//private void H(IMessage obj)
//{
// if (SelectedObjs.selectedObj == gameObject && ReplaySetting.PlayStatus != PlayStatus.isReplay)
// {
// var gameObjID = (long)obj.Sender;
// if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
// {
// var speed = ((WeightCmdArgs)obj.Data).Weight;
// speed = speed * 2;
// float x = Body.localEulerAngles.x;
// float y = Body.localEulerAngles.y;
// float z = Body.localEulerAngles.z;
// z = CheckValue(z);
// z -= speed;
// if (z >= 360)
// {
// z -= 360;
// }
// if (z <= -360)
// {
// z += 360;
// }
// Body.localEulerAngles = new Vector3(x, y, z);
// RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
// }
// }
//}
private void J(IMessage obj)
{
if (SelectedObjs.selectedObj == gameObject && ReplaySetting.PlayStatus != PlayStatus.isReplay)
{
var gameObjID = (long)obj.Sender;
if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
{
var speed = ((WeightCmdArgs)obj.Data).Weight;
speed = speed * 2;
float x = Pao.localEulerAngles.x;
float y = Pao.localEulerAngles.y;
float z = Pao.localEulerAngles.z;
x = CheckValue(x);
x -= speed;
x = Mathf.Clamp(x, 15, 90);
Pao.localEulerAngles = new Vector3(x, y, z);
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
}
}
}
//private void J(IMessage obj)
//{
// if (SelectedObjs.selectedObj == gameObject && ReplaySetting.PlayStatus != PlayStatus.isReplay)
// {
// var gameObjID = (long)obj.Sender;
// if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
// {
// var speed = ((WeightCmdArgs)obj.Data).Weight;
// speed = speed * 2;
// float x = Pao.localEulerAngles.x;
// float y = Pao.localEulerAngles.y;
// float z = Pao.localEulerAngles.z;
// x = CheckValue(x);
// x -= speed;
// x = Mathf.Clamp(x, 15, 90);
// Pao.localEulerAngles = new Vector3(x, y, z);
// RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
// }
// }
//}
private void U(IMessage obj)
{
if (SelectedObjs.selectedObj == gameObject && ReplaySetting.PlayStatus != PlayStatus.isReplay)
{
var gameObjID = (long)obj.Sender;
if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
{
var speed = ((WeightCmdArgs)obj.Data).Weight;
speed = speed * 2;
float x = Pao.localEulerAngles.x;
float y = Pao.localEulerAngles.y;
float z = Pao.localEulerAngles.z;
x = CheckValue(x);
x += speed;
x = Mathf.Clamp(x, 15, 90);
Pao.localEulerAngles = new Vector3(x, y, z);
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
}
}
}
//private void U(IMessage obj)
//{
// if (SelectedObjs.selectedObj == gameObject && ReplaySetting.PlayStatus != PlayStatus.isReplay)
// {
// var gameObjID = (long)obj.Sender;
// if (GetComponent<BaseGameObjInfo>().gameObjID == gameObjID)
// {
// var speed = ((WeightCmdArgs)obj.Data).Weight;
// speed = speed * 2;
// float x = Pao.localEulerAngles.x;
// float y = Pao.localEulerAngles.y;
// float z = Pao.localEulerAngles.z;
// x = CheckValue(x);
// x += speed;
// x = Mathf.Clamp(x, 15, 90);
// Pao.localEulerAngles = new Vector3(x, y, z);
// RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
// }
// }
//}
private void OnDestroy()
{
MessageDispatcher.RemoveListener("EQUALS_COMMAND", PressureUp);
MessageDispatcher.RemoveListener("MINUS_COMMAND", PressureDown);
MessageDispatcher.RemoveListener("U_COMMAND", U);
MessageDispatcher.RemoveListener("J_COMMAND", J);
MessageDispatcher.RemoveListener("H_COMMAND", H);
MessageDispatcher.RemoveListener("K_COMMAND", K);
MessageDispatcher.RemoveListener("ReplayFrame", ReplayFrameZDSP);
MessageDispatcher.RemoveListener("ReplayEvent", ReplayEventZDSP);
EntitiesManager.Instance.RemoveEntity(id, gameObject);
}
public override void ClickFunc()
{
base.ClickFunc();
if (!IsWartering)
ResourceLoadWindow.Instance.LoadTipWindow("开启喷水?", () =>
{
IsWartering = true;
particle.gameObject.SetActive(true);
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
}, null);
else
ResourceLoadWindow.Instance.LoadTipWindow("关闭喷水?", () =>
{
IsWartering = false;
particle.gameObject.SetActive(false);
RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
}, null);
}
/// <summary>
/// 换算原始角度值为显式值
/// </summary>
/// <param name="x">获取的原始角度值</param>
/// <returns></returns>
protected float CheckValue(float x)
{
if (x >= 180 && x <= 360)
{
x = x - 360;
}
return x;
//举例:假如获取到的localEulerAngles.x = 300,则在显示面板其显示的值为-60=300-360,用此显式值计算
}
//private void OnDestroy()
//{
// MessageDispatcher.RemoveListener("EQUALS_COMMAND", PressureUp);
// MessageDispatcher.RemoveListener("MINUS_COMMAND", PressureDown);
// MessageDispatcher.RemoveListener("U_COMMAND", U);
// MessageDispatcher.RemoveListener("J_COMMAND", J);
// MessageDispatcher.RemoveListener("H_COMMAND", H);
// MessageDispatcher.RemoveListener("K_COMMAND", K);
// MessageDispatcher.RemoveListener("ReplayFrame", ReplayFrameZDSP);
// MessageDispatcher.RemoveListener("ReplayEvent", ReplayEventZDSP);
// EntitiesManager.Instance.RemoveEntity(id, gameObject);
//}
//public override void ClickFunc()
//{
// base.ClickFunc();
// if (!IsWartering)
// ResourceLoadWindow.Instance.LoadTipWindow("开启喷水?", () =>
// {
// IsWartering = true;
// particle.gameObject.SetActive(true);
// RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
// }, null);
// else
// ResourceLoadWindow.Instance.LoadTipWindow("关闭喷水?", () =>
// {
// IsWartering = false;
// particle.gameObject.SetActive(false);
// RecordEvent.AddEventData(CloneObjType.None, RecordEventType.ZDSP, JsonUtility.ToJson(GetData()));
// }, null);
//}
///// <summary>
///// 换算原始角度值为显式值
///// </summary>
///// <param name="x">获取的原始角度值</param>
///// <returns></returns>
//protected float CheckValue(float x)
//{
// if (x >= 180 && x <= 360)
// {
// x = x - 360;
// }
// return x;
// //举例:假如获取到的localEulerAngles.x = 300,则在显示面板其显示的值为-60=300-360,用此显式值计算
//}
}

5
Assets/Scripts/InputSystem/InputManager/InputManager.cs

@ -100,7 +100,7 @@ public class InputManager : MonoBehaviour
{
gameObjID = SelectedObjs.selectedObj.GetComponent<BaseGameObjInfo>().GameObjID;
var cmdargs = new WeightCmdArgs();
cmdargs.Weight += Time.deltaTime *10f;
cmdargs.Weight += Time.deltaTime * 10f;
if (Input.GetButtonDown("LeftShift"))
{
LeftShift = true;
@ -163,7 +163,8 @@ public class InputManager : MonoBehaviour
}
}
if (SelectedObjs.selectedObj.GetComponent<ControlSprayHead>())
if (SelectedObjs.selectedObj.GetComponent<ControlSprayHead>()
|| SelectedObjs.selectedObj.GetComponent<FCGSPControl>())
{
if (Input.GetButton("U"))
{

4
Assets/Scripts/Tool/OnDragAlongWindCheck.cs

@ -9,6 +9,10 @@ public class OnDragAlongWindCheck : ObjDrag {
public override void ObjDragExitExecute(IMessage obj)
{
if (SelectedObjs.selectedObj!=gameObject)
{
return;
}
var data = (ObjDragCmdArgs)obj.Data;
prevPos = data.mousePosition;

BIN
Assets/Sky/Materials/azure[Sky].mat

Binary file not shown.

4
Assets/StreamingAssets/Data/DisasterInfos.xml

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DisasterInfoList>
<DisasterInfo>
<Id>7</Id>
<LastTime>2021/1/12 15:53:43</LastTime>
<Id>9</Id>
<LastTime>2021/1/18 14:04:36</LastTime>
<Name>1</Name>
</DisasterInfo>
</DisasterInfoList>

BIN
ProjectSettings/ProjectSettings.asset

Binary file not shown.

BIN
电子沙盘合成文档.docx

Binary file not shown.
Loading…
Cancel
Save