优化部分细节

master
lz 6 years ago
parent fb7886957e
commit 8a7179fc50

@ -30,13 +30,13 @@ namespace LzFramework
{
if(Input.GetKeyDown(KeyCode.J))
{
//SoundPlay("S_NiuQunPao", 0.50f,true,true);
AudioController.Instance.SoundPlay("S_XuLi", 1.0f, false, true);
SoundPlay("S_XuLi", 1.0f, false, true);
}
if(Input.GetKeyDown(KeyCode.P))
{
//SoundStop("S_NiuQunPao");
SoundStop("S_XuLi",false);
}
}

@ -59,12 +59,27 @@ namespace DisComputer
/// <param name="action"></param>
public static void WaitTimeAfterDo(MonoBehaviour mono,float delay,System.Action action)
{
mono.StartCoroutine(StartWait(delay, action));
if (!_WaitDic.ContainsKey(delay.ToString()))
{
_WaitDic.Add(delay.ToString(), delay);
mono.StartCoroutine(StartWait(delay, action));
}
else
{
}
}
private static Dictionary<string, float> _WaitDic = new Dictionary<string, float>();
static IEnumerator StartWait(float delay,Action action)
{
yield return new WaitForSeconds(delay);
if(_WaitDic.ContainsKey(delay.ToString()))
{
_WaitDic.Remove(delay.ToString());
}
action?.Invoke();
}

@ -22,11 +22,6 @@ namespace DisComputer
}
// Update is called once per frame
void Update()
{
}
}

@ -27,14 +27,7 @@ namespace DisComputer
}
private void OnGUI()
{
/*GUIStyle gUIStyle = new GUIStyle();
gUIStyle.fontSize = 20;
gUIStyle.normal.textColor = Color.green;
GUI.Label(new Rect(50, 0, 300, 50), recieveStr, gUIStyle);*/
}
void OnRecStart()
{
@ -60,13 +53,11 @@ namespace DisComputer
{
try{
Debug.LogFormat("recieve wed data string {0}",data);
recieveStr = data;
}
catch(Exception e)
{
Debug.Log("data is not correct"+e);
Debug.Log("data is not correct"+e);
}
}

@ -28,40 +28,51 @@ namespace DisComputer
{
SetUnLoadMode(0);
});
}
private void Update()
{
if (Input.GetKey(KeyCode.U)&& Input.GetKeyDown(KeyCode.Alpha1))
{
SetUnLoadMode(6);
SetUnLoadMode(7);
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha2))
{
SetUnLoadMode(5);
SetUnLoadMode(6);
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha3))
{
SetUnLoadMode(4);
SetUnLoadMode(5);
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha4))
{
SetUnLoadMode(3);
SetUnLoadMode(4);
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha5))
{
SetUnLoadMode(2);
SetUnLoadMode(3);
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha6))
{
SetUnLoadMode(1);
SetUnLoadMode(2);
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha7))
{
SetUnLoadMode(1);
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha8))
{
SetUnLoadMode(0);
}
if (Input.GetKey(KeyCode.R)&&Input.GetKeyDown(KeyCode.Alpha1))
{
SetLoadMode(0);
@ -90,9 +101,40 @@ namespace DisComputer
{
SetLoadMode(6);
}
if (Input.GetKey(KeyCode.R) && Input.GetKeyDown(KeyCode.Alpha8))
{
SetLoadMode(7);
}
}
/// <summary>
/// 设置延时安装
/// </summary>
/// <param name="delay"></param>
/// <param name="index"></param>
public void DelaySetLoad(float delay,int index)
{
CommonTool.WaitTimeAfterDo(this, delay, () =>
{
SetLoadMode(index);
});
}
/// <summary>
/// 设置延时拆卸
/// </summary>
/// <param name="delay"></param>
/// <param name="index"></param>
public void DelaySetUnLoad(float delay, int index)
{
CommonTool.WaitTimeAfterDo(this, delay, () =>
{
SetUnLoadMode(index);
});
}
/// <summary>
/// 改变状态
/// </summary>

@ -15,7 +15,6 @@ namespace DisComputer
{
public LayerMask clickableLayer;
//模糊后背景
public SpriteRenderer vagueMask_spr;
// Start is called before the first frame update
@ -29,14 +28,12 @@ namespace DisComputer
void Update()
{
if (MouseControl.Instance.isFocuseState)
return;
MouseThroughCamera();
RotationTarget();
}
/// <summary>
@ -141,8 +138,6 @@ namespace DisComputer
}
//旋转速度
public float rotationSpeed;
//桌面旋转平台
@ -174,7 +169,6 @@ namespace DisComputer
}
}
/// <summary>
/// 移动到中间位置
/// </summary>

@ -50,6 +50,12 @@ namespace DisComputer
MessageContainer.SendMessage("quit", this, MsgName.ModelControlShowDesktop);
MessageContainer.SendMessage("",this,MsgName.MainViewClearBar);
MainControl.Instance.DelaySetLoad(0.3f,0);
}
else//安装完成
{
@ -63,6 +69,8 @@ namespace DisComputer
MessageContainer.SendMessage("quit", this, MsgName.ModelControlShowDesktop);
MessageContainer.SendMessage("", this, MsgName.MainViewClearBar);
MessageContainer.SendMessage("",this,MsgName.SparePartsViewRemoveSpare);
MainControl.Instance.DelaySetUnLoad(0.3f,0);
}
}

@ -1 +1 @@
Build from DESKTOP-Q4UN19A at 2020/6/19 13:49:22
Build from DESKTOP-Q4UN19A at 2020/6/23 15:06:31

@ -310,7 +310,7 @@ PlayerSettings:
openGLRequireES31: 0
openGLRequireES31AEP: 0
m_TemplateCustomTags:
MYTAG: "\u8BA1\u7B97\u673A\u7EC4\u88C5"
MYTAG: "\u8BA1\u7B97\u673A\u865A\u62DF\u7EC4\u88C5"
mobileMTRendering:
Android: 1
iPhone: 1

@ -1 +1 @@
Build from DESKTOP-Q4UN19A at 2020/6/12 16:21:32
Build from DESKTOP-Q4UN19A at 2020/6/23 15:06:31

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>计算机组装</title>
<title>计算机虚拟组装</title>
<link rel="shortcut icon" href="TemplateData/img/favicon.ico">
<link rel="stylesheet" href="TemplateData/css/style.css">
<script src="Build/UnityLoader.js"></script>
@ -106,7 +106,7 @@
<div id="loadingBlock">
<img class="logo" src="TemplateData/img/Logo.png"></img>
<span class="subtitle"> <br>
一个互联网技术教育实训网站,提供工程实训,以实现工程化专业教学的自动化和智能化。
一个互联网技术教育实训网站,提供工程实训,以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动,将传统的知识传授和时兴的工程实战一体化。.
</span>
<div id="progressBar">
@ -138,7 +138,7 @@
<div id="errorBrowserBlock" style="display:none;">
<img class="logo" src="TemplateData/img/Logo.png"></img>
<span class="subtitle"><br>
一个互联网技术教育实训网站,提供工程实训,以实现工程化专业教学的自动化和智能化。
一个互联网技术教育实训网站,提供工程实训,以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动,将传统的知识传授和时兴的工程实战一体化。
</span>
<div id="errorContent">

Loading…
Cancel
Save