浏览代码

Merge remote-tracking branch 'origin/main' into AmelMain

/main
Amel Negra 3 年前
当前提交
42ba5e06
共有 18 个文件被更改,包括 124 次插入158 次删除
  1. 2
      UOP1_Project/Assets/Prefabs/Gameplay/MusicPlayer.prefab
  2. 15
      UOP1_Project/Assets/Prefabs/UI/GameplayScene/Pause_Screen.prefab
  3. 115
      UOP1_Project/Assets/Scenes/Managers/PersistentManagers.unity
  4. 17
      UOP1_Project/Assets/Scripts/Audio/MusicPlayer.cs
  5. 4
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/PlayLandParticlesActionSO.cs
  6. 2
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/FadeChannelSO.cs
  7. 3
      UOP1_Project/Assets/Scripts/UI/UIPause.cs
  8. 6
      UOP1_Project/Assets/Scripts/UI/FadeController.cs
  9. 14
      UOP1_Project/Assets/ScriptableObjects/UI/OnPauseOpened.asset
  10. 8
      UOP1_Project/Assets/ScriptableObjects/UI/OnPauseOpened.asset.meta
  11. 27
      UOP1_Project/Assets/Scripts/UI/LoadingInterfaceController.cs
  12. 17
      UOP1_Project/Assets/Scripts/UI/UISpinner.cs
  13. 33
      UOP1_Project/Assets/Scripts/SceneManagement/LoadingScreenManager.cs
  14. 19
      UOP1_Project/Assets/Scripts/SceneManagement/SpinningUI.cs
  15. 0
      /UOP1_Project/Assets/Scripts/UI/FadeController.cs.meta
  16. 0
      /UOP1_Project/Assets/Scripts/UI/FadeController.cs
  17. 0
      /UOP1_Project/Assets/Scripts/UI/LoadingInterfaceController.cs.meta
  18. 0
      /UOP1_Project/Assets/Scripts/UI/UISpinner.cs.meta

2
UOP1_Project/Assets/Prefabs/Gameplay/MusicPlayer.prefab


_playMusicOn: {fileID: 11400000, guid: 51854f522e1d88442a90b878b27ea839, type: 2}
_thisSceneSO: {fileID: 0}
_audioConfig: {fileID: 11400000, guid: 7dc92129d2e4ae84dabc197b593ba446, type: 2}
_pauseMusic: {fileID: 11400000, guid: c6f209cf719542c43b6dc260163ff012, type: 2}
_onPauseOpened: {fileID: 11400000, guid: 995da9391d4589044a8819eeb09bab8f, type: 2}

15
UOP1_Project/Assets/Prefabs/UI/GameplayScene/Pause_Screen.prefab


_settingsButton: {fileID: 7616898161678548386}
_backToMenuButton: {fileID: 4846480490438025061}
_inputReader: {fileID: 11400000, guid: 945ec0365077176418488737deed54be, type: 2}
_onPauseOpened: {fileID: 11400000, guid: 995da9391d4589044a8819eeb09bab8f, type: 2}
--- !u!1 &4003648912280857029
GameObject:
m_ObjectHideFlags: 0

m_KeyId: 342818437455872
m_Key:
m_FallbackState: 0
m_WaitForCompletion: 1
m_FormatArguments: []
m_UpdateString:
m_PersistentCalls:

m_KeyId: 344204675899392
m_Key:
m_FallbackState: 0
m_WaitForCompletion: 1
m_FormatArguments: []
m_UpdateString:
m_PersistentCalls:

objectReference: {fileID: 1489275492277599596}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 344bb0b18b7db4b4e8874973eb391ca1, type: 3}
--- !u!224 &3514724217547639128 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 297632141197697313, guid: 344bb0b18b7db4b4e8874973eb391ca1,
type: 3}
m_PrefabInstance: {fileID: 3812202349799155833}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2758040637148793211 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 1342405351670587650, guid: 344bb0b18b7db4b4e8874973eb391ca1,

m_Script: {fileID: 11500000, guid: 4100492e3231549df8aa06bff38e1ce9, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &3514724217547639128 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 297632141197697313, guid: 344bb0b18b7db4b4e8874973eb391ca1,
type: 3}
m_PrefabInstance: {fileID: 3812202349799155833}
m_PrefabAsset: {fileID: 0}
--- !u!114 &6582248307325847989 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 8052293337922855372, guid: 344bb0b18b7db4b4e8874973eb391ca1,

115
UOP1_Project/Assets/Scenes/Managers/PersistentManagers.unity


m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &363619425
RectTransform:
m_ObjectHideFlags: 0

m_Children:
- {fileID: 841012434}
m_Father: {fileID: 1387982343}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 363619424}
m_CullTransparentMesh: 0
--- !u!1 &447650313
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 447650316}
- component: {fileID: 447650314}
m_Layer: 0
m_Name: GameExitListener
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &447650314
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 447650313}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0ba826e9d52310a43b98dffc289c71b2, type: 3}
m_Name:
m_EditorClassIdentifier:
_channel: {fileID: 11400000, guid: d570e16f713770a4a94310999866e0e0, type: 2}
OnEventRaised:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName:
m_MethodName: ExitGame
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!4 &447650316
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 447650313}
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_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &610459580
GameObject:
m_ObjectHideFlags: 0

_masterVolume: 1
_musicVolume: 0.8
_sfxVolume: 1
--- !u!1 &624605538
--- !u!1 &740063860
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}

m_Component:
- component: {fileID: 624605539}
- component: {fileID: 624605540}
m_Layer: 5
m_Name: LoadingInterfaceManager
- component: {fileID: 740063862}
- component: {fileID: 740063861}
m_Layer: 0
m_Name: LoadingInterfaceController
--- !u!224 &624605539
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 624605538}
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_Children: []
m_Father: {fileID: 1387982343}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &624605540
--- !u!114 &740063861
m_GameObject: {fileID: 624605538}
m_GameObject: {fileID: 740063860}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 66ced4c879634014997808cfc063a88a, type: 3}

type: 2}
loadingInterface: {fileID: 363619424}
--- !u!4 &740063862
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 740063860}
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_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &819074216
PrefabInstance:
m_ObjectHideFlags: 0

- component: {fileID: 1122701838}
- component: {fileID: 1122701837}
m_Layer: 0
m_Name: FadeManager
m_Name: FadeController
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 624605539}
- {fileID: 565765817888297794}
- {fileID: 363619425}
m_Father: {fileID: 0}

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1387982343}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}

17
UOP1_Project/Assets/Scripts/Audio/MusicPlayer.cs


using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;
public class MusicPlayer : MonoBehaviour
{

[SerializeField] private AudioConfigurationSO _audioConfig = default;
[Header("Pause music configuration")]
[SerializeField] private AudioCueSO _pauseMusic = default;
[SerializeField] private BoolEventChannelSO _onPauseOpened = default;
_onPauseOpened.OnEventRaised += PlayPauseMusic;
_onSceneReady.OnEventRaised += PlayMusic;
}

_onPauseOpened.OnEventRaised -= PlayPauseMusic;
}
private void PlayPauseMusic(bool open)
{
if (open)
_playMusicOn.RaisePlayEvent(_pauseMusic, _audioConfig);
else
PlayMusic();
}
}

4
UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/PlayLandParticlesActionSO.cs


//Component references
private PlayerEffectController _dustController;
private Transform _transform;
private CharacterController _characterController;
private float _coolDown = 0.3f;
private float t = 0f;

{
_dustController = stateMachine.GetComponent<PlayerEffectController>();
_transform = stateMachine.transform;
_characterController = stateMachine.GetComponent<CharacterController>();
}
public override void OnStateEnter()

float dY = Mathf.Abs(_fallStartY - _fallEndY);
float fallIntensity = Mathf.InverseLerp(0, _maxFallDistance, dY);
if (Time.time >= t + _coolDown)
if (Time.time >= t + _coolDown && _characterController.isGrounded)
{
_dustController.PlayLandParticles(fallIntensity);
t = Time.time;

2
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/UI/FadeChannelSO.cs


}
/// <summary>
/// Generic fade function. Communicates with <seealso cref="FadeManager.cs"/>.
/// Generic fade function. Communicates with <seealso cref="FadeController.cs"/>.
/// </summary>
/// <param name="fadeIn">If true, the rectangle fades in. If false, the rectangle fades out.</param>
/// <param name="duration">How long it takes to the image to fade in/out.</param>

3
UOP1_Project/Assets/Scripts/UI/UIPause.cs


public UnityAction BackToMainRequested = default;
[SerializeField] private InputReader _inputReader = default;
[SerializeField] private BoolEventChannelSO _onPauseOpened = default;
_onPauseOpened?.OnEventRaised(true);
_resumeButton.SetButton(true);
_inputReader.menuCloseEvent += Resume;
_resumeButton.Clicked += Resume;

private void OnDisable()
{
_onPauseOpened?.OnEventRaised(false);
_inputReader.menuCloseEvent -= Resume;
_resumeButton.Clicked -= Resume;

6
UOP1_Project/Assets/Scripts/UI/FadeController.cs


using System.Collections;
using UnityEngine;
using UnityEngine;
using System;
public class FadeManager : MonoBehaviour
public class FadeController : MonoBehaviour
{
[SerializeField] private FadeChannelSO _fadeChannelSO;
[SerializeField] private Image _imageComponent;

14
UOP1_Project/Assets/ScriptableObjects/UI/OnPauseOpened.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3177d113f09ae42448cde1e1a5067d4f, type: 3}
m_Name: OnPauseOpened
m_EditorClassIdentifier:

8
UOP1_Project/Assets/ScriptableObjects/UI/OnPauseOpened.asset.meta


fileFormatVersion: 2
guid: 995da9391d4589044a8819eeb09bab8f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

27
UOP1_Project/Assets/Scripts/UI/LoadingInterfaceController.cs


using UnityEngine;
public class LoadingInterfaceController : MonoBehaviour
{
[Header("Loading screen Event")]
//The loading screen event we are listening to
[SerializeField] private BoolEventChannelSO _ToggleLoadingScreen = default;
[Header("Loading screen ")]
public GameObject loadingInterface;
private void OnEnable()
{
_ToggleLoadingScreen.OnEventRaised += ToggleLoadingScreen;
}
private void OnDisable()
{
_ToggleLoadingScreen.OnEventRaised -= ToggleLoadingScreen;
}
private void ToggleLoadingScreen(bool state)
{
loadingInterface.SetActive(state);
}
}

17
UOP1_Project/Assets/Scripts/UI/UISpinner.cs


using UnityEngine;
public class UISpinner : MonoBehaviour
{
[SerializeField] private float _rotateSpeed = -150f;
private RectTransform rectComponent;
private void Start()
{
rectComponent = GetComponent<RectTransform>();
}
private void Update()
{
rectComponent.Rotate(0f, 0f, _rotateSpeed * Time.deltaTime);
}
}

33
UOP1_Project/Assets/Scripts/SceneManagement/LoadingScreenManager.cs


using UnityEngine;
public class LoadingScreenManager : MonoBehaviour
{
[Header("Loading screen Event")]
//The loading screen event we are listening to
[SerializeField] private BoolEventChannelSO _ToggleLoadingScreen = default;
[Header("Loading screen ")]
public GameObject loadingInterface;
private void OnEnable()
{
if (_ToggleLoadingScreen != null)
{
_ToggleLoadingScreen.OnEventRaised += ToggleLoadingScreen;
}
}
private void OnDisable()
{
if (_ToggleLoadingScreen != null)
{
_ToggleLoadingScreen.OnEventRaised -= ToggleLoadingScreen;
}
}
private void ToggleLoadingScreen(bool state)
{
loadingInterface.SetActive(state);
}
}

19
UOP1_Project/Assets/Scripts/SceneManagement/SpinningUI.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpinningUI : MonoBehaviour
{
private RectTransform rectComponent;
public float rotateSpeed = 200f;
private void Start()
{
rectComponent = GetComponent<RectTransform>();
}
private void Update()
{
rectComponent.Rotate(0f, 0f, rotateSpeed * Time.deltaTime);
}
}

/UOP1_Project/Assets/Scripts/UI/FadeManager.cs.meta → /UOP1_Project/Assets/Scripts/UI/FadeController.cs.meta

/UOP1_Project/Assets/Scripts/UI/FadeManager.cs → /UOP1_Project/Assets/Scripts/UI/FadeController.cs

/UOP1_Project/Assets/Scripts/SceneManagement/LoadingScreenManager.cs.meta → /UOP1_Project/Assets/Scripts/UI/LoadingInterfaceController.cs.meta

/UOP1_Project/Assets/Scripts/SceneManagement/SpinningUI.cs.meta → /UOP1_Project/Assets/Scripts/UI/UISpinner.cs.meta

正在加载...
取消
保存