优化了部分拆卸细节

master
lz 6 years ago
parent 17922cf44f
commit 34d9ab39f2

@ -31,7 +31,7 @@ TextureImporter:
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
filterMode: 2
aniso: -1
mipBias: -100
wrapU: 1
@ -63,7 +63,7 @@ TextureImporter:
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 1
allowsAlphaSplitting: 0
@ -74,7 +74,7 @@ TextureImporter:
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 1
allowsAlphaSplitting: 0
@ -85,7 +85,7 @@ TextureImporter:
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
textureCompression: 2
compressionQuality: 50
crunchedCompression: 1
allowsAlphaSplitting: 0

@ -2170,6 +2170,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
loadCircle_tex: {fileID: 2800000, guid: f904827dc13387a49989875f02dc6306, type: 3}
loadCircleColor: {r: 0.21176471, g: 1, b: 1, a: 1}
isFocuseState: 0
checkLayer:
serializedVersion: 2
m_Bits: 2048
@ -2415,6 +2416,11 @@ PrefabInstance:
propertyPath: m_Intensity
value: 0.75
objectReference: {fileID: 0}
- target: {fileID: 6606880447022763252, guid: 52ca5a5baa433cd40910e0d0387d9747,
type: 3}
propertyPath: m_Shadows.m_Type
value: 2
objectReference: {fileID: 0}
- target: {fileID: 6606880447022763258, guid: 52ca5a5baa433cd40910e0d0387d9747,
type: 3}
propertyPath: m_Name
@ -4027,7 +4033,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1439217237}
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
m_LocalPosition: {x: 1.01, y: 0.992, z: 3.39}
m_LocalPosition: {x: 1.01, y: 0.992, z: 3.73}
m_LocalScale: {x: 0.7943988, y: 0.80587626, z: 0.5769369}
m_Children: []
m_Father: {fileID: 1389421586}
@ -7194,6 +7200,10 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 642120115}
m_Modifications:
- target: {fileID: 854766052, guid: 45c39313f9bcd2c448d40b377eea5e7a, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9163144242518054417, guid: 45c39313f9bcd2c448d40b377eea5e7a,
type: 3}
propertyPath: m_LocalPosition.x

@ -0,0 +1,59 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using System;
namespace DisComputer
{
/*
* @func
*
* */
public class BoltDriver : MonoBehaviour
{
//螺丝位置点
public List<Transform> lousiTrans;
public Transform driver;
private void Start()
{
driver.gameObject.SetActive(false);
}
public IEnumerator RotationLouSi()
{
driver.gameObject.SetActive(true);
Tween driverT = driver.DOLocalRotate(new Vector3(360, 0, 0), 2.0f, RotateMode.FastBeyond360).SetLoops(-1).SetEase(Ease.Linear);
driverT.Pause();
Sequence sequence = DOTween.Sequence();
bool isFinish = true;
sequence.Append(
driver.DOLocalMove(lousiTrans[0].localPosition, 0.55f).SetEase(Ease.Linear).
OnComplete(() => {
driverT.Play();
})).Append(
driver.DOLocalMoveX(driver.localPosition.x + .3f, 0.5f).SetEase(Ease.Linear).SetDelay(1.0f)
)
.Append(
driver.DOLocalMove(lousiTrans[1].localPosition, 0.5f).SetEase(Ease.Linear)
).Append(
driver.DOLocalMoveX(driver.localPosition.x + 0.3f, 0.5f).SetEase(Ease.Linear).SetDelay(1.0f)
).OnComplete(()=>
{
driverT.Pause();
driver.gameObject.SetActive(false);
isFinish = false;
});
while (isFinish)
{
yield return new WaitForEndOfFrame();
}
}
}
}

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fed4784425efa3240a01dbc3badc16bf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -24,12 +24,58 @@ namespace DisComputer
public Vector3 closeEuler;
public GameObject lock01Go;
// Start is called before the first frame update
void Start()
{
isHit01 = false;
}
private void Update()
{
if (isHit01)
{
if (Input.GetMouseButtonDown(0))
{
if (hit.collider)
{
hit.collider.gameObject.SetActive(false);
buckleGo.transform.DOLocalRotate(openEuler, 0.35f).SetEase(Ease.Linear);
isHit01 = false;
onclick--;
}
}
}
}
public override void SetLoadState()
{
unloadTipGo.SetActive(false);
buckleGo.SetActive(true);
mainGo.SetActive(true);
buckleGo.transform.localEulerAngles = closeEuler;
mainGo.transform.localPosition = mainInitPos;
}
public override void SetUnloadState()
{
unloadTipGo.SetActive(false);
buckleGo.SetActive(false);
mainGo.SetActive(false);
buckleGo.transform.localEulerAngles = openEuler;
mainGo.transform.localPosition = mainShowPos;
}
public override bool IsCompareTag(object data)
{
@ -84,12 +130,53 @@ namespace DisComputer
StartCoroutine(Focuse());
}
//扣锁检测层
public LayerMask checkLayer;
private RaycastHit hit;
private bool isHit01 = false;
private int onclick = 1;
IEnumerator Focuse()
{
yield return StartCoroutine(ProgressFocuse());
unloadTipGo.SetActive(true);
yield return new WaitForSeconds(1.0f);
buckleGo.transform.DOLocalRotate(openEuler, 0.45f).SetEase(Ease.Linear).OnComplete(() =>
lock01Go.SetActive(true);
isHit01 = false;
onclick = 1;
while(true)
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit, 50, checkLayer.value))
{
if (hit.collider.gameObject.name.Contains("lock01"))
{
isHit01 = true;
//Debug.LogFormat(">>>>>>>>>>>> hit go {0}", hit.collider.gameObject.tag);
}
}
if (onclick == 0)
{
break;
}
yield return new WaitForEndOfFrame();
}
yield return new WaitForSeconds(0.50f);
unloadTipGo.SetActive(false);
mainGo.transform.DOLocalMove(mainShowPos, 0.5f).SetDelay(0.5f).SetEase(Ease.Linear).OnComplete(() => {
CommonTool.WaitTimeAfterDo(this, .350f, () =>
{
OnUnLoadFinishHandle?.Invoke();
mainGo.SetActive(false);
RewindCameraView();
});
});
/*buckleGo.transform.DOLocalRotate(openEuler, 0.45f).SetEase(Ease.Linear).OnComplete(() =>
{
unloadTipGo.SetActive(false);
mainGo.transform.DOLocalMove(mainShowPos, 0.5f).SetDelay(0.5f).SetEase(Ease.Linear).OnComplete(() => {
@ -101,7 +188,7 @@ namespace DisComputer
RewindCameraView();
});
});
});
});*/
}

@ -24,6 +24,19 @@ namespace DisComputer
}
public override void SetLoadState()
{
dianYuanGo.transform.localPosition = initPos;
dianYuanGo.SetActive(true);
}
public override void SetUnloadState()
{
dianYuanGo.transform.localPosition = showPos;
dianYuanGo.SetActive(false);
}
public override bool IsCompareTag(object data)
{

@ -42,6 +42,28 @@ namespace DisComputer
}
public override void SetLoadState()
{
mainGo.SetActive(true);
buckleGo.SetActive(true);
mainGo.transform.localPosition = mainInitPos;
buckleGo.transform.localEulerAngles = closeEuler;
buckleGo.transform.localPosition = buckleInitPos;
}
public override void SetUnloadState()
{
mainGo.SetActive(false);
buckleGo.SetActive(false);
mainGo.transform.localPosition = mainShowPos;
buckleGo.transform.localEulerAngles = openEuler;
buckleGo.transform.localPosition = buckleShowPos;
}
public override bool IsCompareTag(object data)
{
@ -75,9 +97,6 @@ namespace DisComputer
}
public override void OnLoadAct()
{
base.OnLoadAct();

@ -40,12 +40,75 @@ namespace DisComputer
public Vector3 closeBuck02Euler;
public GameObject lock01Go;
public GameObject lock02Go;
// Start is called before the first frame update
void Start()
{
isHit01 = false;
isHit02 = false;
}
private void Update()
{
if (isHit01)
{
if (Input.GetMouseButtonDown(0))
{
if(hit.collider)
{
hit.collider.gameObject.SetActive(false);
buckle01Go.transform.DOLocalRotate(openEuler, 0.35f).SetEase(Ease.Linear);
isHit01 = false;
onclick--;
}
}
}
if (isHit02) {
if (Input.GetMouseButtonDown(0))
{
if (hit.collider)
{
hit.collider.gameObject.SetActive(false);
buckle02Go.transform.DOLocalRotate(openBuck02Euler, 0.35f).SetEase(Ease.Linear);
onclick--;
isHit02 = false;
}
}
}
}
public override void SetUnloadState()
{
tipActGo.SetActive(false);
mainGo.SetActive(false);
buckle01Go.transform.localEulerAngles = openEuler;
buckle02Go.transform.localEulerAngles = openBuck02Euler;
mainGo.transform.localPosition = mainShowPos;
}
public override void SetLoadState()
{
tipActGo.SetActive(false);
mainGo.SetActive(true);
buckle01Go.transform.localEulerAngles = closeEuler;
buckle02Go.transform.localEulerAngles = closeBuck02Euler;
mainGo.transform.localPosition = mainInitPos;
}
public override bool IsCompareTag(object data)
{
@ -102,16 +165,66 @@ namespace DisComputer
{
base.OnUnLoadAct();
StartCoroutine(Focuse());
}
//零件检测层
public LayerMask checkLayer;
private RaycastHit hit;
private bool isHit01 = false;
private bool isHit02 = false;
private int onclick = 2;
IEnumerator Focuse()
{
yield return StartCoroutine(ProgressFocuse());
tipActGo.SetActive(true);
yield return new WaitForSeconds(1.0f);
buckle01Go.transform.DOLocalRotate(openEuler, 0.35f).SetEase(Ease.Linear).SetDelay(0.3f).OnComplete(() =>
lock01Go.SetActive(true);
lock02Go.SetActive(true);
onclick = 2;
isHit01 = false;
isHit02 = false;
while (true)
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit, 50, checkLayer.value))
{
if (hit.collider.gameObject.name.Contains("lock01"))
{
isHit01 = true;
//Debug.LogFormat(">>>>>>>>>>>> hit go {0}", hit.collider.gameObject.tag);
}
if (hit.collider.gameObject.name.Contains("lock02"))
{
//Debug.LogFormat(">>>>>>>>>>>> hit go {0}", hit.collider.gameObject.tag);
isHit02 = true;
}
}
if (onclick == 0)
{
break;
}
yield return new WaitForEndOfFrame();
}
yield return new WaitForSeconds(0.50f);
tipActGo.SetActive(false);
mainGo.transform.DOLocalMove(mainShowPos, 0.35f).SetEase(Ease.Linear).OnComplete(() => {
CommonTool.WaitTimeAfterDo(this, .35f, () => {
OnUnLoadFinishHandle?.Invoke();
mainGo.SetActive(false);
RewindCameraView();
});
});
/* buckle01Go.transform.DOLocalRotate(openEuler, 0.35f).SetEase(Ease.Linear).SetDelay(0.3f).OnComplete(() =>
{
tipActGo.SetActive(false);
mainGo.transform.DOLocalMove(mainShowPos, 0.35f).SetEase(Ease.Linear).OnComplete(() => {
@ -128,7 +241,7 @@ namespace DisComputer
buckle02Go.transform.DOLocalRotate(openBuck02Euler, 0.35f).SetEase(Ease.Linear).OnComplete(() =>
{
});
});*/
}

@ -25,6 +25,18 @@ namespace DisComputer
}
public override void SetLoadState()
{
showGo.SetActive(true);
showGo.transform.localPosition = initPos;
}
public override void SetUnloadState()
{
showGo.transform.localPosition = showPos;
showGo.SetActive(false);
}
public override bool IsCompareTag(object data)
{

@ -54,6 +54,24 @@ namespace DisComputer
}
/// <summary>
/// 设置成拆卸状态
/// </summary>
public virtual void SetUnloadState()
{
}
/// <summary>
/// 设置成安装状态
/// </summary>
public virtual void SetLoadState()
{
}
float interval = 0.3f;
public void CoolPointTip(string tip)
{
@ -86,6 +104,7 @@ namespace DisComputer
protected IEnumerator ProgressFocuse()
{
yield return new WaitForEndOfFrame();
MouseControl.Instance.isFocuseState = true;
//关闭零件包栏
LzFramework.UI.TTUIPage.ClosePage<SparePartsView>();
//隐藏提示指引
@ -104,6 +123,7 @@ namespace DisComputer
protected void RewindCameraView()
{
Camera.main.DOFieldOfView(55, 0.5f).SetEase(Ease.Linear);
MouseControl.Instance.isFocuseState = false;
}

@ -136,7 +136,7 @@ namespace DisComputer
/// <param name="_type"></param>
public void ActiveRegistType(SpareType _type)
{
Debug.LogFormat(">>>>>>>>>> 注册当前零件类型成功 {0}",_type);
//Debug.LogFormat(">>>>>>>>>> 注册当前零件类型成功 {0}",_type);
triggerGo.SetActive(true);
if(GameConfig.state == GameState.Load)
{

@ -30,12 +30,54 @@ namespace DisComputer
public Vector3 openEuler;
public Vector3 closeEuler;
public GameObject lock01Go;
// Start is called before the first frame update
void Start()
{
isHit01 = false;
}
private void Update()
{
if (isHit01)
{
if (Input.GetMouseButtonDown(0))
{
if (hit.collider)
{
hit.collider.gameObject.SetActive(false);
buckleGo.transform.DOLocalRotate(openEuler, 0.35f).SetEase(Ease.Linear);
isHit01 = false;
onclick--;
}
}
}
}
public override void SetLoadState()
{
mainGo.SetActive(true);
buckleGo.SetActive(true);
unloadTipGo.SetActive(false);
mainGo.transform.localPosition = mainInitPos;
buckleGo.transform.localEulerAngles = closeEuler;
}
public override void SetUnloadState()
{
mainGo.SetActive(false);
buckleGo.SetActive(true);
unloadTipGo.SetActive(false);
mainGo.transform.localPosition = mainShowPos;
buckleGo.transform.localEulerAngles = openEuler;
}
public override bool IsCompareTag(object data)
{
@ -92,12 +134,51 @@ namespace DisComputer
}
//扣锁检测层
public LayerMask checkLayer;
private RaycastHit hit;
private bool isHit01 = false;
private int onclick = 1;
IEnumerator Focuse()
{
yield return StartCoroutine(ProgressFocuse());
unloadTipGo.SetActive(true);
yield return new WaitForSeconds(1.0f);
buckleGo.transform.DOLocalRotate(openEuler, 0.5f).SetEase(Ease.Linear).OnComplete(() =>
lock01Go.SetActive(true);
isHit01 = false;
while (true)
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit, 50, checkLayer.value))
{
if (hit.collider.gameObject.name.Contains("lock01"))
{
isHit01 = true;
}
}
if (onclick == 0)
{
break;
}
yield return new WaitForEndOfFrame();
}
yield return new WaitForSeconds(0.5f);
unloadTipGo.SetActive(false);
mainGo.transform.DOLocalMove(mainShowPos, 0.5f).SetDelay(0.45f).SetEase(Ease.OutQuart).OnComplete(() => {
CommonTool.WaitTimeAfterDo(this, 0.350f, () =>
{
OnUnLoadFinishHandle?.Invoke();
mainGo.SetActive(false);
RewindCameraView();
});
});
/*buckleGo.transform.DOLocalRotate(openEuler, 0.5f).SetEase(Ease.Linear).OnComplete(() =>
{
unloadTipGo.SetActive(false);
mainGo.transform.DOLocalMove(mainShowPos, 0.5f).SetDelay(0.45f).SetEase(Ease.OutQuart).OnComplete(() => {
@ -108,7 +189,7 @@ namespace DisComputer
RewindCameraView();
});
});
});
});*/
}

@ -32,6 +32,21 @@ namespace DisComputer
}
public override void SetLoadState()
{
yingPanGo.SetActive(true);
luosiTran.gameObject.SetActive(true);
yingPanGo.transform.localPosition = pointConfigs[0].point;
luosiTran.localPosition = Vector3.zero;
}
public override void SetUnloadState()
{
yingPanGo.SetActive(false);
luosiTran.gameObject.SetActive(false);
yingPanGo.transform.localPosition = pointConfigs[2].point;
luosiTran.localPosition = showDis;
}
public override bool IsCompareTag(object data)
{
@ -98,7 +113,11 @@ namespace DisComputer
IEnumerator Focuse()
{
yield return StartCoroutine(ProgressFocuse());
BoltDriver driver = luosiTran.GetComponent<BoltDriver>();
luosiTran.gameObject.SetActive(true);
yield return StartCoroutine(driver.RotationLouSi()) ;
luosiTran.DOLocalMove(showDis, 0.35f).SetEase(Ease.Linear).OnComplete(() => {
Sequence sequence = DOTween.Sequence();
sequence.Append(yingPanGo.transform.DOLocalMove(pointConfigs[0].point, 0.4f).SetEase(Ease.Linear)).SetDelay(0.3f)

@ -35,6 +35,25 @@ namespace DisComputer
}
public override void SetUnloadState()
{
zhubanGo.SetActive(false);
luosiTran.gameObject.SetActive(false);
zhubanGo.transform.localPosition = showPos;
luosiTran.localPosition = showDis;
}
public override void SetLoadState()
{
zhubanGo.SetActive(true);
luosiTran.gameObject.SetActive(true);
zhubanGo.transform.localPosition = initPos;
luosiTran.localPosition = Vector3.zero;
}
public override bool IsCompareTag(object data)
{

@ -29,10 +29,10 @@ namespace DisComputer
private void OnGUI()
{
GUIStyle gUIStyle = new GUIStyle();
/*GUIStyle gUIStyle = new GUIStyle();
gUIStyle.fontSize = 20;
gUIStyle.normal.textColor = Color.green;
GUI.Label(new Rect(50, 0, 300, 50), recieveStr, gUIStyle);
GUI.Label(new Rect(50, 0, 300, 50), recieveStr, gUIStyle);*/
}
void OnRecStart()

@ -40,13 +40,13 @@ namespace DisComputer
private void Idle_Enter()
{
Debug.LogFormat("进入待机状态");
//Debug.LogFormat("进入待机状态");
TTUIPage.ShowPage<MainMenuView>();
TTUIPage.ShowPage<TipView>();
TTUIPage.ShowPage<IdleView>();
WebConnecter.Singleton.SendDataToWeb("装机程序进入待机状态");
//WebConnecter.Singleton.SendDataToWeb("装机程序进入待机状态");
}
private void Idle_Update()
@ -56,7 +56,7 @@ namespace DisComputer
private void Idle_Exit()
{
Debug.LogFormat("退出待机 ");
//Debug.LogFormat("退出待机 ");
TTUIPage.ClosePage<IdleView>();
}
@ -65,8 +65,8 @@ namespace DisComputer
private IEnumerator Active_Enter()
{
yield return new WaitForEndOfFrame();
Debug.LogFormat("游戏状态");
WebConnecter.Singleton.SendDataToWeb("装机程序进入组装状态");
//Debug.LogFormat("游戏状态");
//WebConnecter.Singleton.SendDataToWeb("装机程序进入组装状态");
}
@ -78,18 +78,18 @@ namespace DisComputer
private void Active_Exit()
{
Debug.LogFormat("退出游戏状态");
//Debug.LogFormat("退出游戏状态");
}
private void End_Enter()
{
Debug.LogFormat("进入游戏结束状态");
//Debug.LogFormat("进入游戏结束状态");
}
private void End_Exit()
{
Debug.LogFormat("退出游戏结束状态");
//Debug.LogFormat("退出游戏结束状态");
}
#endregion

@ -40,7 +40,7 @@ namespace DisComputer
/// </summary>
public void RewindTargetRoatation()
{
dragTarget.transform.DORotate(new Vector3(0, 300, 0), 0.5f);
curRotPlatform.transform.DORotate(new Vector3(0, 0, 0), 0.5f);
}
@ -186,7 +186,8 @@ namespace DisComputer
isFree = true;
target.SetParent(showPlatform,true);
curRotPlatform = showPlatform;
destopPlatform.localEulerAngles = Vector3.zero;
});
target.DORotate(new Vector3(0, 300, 0), 0.5f);
}
@ -207,6 +208,7 @@ namespace DisComputer
isFree = false;
target.SetParent(destopPlatform, true);
curRotPlatform = destopPlatform;
showPlatform.localEulerAngles = Vector3.zero;
});
target.DORotate(new Vector3(0, 30, 0), 0.5f);

@ -25,6 +25,10 @@ namespace DisComputer
private bool isDelTemp = false;
[HideInInspector]
//是否进入聚焦状态
public bool isFocuseState = false;
// Update is called once per frame
void Update()
@ -33,6 +37,9 @@ namespace DisComputer
if (MainControl.Instance.mainState != MainState.Active)
return;
if (isFocuseState)
return;
//缩放摄像机视距
RollCameraView();

@ -3,6 +3,8 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LzFramework;
using EduCoderTool;
using Newtonsoft.Json;
namespace DisComputer
{
@ -14,22 +16,7 @@ namespace DisComputer
public class PcControl : Singleton<PcControl>
{
public SpareItemControl zhubanControl;
public SpareItemControl yingPanControl;
public SpareItemControl dianYuanControl;
public SpareItemControl guangQuControl;
public SpareItemControl xianKaControl;
public SpareItemControl cpuControl;
public SpareItemControl neiCunTiaoControl;
public SpareItemControl jiXiangControl;
public List<SpareAnimationInfo> spareAnimationInfos;
private int curSpIndex = 0;
@ -44,115 +31,96 @@ namespace DisComputer
private void Update()
{
if ( Input.GetKey(KeyCode.U) &&Input.GetKeyDown(KeyCode.Alpha1))
{
jiXiangControl.spareAnimation.OnUnLoadAct();
}
if (Input.GetKey(KeyCode.R) && Input.GetKeyDown(KeyCode.Alpha1))
{
jiXiangControl.spareAnimation.OnLoadAct();
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha2))
{
neiCunTiaoControl.spareAnimation.OnUnLoadAct();
}
if (Input.GetKey(KeyCode.R) && Input.GetKeyDown(KeyCode.Alpha2))
if (Input.GetKeyDown(KeyCode.U))
{
neiCunTiaoControl.spareAnimation.OnLoadAct();
SetUnloadState(7);
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha3))
if (Input.GetKeyDown(KeyCode.B))
{
yingPanControl.spareAnimation.OnUnLoadAct();
}
if (Input.GetKey(KeyCode.R) && Input.GetKeyDown(KeyCode.Alpha3))
{
yingPanControl.spareAnimation.OnLoadAct();
SetLoadState(7);
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha4))
//重置安装模式
if (Input.GetKeyDown(KeyCode.Space))
{
xianKaControl.spareAnimation.OnUnLoadAct();
if(GameConfig.state == GameState.Load)
{
GameConfig.state = GameState.Unload;
}
else
{
GameConfig.state = GameState.Load;
}
Debug.LogFormat(">>>>>>>>>> cur SP index {0}", curSpIndex);
curSpIndex--;
ReadyLoadNextStep(0);
}
if (Input.GetKey(KeyCode.R) && Input.GetKeyDown(KeyCode.Alpha4))
{
xianKaControl.spareAnimation.OnLoadAct();
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha5))
{
cpuControl.spareAnimation.OnUnLoadAct();
}
if (Input.GetKey(KeyCode.R) && Input.GetKeyDown(KeyCode.Alpha5))
{
cpuControl.spareAnimation.OnLoadAct();
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha6))
{
dianYuanControl.spareAnimation.OnUnLoadAct();
}
if (Input.GetKey(KeyCode.R) && Input.GetKeyDown(KeyCode.Alpha6))
{
dianYuanControl.spareAnimation.OnLoadAct();
}
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha7))
{
guangQuControl.spareAnimation.OnUnLoadAct();
}
if (Input.GetKey(KeyCode.R) && Input.GetKeyDown(KeyCode.Alpha7))
{
guangQuControl.spareAnimation.OnLoadAct();
}
if (Input.GetKey(KeyCode.U) && Input.GetKeyDown(KeyCode.Alpha8))
/// <summary>
/// 设置拆机步数
/// </summary>
/// <param name="step"></param>
public void SetUnloadState(int step)
{
for(int i = 0; i < spareAnimationInfos.Count; i++)
{
zhubanControl.spareAnimation.OnUnLoadAct();
if (i < step)
{
Debug.LogFormat("*** Set UnloadMode 隐藏 {0} ", spareAnimationInfos[i].type);
spareAnimationInfos[i].control.spareAnimation.SetUnloadState();
}else
{
Debug.LogFormat("*** Set UnloadMode 显示 {0} ", spareAnimationInfos[i].type);
spareAnimationInfos[i].control.spareAnimation.SetLoadState();
}
}
if (Input.GetKey(KeyCode.R) && Input.GetKeyDown(KeyCode.Alpha8))
{
zhubanControl.spareAnimation.OnLoadAct();
}
//重置安装模式
if (Input.GetKeyDown(KeyCode.Space))
curSpIndex = step;
SetNextSpareType();
}
/// <summary>
/// 设置装机步数
/// </summary>
/// <param name="step"></param>
public void SetLoadState(int step)
{
for (int i = 0; i < spareAnimationInfos.Count; i++)
{
if(GameConfig.state == GameState.Load)
if(i < step)
{
GameConfig.state = GameState.Unload;
Debug.LogFormat("*** Set loadMode 显示 {0} ", spareAnimationInfos[i].type);
spareAnimationInfos[i].control.spareAnimation.SetLoadState();
}
else
{
GameConfig.state = GameState.Load;
Debug.LogFormat("*** Set loadMode 隐藏 {0} ", spareAnimationInfos[i].type);
spareAnimationInfos[i].control.spareAnimation.SetUnloadState();
}
Debug.LogFormat(">>>>>>>>>> cur SP index {0}", curSpIndex);
curSpIndex--;
ReadyLoadNextStep(0);
}
curSpIndex = 8 - step;
SetNextSpareType();
}
/// <summary>
/// 注册零件控制事件
/// </summary>
@ -192,7 +160,7 @@ namespace DisComputer
curSpIndex++;
}
Debug.LogFormat(" *** cur index {0}",curSpIndex);
//Debug.LogFormat(" *** cur index {0}",curSpIndex);
if (curSpIndex > 8)//拆装成功
{
Debug.LogFormat("拆卸成功!!!");
@ -218,10 +186,10 @@ namespace DisComputer
{
isReadyed = true;
curSpIndex--;
Debug.LogFormat(" ----- cur index {0}", curSpIndex);
//Debug.LogFormat(" ----- cur index {0}", curSpIndex);
}
Debug.LogFormat(" *** cur index {0}", curSpIndex);
//Debug.LogFormat(" *** cur index {0}", curSpIndex);
if (curSpIndex <= 0) {//全部安装成功
curSpIndex = 1;
StartCoroutine(FinishLoadMode());
@ -255,6 +223,12 @@ namespace DisComputer
IEnumerator FinishUnLoadMode()
{
yield return new WaitForSeconds(2.50f);
WebData webData = new WebData();
webData.Data = "";
webData.GameState = "Success";
string json = JsonConvert.SerializeObject(webData);
WebConnecter.Singleton.SendDataToWeb(json);
string tipStr = string.Format("恭喜你顺利通过<color=red>拆卸课程</color>,接下来进入组装课程!加油!!");
MessageContainer.SendMessage("",this,MsgName.MainViewQuitFocuseMode);
yield return new WaitForSeconds(0.5f);
@ -272,6 +246,14 @@ namespace DisComputer
yield return new WaitForSeconds(2.50f);
string tipStr = string.Format("恭喜你顺利通过<color=red>安装课程</color>,并掌握了计算机拆装!!");
MessageContainer.SendMessage("", this, MsgName.MainViewQuitFocuseMode);
WebData webData = new WebData();
webData.Data = "";
webData.GameState = "Success";
string json = JsonConvert.SerializeObject(webData);
WebConnecter.Singleton.SendDataToWeb(json);
yield return new WaitForSeconds(0.50f);
LzFramework.UI.TTUIPage.ShowPage<EndView>(tipStr);
}
@ -285,7 +267,7 @@ namespace DisComputer
/// </summary>
void UnloadFinish()
{
Debug.LogFormat("当前{0}拆除成功",curSpType.ToString());
// Debug.LogFormat("当前{0}拆除成功",curSpType.ToString());
isReadyed = false;
MessageContainer.SendMessage("quit", this, MsgName.TipViewShowOperation);
HideTipSpare();
@ -300,7 +282,7 @@ namespace DisComputer
void LoadFinish()
{
isReadyed = false;
Debug.LogFormat("当前{0}安装成功", curSpType.ToString());
//Debug.LogFormat("当前{0}安装成功", curSpType.ToString());
HideTipSpare();
string spareName = CommonTool.GetSpareName(curSpType);
string tip = string.Format("恭喜你完成了<color=red>{0}</color>的安装", spareName);
@ -349,37 +331,16 @@ namespace DisComputer
/// <param name="type"></param>
void SetSpareControl(SpareType type)
{
switch (type)
for(int i = 0; i < spareAnimationInfos.Count; i++)
{
case SpareType.Cpu:
curSpControl = cpuControl;
break;
case SpareType.DianYuan:
curSpControl = dianYuanControl;
break;
case SpareType.GuangQu:
curSpControl = guangQuControl;
break;
case SpareType.JiXiang:
curSpControl = jiXiangControl;
break;
case SpareType.NeiCun:
curSpControl = neiCunTiaoControl;
break;
case SpareType.Null:
break;
case SpareType.XianKa:
curSpControl = xianKaControl;
break;
case SpareType.YingPan:
curSpControl = yingPanControl;
break;
case SpareType.ZhuBan:
curSpControl = zhubanControl;
break;
if(spareAnimationInfos[i].type == type)
{
curSpControl = spareAnimationInfos[i].control;
}
}
curSpControl.ActiveRegistType(type);
@ -389,5 +350,12 @@ namespace DisComputer
}
[Serializable]
public class SpareAnimationInfo
{
public SpareType type;
public SpareItemControl control;
}
}

@ -0,0 +1,13 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// web端通讯地址
/// </summary>
public class WebData
{
public string GameState;
public string Data;
}

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5230de7177cd26846904b0ee3596fc35
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -148,8 +148,6 @@ namespace DisComputer
#region **************** onclick *****************
/// <summary>
/// 点击选择
/// </summary>

@ -76,13 +76,13 @@ namespace DisComputer
/// </summary>
public void AddSpareToGrid(SpareType _type)
{
Debug.LogFormat(">>>>>>>>>>>>> Add Fly Spare Type {0}", _type);
// Debug.LogFormat(">>>>>>>>>>>>> Add Fly Spare Type {0}", _type);
for (int i = 0; i < gridNum; i++)
{
Debug.LogFormat(">>>>>>>>>>>>> Add gridInfos[i].type {0}", gridInfos[i].type);
//Debug.LogFormat(">>>>>>>>>>>>> Add gridInfos[i].type {0}", gridInfos[i].type);
if (gridInfos[i].type == SpareType.Null)
{
Debug.LogFormat(">>>>>>>>>>>>> Add Fly Spare Type {0}",_type);
//Debug.LogFormat(">>>>>>>>>>>>> Add Fly Spare Type {0}",_type);
gridInfos[i].type = _type;
FlySpareAct(gridInfos[i]);

@ -1 +1 @@
Build from DESKTOP-Q4UN19A at 2020/6/10 16:54:45
Build from DESKTOP-Q4UN19A at 2020/6/11 22:31:08

@ -51,7 +51,7 @@ PlayerSettings:
defaultScreenWidth: 1024
defaultScreenHeight: 768
defaultScreenWidthWeb: 1040
defaultScreenHeightWeb: 650
defaultScreenHeightWeb: 585
m_StereoRenderingPath: 0
m_ActiveColorSpace: 0
m_MTRendering: 1

@ -29,9 +29,16 @@ QualitySettings:
vSyncCount: 0
lodBias: 0.3
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 4
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2
@ -57,9 +64,16 @@ QualitySettings:
vSyncCount: 0
lodBias: 0.4
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 16
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2
@ -85,9 +99,16 @@ QualitySettings:
vSyncCount: 1
lodBias: 0.7
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 64
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2
@ -113,16 +134,23 @@ QualitySettings:
vSyncCount: 1
lodBias: 1
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 256
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2
name: Very High
pixelLightCount: 3
shadows: 2
shadowResolution: 2
shadowResolution: 1
shadowProjection: 1
shadowCascades: 2
shadowDistance: 40
@ -133,17 +161,24 @@ QualitySettings:
blendWeights: 4
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 4
antiAliasing: 8
softParticles: 1
softVegetation: 1
realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1
vSyncCount: 1
vSyncCount: 0
lodBias: 1.5
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 1024
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2
@ -169,9 +204,51 @@ QualitySettings:
vSyncCount: 1
lodBias: 2
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 4096
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2
name: Level 6
pixelLightCount: 4
shadows: 2
shadowResolution: 2
shadowProjection: 1
shadowCascades: 4
shadowDistance: 150
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
shadowmaskMode: 1
blendWeights: 4
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 4
softParticles: 1
softVegetation: 1
realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1
vSyncCount: 1
lodBias: 2
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 4096
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
m_PerPlatformDefaultQuality:
@ -180,7 +257,7 @@ QualitySettings:
Nintendo Switch: 5
PS4: 5
PSP2: 2
Standalone: 5
Standalone: 3
Tizen: 2
WebGL: 3
WiiU: 5

@ -12,6 +12,8 @@ TagManager:
- DianYuan
- GuangQu
- ZhuBan
- lock01
- lock02
layers:
- Default
- TransparentFX

@ -1 +1 @@
Build from DESKTOP-Q4UN19A at 2020/6/9 16:06:57
Build from DESKTOP-Q4UN19A at 2020/6/11 17:33:57

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 16 KiB

@ -10,7 +10,6 @@
<script src="Build/UnityLoader.js"></script>
<script>
var gameInstance = UnityLoader.instantiate("gameContainer", "Build/DisaComputer.json", {onProgress: UnityProgress});
//注册web端消息监听
window.addEventListener('message',receiveMessage,false);
@ -28,11 +27,11 @@
</head>
<body>
<div class="webgl-content">
<div id="gameContainer" style="width: 1040px; height: 650px"></div>
<div id="gameContainer" style="width: 1040px; height: 585px"></div>
<div class="footer">
<div class="webgl-logo"></div>
<div class="fullscreen" onclick="gameInstance.SetFullscreen(1)"></div>
<div class="title">Formwork</div>
<div class="title">计算机虚拟组装课程</div>
</div>
</div>
</body>

Loading…
Cancel
Save