update random script & Debug Event

main
Yogi 2024-12-01 15:48:43 +08:00
parent 096af1ab2c
commit 441b9f9324
5 changed files with 53 additions and 20 deletions

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: e246aa68d79c3e6489397d781fa90434
timeCreated: 1490930520
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -290,7 +290,7 @@ MonoBehaviour:
startMsg: START
stopMsg: STOP
videoControl: {fileID: 1041319595}
brainTrans: {fileID: 2000524570}
brainTrans: {fileID: 1881786632}
dt: 0.1
isTestInput: 1
--- !u!1 &748090405
@ -670,15 +670,15 @@ PrefabInstance:
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_TransformParent: {fileID: 1881786632}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: 89b9ffd9832690d4ba423ff477aa1d06, type: 3}
propertyPath: m_LocalPosition.x
value: 0
value: 0.57
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 89b9ffd9832690d4ba423ff477aa1d06, type: 3}
propertyPath: m_LocalPosition.y
value: -1.68
value: -1.92
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 89b9ffd9832690d4ba423ff477aa1d06, type: 3}
propertyPath: m_LocalPosition.z
@ -690,15 +690,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 89b9ffd9832690d4ba423ff477aa1d06, type: 3}
propertyPath: m_LocalRotation.x
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 89b9ffd9832690d4ba423ff477aa1d06, type: 3}
propertyPath: m_LocalRotation.y
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 89b9ffd9832690d4ba423ff477aa1d06, type: 3}
propertyPath: m_LocalRotation.z
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 89b9ffd9832690d4ba423ff477aa1d06, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@ -718,7 +718,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 89b9ffd9832690d4ba423ff477aa1d06, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
@ -819,6 +819,38 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 31.065, y: -41.801, z: -3.726}
--- !u!1 &1881786631
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1881786632}
m_Layer: 0
m_Name: BrainCenter
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1881786632
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1881786631}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2000524570}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!4 &2000524570 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 89b9ffd9832690d4ba423ff477aa1d06, type: 3}
@ -833,6 +865,6 @@ SceneRoots:
- {fileID: 748090407}
- {fileID: 1160156452}
- {fileID: 626615866}
- {fileID: 1785240159}
- {fileID: 1881786632}
- {fileID: 1793753137}
- {fileID: 718402601}

View File

@ -21,6 +21,8 @@ public class AudioPlayControl : MonoBehaviour
player.clip = startAudio;
player.Play();
await Task.Delay((int)(1000 * player.clip.length));
if (this == null || this.gameObject == null)
return;
player.Stop();
this.gameObject.SetActive(false);
}

View File

@ -17,6 +17,11 @@ public class GameManager : MonoBehaviour
public void Awake()
{
SampleMessageListener.OnReceivedMSG += OnReceivedMessage;
brainTrans.gameObject.SetActive(false);
}
private void OnDestroy()
{
SampleMessageListener.OnReceivedMSG -= OnReceivedMessage;
}
private void OnReceivedMessage(string msgStr)
{
@ -94,14 +99,16 @@ public class GameManager : MonoBehaviour
{
OnReceivedMessage(startMsg);
}
else if (Input.GetKeyDown(KeyCode.Alpha2))
if (Input.GetKey(KeyCode.Alpha2))
{
OnReceivedMessage("3,3,3,3,3,3");
float randomF() => Random.Range(0.0f, 1.0f);
OnReceivedMessage($"{randomF()},{randomF()},{randomF()},{randomF()},{randomF()},{randomF()}");
}
else if (Input.GetKeyDown(KeyCode.Alpha3))
{
OnReceivedMessage(stopMsg);
}else if (Input.GetKeyDown(KeyCode.F))
}
else if (Input.GetKeyDown(KeyCode.F))
{
videoControl.StopPlay();
JustGamePlayNoAnim();