Compare commits

...

2 Commits

6 changed files with 185 additions and 15 deletions

View File

@@ -0,0 +1,46 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8333040903491758342
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 635500140343992722}
- component: {fileID: 7196285333769905926}
m_Layer: 0
m_Name: GameDataManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &635500140343992722
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8333040903491758342}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -88.294235, y: 19.015999, z: -27.52}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7196285333769905926
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8333040903491758342}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a768588a5a1e4d7f8d54f8d16b0f4bb0, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7290c83f25217924ea7087611f091128
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -603,6 +603,74 @@ PrefabInstance:
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f480e7d630901ad48a69a5df6d2132f2, type: 3}
--- !u!1001 &3828981172913243262
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 635500140343992722, guid: 7290c83f25217924ea7087611f091128,
type: 3}
propertyPath: m_LocalPosition.x
value: -88.294235
objectReference: {fileID: 0}
- target: {fileID: 635500140343992722, guid: 7290c83f25217924ea7087611f091128,
type: 3}
propertyPath: m_LocalPosition.y
value: 19.015999
objectReference: {fileID: 0}
- target: {fileID: 635500140343992722, guid: 7290c83f25217924ea7087611f091128,
type: 3}
propertyPath: m_LocalPosition.z
value: -27.52
objectReference: {fileID: 0}
- target: {fileID: 635500140343992722, guid: 7290c83f25217924ea7087611f091128,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 635500140343992722, guid: 7290c83f25217924ea7087611f091128,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 635500140343992722, guid: 7290c83f25217924ea7087611f091128,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 635500140343992722, guid: 7290c83f25217924ea7087611f091128,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 635500140343992722, guid: 7290c83f25217924ea7087611f091128,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 635500140343992722, guid: 7290c83f25217924ea7087611f091128,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 635500140343992722, guid: 7290c83f25217924ea7087611f091128,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8333040903491758342, guid: 7290c83f25217924ea7087611f091128,
type: 3}
propertyPath: m_Name
value: GameDataManager
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7290c83f25217924ea7087611f091128, type: 3}
--- !u!1001 &6277645971226662819
PrefabInstance:
m_ObjectHideFlags: 0
@@ -752,3 +820,4 @@ SceneRoots:
- {fileID: 599193259}
- {fileID: 2044057185}
- {fileID: 1724973291}
- {fileID: 3828981172913243262}

View File

@@ -1800,11 +1800,21 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4435893386940746007, guid: 9fc63211af583b946b1f381e4bf38ddf,
type: 3}
propertyPath: m_IsKinematic
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7979385610396712053, guid: 9fc63211af583b946b1f381e4bf38ddf,
type: 3}
propertyPath: m_Name
value: BaseSphere
objectReference: {fileID: 0}
- target: {fileID: 9140300362975493256, guid: 9fc63211af583b946b1f381e4bf38ddf,
type: 3}
propertyPath: isOpenInEditor
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
@@ -1868,11 +1878,31 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 470645613676258024, guid: 8f4de64a5cce27745b5566ff3ef971c8,
type: 3}
propertyPath: m_IsKinematic
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3049630257319171134, guid: 8f4de64a5cce27745b5566ff3ef971c8,
type: 3}
propertyPath: isOpenInEditor
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5829756071943867929, guid: 8f4de64a5cce27745b5566ff3ef971c8,
type: 3}
propertyPath: isOpenInEditor
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7739979277884825363, guid: 8f4de64a5cce27745b5566ff3ef971c8,
type: 3}
propertyPath: m_Name
value: BaseCube
objectReference: {fileID: 0}
- target: {fileID: 8187785643586722023, guid: 8f4de64a5cce27745b5566ff3ef971c8,
type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -9,6 +10,7 @@ namespace Script.Gameplay.Facility
public class EmitterController : BaseFacilityController
{
[Header("发射器设置")]
[SerializeField] private bool isEmittingOnStart = false;
[SerializeField] private GameObject prefabToEmit;
[SerializeField] private Transform emitPoint;
[SerializeField] private Vector3 emitDirection = Vector3.forward;
@@ -18,7 +20,15 @@ namespace Script.Gameplay.Facility
[SerializeField] private float destroyDelay = 5f; // 生成对象多少秒后销毁
private Coroutine emitCoroutine;
private void Start()
{
if (isEmittingOnStart)
{
emitCoroutine = StartCoroutine(EmitRoutine());
}
}
// 接收信号
public override void OnSignalReceived(bool active, GameObject sender)
{

View File

@@ -4,6 +4,7 @@ using Script.Gameplay.Global;
using TMPro;
using UnityEngine;
using Script.Gameplay.Input;
using UnityEngine.InputSystem;
namespace UI
{
@@ -17,21 +18,23 @@ namespace UI
{
base.Awake();
inputManager = InputManager.Instance;
inputManager.Input.Player.Setting.performed+= ctx =>
inputManager.Input.Player.Setting.performed += RegisterInput;
}
private void RegisterInput(InputAction.CallbackContext ctx)
{
if (!isActiveAndEnabled)
{
if (!isActiveAndEnabled)
{
Show();
inputManager.SetInputForLook(false);
inputManager.SetInputForMove(false);
}
else
{
Hide();
inputManager.SetInputForLook(true);
inputManager.SetInputForMove(true);
}
};
Show();
inputManager.SetInputForLook(false);
inputManager.SetInputForMove(false);
}
else
{
Hide();
inputManager.SetInputForLook(true);
inputManager.SetInputForMove(true);
}
}
public override void Show()
@@ -44,5 +47,10 @@ namespace UI
{
base.Hide();
}
private void OnDestroy()
{
inputManager.Input.Player.Setting.performed -= RegisterInput;
}
}
}