浏览代码

Merge branch 'CaveWhiteboxing' of https://github.com/itsLevi0sa/open-project-1 into CaveWhiteboxing

/main
itsLevi0sa 4 年前
当前提交
aa9e8032
共有 40 个文件被更改,包括 661 次插入654 次删除
  1. 2
      UOP1_Project/Assets/Scripts/Audio/MusicPlayer.cs
  2. 10
      UOP1_Project/Assets/Scripts/Audio/OrientListener.cs
  3. 2
      UOP1_Project/Assets/Scripts/Characters/CharacterAudio.cs
  4. 2
      UOP1_Project/Assets/Scripts/Characters/Config/DroppableRewardConfigSO.cs
  5. 2
      UOP1_Project/Assets/Scripts/Characters/Config/SpecialDroppableRewardConfigSO.cs
  6. 2
      UOP1_Project/Assets/Scripts/Characters/NPC.cs
  7. 2
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/DropRewardSO.cs
  8. 2
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/MovementActions/PathwayMovementAction.cs
  9. 6
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/ShakeCamActionSO.cs
  10. 3
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/HasReachedWaypointSO.cs
  11. 3
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsANewLineDisplayedSO.cs
  12. 4
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCInDialogueSO.cs
  13. 3
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCSayingTheLineSO.cs
  14. 4
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCTalkingSO.cs
  15. 4
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCWalkingSO.cs
  16. 2
      UOP1_Project/Assets/Scripts/EditorTools/LightmapScaleSetter.cs
  17. 6
      UOP1_Project/Assets/Scripts/Events/ScriptableObjects/BoolEventChannelSO.cs
  18. 22
      UOP1_Project/Assets/Scripts/Gameplay/GameManager.cs
  19. 38
      UOP1_Project/Assets/Scripts/Gameplay/GameStateSO.cs
  20. 2
      UOP1_Project/Assets/Scripts/Gameplay/SpawnSystem.cs
  21. 753
      UOP1_Project/Assets/Scripts/Input/GameInput.cs
  22. 8
      UOP1_Project/Assets/Scripts/Inventory/ScriptableObjects/InventorySO.cs
  23. 2
      UOP1_Project/Assets/Scripts/Inventory/ScriptableObjects/ItemSO.cs
  24. 2
      UOP1_Project/Assets/Scripts/Inventory/ScriptableObjects/LocalizedItemSO.cs
  25. 2
      UOP1_Project/Assets/Scripts/Menu/MultiInputButton.cs
  26. 263
      UOP1_Project/Assets/Scripts/Quests/Editor/QuestEditorWindow.cs
  27. 6
      UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestSO.cs
  28. 4
      UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestlineSO.cs
  29. 13
      UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/StepSO.cs
  30. 4
      UOP1_Project/Assets/Scripts/SaveSystem/FileManager.cs
  31. 22
      UOP1_Project/Assets/Scripts/SaveSystem/SaveSystem.cs
  32. 2
      UOP1_Project/Assets/Scripts/SceneManagement/LocationEntrance.cs
  33. 6
      UOP1_Project/Assets/Scripts/SceneManagement/StartGame.cs
  34. 2
      UOP1_Project/Assets/Scripts/UI/Dialogue/UIDialogueManager.cs
  35. 2
      UOP1_Project/Assets/Scripts/UI/Inventory/UIInventoryInspector.cs
  36. 10
      UOP1_Project/Assets/Scripts/UI/Settings/UIPaginationFiller.cs
  37. 51
      UOP1_Project/Assets/Scripts/UI/Settings/UISettingFieldsFiller.cs
  38. 16
      UOP1_Project/Assets/Scripts/UI/Settings/UISettingItemFiller.cs
  39. 20
      UOP1_Project/Assets/Scripts/UI/Settings/UISettingTabFiller.cs
  40. 6
      UOP1_Project/Assets/Scripts/UI/Settings/UISettingTabsFiller.cs

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


[SerializeField] private AudioConfigurationSO _audioConfig = default;
[Header("Pause music configuration")]
[SerializeField] private AudioCueSO _pauseMusic = default;
[SerializeField] private BoolEventChannelSO _onPauseOpened = default;
[SerializeField] private BoolEventChannelSO _onPauseOpened = default;
private void OnEnable()
{

10
UOP1_Project/Assets/Scripts/Audio/OrientListener.cs


// Orient the listener to point in the same direction as the camera.
public class OrientListener : MonoBehaviour
{
// Reference to the camera transform determine listener orientation
// Reference to the camera transform determine listener orientation
void LateUpdate()
{
transform.forward = _cameraTransform.Transform.forward;
}
void LateUpdate()
{
transform.forward = _cameraTransform.Transform.forward;
}
}

2
UOP1_Project/Assets/Scripts/Characters/CharacterAudio.cs


public class CharacterAudio : MonoBehaviour
{
[SerializeField] protected AudioCueEventChannelSO _sfxEventChannel = default;
[SerializeField] protected AudioCueEventChannelSO _sfxEventChannel = default;
[SerializeField] protected AudioConfigurationSO _audioConfig = default;
}

2
UOP1_Project/Assets/Scripts/Characters/Config/DroppableRewardConfigSO.cs


public virtual DropGroup DropSpecialItem()
{
return null;
return null;
}

2
UOP1_Project/Assets/Scripts/Characters/Config/SpecialDroppableRewardConfigSO.cs


if (_specialDroppableCurrentCount >= _specialDroppableMaxCount)
return _specialItem;
else
return null;
return null;
}
}

2
UOP1_Project/Assets/Scripts/Characters/NPC.cs


using System.Collections.Generic;
using UnityEngine;
public enum NPCState { Idle = 0, Walk, Talk};
public enum NPCState { Idle = 0, Walk, Talk };
public class NPC : MonoBehaviour
{

2
UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/DropRewardSO.cs


private void DropAllRewards(Vector3 position)
{
DropGroup specialDropItem = _dropRewardConfig.DropSpecialItem();
DropGroup specialDropItem = _dropRewardConfig.DropSpecialItem();
if (specialDropItem != null) // drops a special item if any
DropOneReward(specialDropItem, position);
// Drop items

2
UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/MovementActions/PathwayMovementAction.cs


{
_agent = agent;
_isActiveAgent = _agent != null && _agent.isActiveAndEnabled && _agent.isOnNavMesh;
_wayPointIndex = - 1; //Initialized to -1 so we don't skip the first element from the waypoint list
_wayPointIndex = -1; //Initialized to -1 so we don't skip the first element from the waypoint list
_roamingSpeed = config.Speed;
_wayppoints = config.Waypoints;
}

6
UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/ShakeCamActionSO.cs


public override void Awake(StateMachine stateMachine)
{
}
public override void OnStateExit()
{
}

3
UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/HasReachedWaypointSO.cs


if (!_agent.pathPending)
{
//set the stop distance to 0.1 if it is set to 0 in the inspector
if (_agent.stoppingDistance == 0) _agent.stoppingDistance = 0.1f;
if (_agent.stoppingDistance == 0)
_agent.stoppingDistance = 0.1f;
if (_agent.remainingDistance <= _agent.stoppingDistance)
{
if (!_agent.hasPath || _agent.velocity.sqrMagnitude == 0f)

3
UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsANewLineDisplayedSO.cs


using UOP1.StateMachine.ScriptableObjects;
[CreateAssetMenu(fileName = "IsANewLineDisplayed", menuName = "State Machines/Conditions/Is A New Line Displayed")]
public class IsANewLineDisplayedSO : StateConditionSO {
public class IsANewLineDisplayedSO : StateConditionSO
{
[SerializeField] private DialogueLineChannelSO _onLineDisplayed = default;

4
UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCInDialogueSO.cs


{
_stepControllerScript = stateMachine.GetComponent<StepController>();
}
protected override bool Statement()
{

return false;
}
}
}

3
UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCSayingTheLineSO.cs


using UOP1.StateMachine.ScriptableObjects;
[CreateAssetMenu(fileName = "IsNPCSayingTheLine", menuName = "State Machines/Conditions/Is NPC Saying The Line")]
public class IsNPCSayingTheLineSO : StateConditionSO {
public class IsNPCSayingTheLineSO : StateConditionSO
{
[SerializeField] private DialogueLineChannelSO _onLineDisplayed = default;
[SerializeField] private ActorSO _protagonistActor;

4
UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCTalkingSO.cs


{
_npcScript = stateMachine.GetComponent<NPC>();
}
protected override bool Statement()
{

return false;
}
}
}

4
UOP1_Project/Assets/Scripts/Characters/StateMachine/Conditions/IsNPCWalkingSO.cs


{
_npcScript = stateMachine.GetComponent<NPC>();
}
protected override bool Statement()
{

return false;
}
}
}

2
UOP1_Project/Assets/Scripts/EditorTools/LightmapScaleSetter.cs


public class LightmapScaleSetter : MonoBehaviour
{
[SerializeField] private float _lightmapScale = 1f;
[SerializeField] private float _lightmapScale = 1f;
#if UNITY_EDITOR
// Called when the Lightmap Scale field is changed in the component editor

6
UOP1_Project/Assets/Scripts/Events/ScriptableObjects/BoolEventChannelSO.cs


public void UnsubscribeAll()
{
if (OnEventRaised != null)
{
{
foreach (System.Delegate d in OnEventRaised.GetInvocationList())
{
OnEventRaised -= d as UnityAction<bool>;

}
}

22
UOP1_Project/Assets/Scripts/Gameplay/GameManager.cs


}
private void OnEnable()
{
_addRockCandyRecipeEvent.OnEventRaised += AddRockCandyRecipe;
_addRockCandyRecipeEvent.OnEventRaised += AddRockCandyRecipe;
}
private void OnDisable()
{

}
// Start is called before the first frame update
void StartGame()
{
_gameState.UpdateGameState(GameState.Gameplay);
_questManager.StartGame();
}
public void PauseGame()
}
public void UnpauseGame()
{
_gameState.ResetToPreviousGameState();
}
_gameState.UpdateGameState(GameState.Gameplay);
_questManager.StartGame();
}
public void PauseGame()
{
}
public void UnpauseGame()
{
_gameState.ResetToPreviousGameState();
}
}

38
UOP1_Project/Assets/Scripts/Gameplay/GameStateSO.cs


using UnityEngine;
public enum GameState
{
Gameplay,// regular state: player moves, attacks, can perform actions
Pause,// pause menu is opened, the whole game world is frozen
Inventory, //when inventory UI or cooking UI are open
Dialogue,
Cutscene,
LocationTransition,// when the character steps into LocationExit trigger, fade to black begins and control is removed from the player
Combat,//enemy is nearby and alert, player can't open Inventory or initiate dialogues, but can pause the game
Gameplay,// regular state: player moves, attacks, can perform actions
Pause,// pause menu is opened, the whole game world is frozen
Inventory, //when inventory UI or cooking UI are open
Dialogue,
Cutscene,
LocationTransition,// when the character steps into LocationExit trigger, fade to black begins and control is removed from the player
Combat,//enemy is nearby and alert, player can't open Inventory or initiate dialogues, but can pause the game
public class GameStateSO : ScriptableObject
public class GameStateSO : ScriptableObject
private GameState _currentGameState = default;
private GameState _previousGameState = default;
public GameState CurrentGameState => _currentGameState;
private GameState _currentGameState = default;
private GameState _previousGameState = default;
public GameState CurrentGameState => _currentGameState;
public void UpdateGameState( GameState newGameState)
public void UpdateGameState(GameState newGameState)
_previousGameState = _currentGameState;
_currentGameState = newGameState;
_previousGameState = _currentGameState;
_currentGameState = newGameState;
}
public void ResetToPreviousGameState()
{
_currentGameState = _previousGameState;
}
public void ResetToPreviousGameState()
{
_currentGameState = _previousGameState;
}
}
}

2
UOP1_Project/Assets/Scripts/Gameplay/SpawnSystem.cs


//Look for the element in the available LocationEntries that matches tha last PathSO taken
int entranceIndex = Array.FindIndex(_spawnLocations, element =>
element.EntrancePath == _pathTaken.lastPathTaken );
element.EntrancePath == _pathTaken.lastPathTaken);
if (entranceIndex == -1)
{

753
UOP1_Project/Assets/Scripts/Input/GameInput.cs


public class @GameInput : IInputActionCollection, IDisposable
{
public InputActionAsset asset { get; }
public @GameInput()
{
asset = InputActionAsset.FromJson(@"{
public InputActionAsset asset { get; }
public @GameInput()
{
asset = InputActionAsset.FromJson(@"{
""name"": ""GameInput"",
""maps"": [
{

}
]
}");
// Gameplay
m_Gameplay = asset.FindActionMap("Gameplay", throwIfNotFound: true);
m_Gameplay_Move = m_Gameplay.FindAction("Move", throwIfNotFound: true);
m_Gameplay_Jump = m_Gameplay.FindAction("Jump", throwIfNotFound: true);
m_Gameplay_Attack = m_Gameplay.FindAction("Attack", throwIfNotFound: true);
m_Gameplay_Interact = m_Gameplay.FindAction("Interact", throwIfNotFound: true);
m_Gameplay_Pause = m_Gameplay.FindAction("Pause", throwIfNotFound: true);
m_Gameplay_OpenInventory = m_Gameplay.FindAction("OpenInventory", throwIfNotFound: true);
m_Gameplay_RotateCamera = m_Gameplay.FindAction("RotateCamera", throwIfNotFound: true);
m_Gameplay_MouseControlCamera = m_Gameplay.FindAction("MouseControlCamera", throwIfNotFound: true);
m_Gameplay_Run = m_Gameplay.FindAction("Run", throwIfNotFound: true);
// Menus
m_Menus = asset.FindActionMap("Menus", throwIfNotFound: true);
m_Menus_MoveSelection = m_Menus.FindAction("MoveSelection", throwIfNotFound: true);
m_Menus_Navigate = m_Menus.FindAction("Navigate", throwIfNotFound: true);
m_Menus_Submit = m_Menus.FindAction("Submit", throwIfNotFound: true);
m_Menus_Confirm = m_Menus.FindAction("Confirm", throwIfNotFound: true);
m_Menus_Cancel = m_Menus.FindAction("Cancel", throwIfNotFound: true);
m_Menus_MouseMove = m_Menus.FindAction("MouseMove", throwIfNotFound: true);
m_Menus_Unpause = m_Menus.FindAction("Unpause", throwIfNotFound: true);
m_Menus_ChangeTab = m_Menus.FindAction("ChangeTab", throwIfNotFound: true);
m_Menus_InventoryActionButton = m_Menus.FindAction("InventoryActionButton", throwIfNotFound: true);
m_Menus_Click = m_Menus.FindAction("Click", throwIfNotFound: true);
m_Menus_Point = m_Menus.FindAction("Point", throwIfNotFound: true);
m_Menus_RightClick = m_Menus.FindAction("RightClick", throwIfNotFound: true);
m_Menus_CloseInventory = m_Menus.FindAction("CloseInventory", throwIfNotFound: true);
// Dialogues
m_Dialogues = asset.FindActionMap("Dialogues", throwIfNotFound: true);
m_Dialogues_MoveSelection = m_Dialogues.FindAction("MoveSelection", throwIfNotFound: true);
m_Dialogues_AdvanceDialogue = m_Dialogues.FindAction("AdvanceDialogue", throwIfNotFound: true);
}
// Gameplay
m_Gameplay = asset.FindActionMap("Gameplay", throwIfNotFound: true);
m_Gameplay_Move = m_Gameplay.FindAction("Move", throwIfNotFound: true);
m_Gameplay_Jump = m_Gameplay.FindAction("Jump", throwIfNotFound: true);
m_Gameplay_Attack = m_Gameplay.FindAction("Attack", throwIfNotFound: true);
m_Gameplay_Interact = m_Gameplay.FindAction("Interact", throwIfNotFound: true);
m_Gameplay_Pause = m_Gameplay.FindAction("Pause", throwIfNotFound: true);
m_Gameplay_OpenInventory = m_Gameplay.FindAction("OpenInventory", throwIfNotFound: true);
m_Gameplay_RotateCamera = m_Gameplay.FindAction("RotateCamera", throwIfNotFound: true);
m_Gameplay_MouseControlCamera = m_Gameplay.FindAction("MouseControlCamera", throwIfNotFound: true);
m_Gameplay_Run = m_Gameplay.FindAction("Run", throwIfNotFound: true);
// Menus
m_Menus = asset.FindActionMap("Menus", throwIfNotFound: true);
m_Menus_MoveSelection = m_Menus.FindAction("MoveSelection", throwIfNotFound: true);
m_Menus_Navigate = m_Menus.FindAction("Navigate", throwIfNotFound: true);
m_Menus_Submit = m_Menus.FindAction("Submit", throwIfNotFound: true);
m_Menus_Confirm = m_Menus.FindAction("Confirm", throwIfNotFound: true);
m_Menus_Cancel = m_Menus.FindAction("Cancel", throwIfNotFound: true);
m_Menus_MouseMove = m_Menus.FindAction("MouseMove", throwIfNotFound: true);
m_Menus_Unpause = m_Menus.FindAction("Unpause", throwIfNotFound: true);
m_Menus_ChangeTab = m_Menus.FindAction("ChangeTab", throwIfNotFound: true);
m_Menus_InventoryActionButton = m_Menus.FindAction("InventoryActionButton", throwIfNotFound: true);
m_Menus_Click = m_Menus.FindAction("Click", throwIfNotFound: true);
m_Menus_Point = m_Menus.FindAction("Point", throwIfNotFound: true);
m_Menus_RightClick = m_Menus.FindAction("RightClick", throwIfNotFound: true);
m_Menus_CloseInventory = m_Menus.FindAction("CloseInventory", throwIfNotFound: true);
// Dialogues
m_Dialogues = asset.FindActionMap("Dialogues", throwIfNotFound: true);
m_Dialogues_MoveSelection = m_Dialogues.FindAction("MoveSelection", throwIfNotFound: true);
m_Dialogues_AdvanceDialogue = m_Dialogues.FindAction("AdvanceDialogue", throwIfNotFound: true);
}
public void Dispose()
{
UnityEngine.Object.Destroy(asset);
}
public void Dispose()
{
UnityEngine.Object.Destroy(asset);
}
public InputBinding? bindingMask
{
get => asset.bindingMask;
set => asset.bindingMask = value;
}
public InputBinding? bindingMask
{
get => asset.bindingMask;
set => asset.bindingMask = value;
}
public ReadOnlyArray<InputDevice>? devices
{
get => asset.devices;
set => asset.devices = value;
}
public ReadOnlyArray<InputDevice>? devices
{
get => asset.devices;
set => asset.devices = value;
}
public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
public bool Contains(InputAction action)
{
return asset.Contains(action);
}
public bool Contains(InputAction action)
{
return asset.Contains(action);
}
public IEnumerator<InputAction> GetEnumerator()
{
return asset.GetEnumerator();
}
public IEnumerator<InputAction> GetEnumerator()
{
return asset.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public void Enable()
{
asset.Enable();
}
public void Enable()
{
asset.Enable();
}
public void Disable()
{
asset.Disable();
}
public void Disable()
{
asset.Disable();
}
// Gameplay
private readonly InputActionMap m_Gameplay;
private IGameplayActions m_GameplayActionsCallbackInterface;
private readonly InputAction m_Gameplay_Move;
private readonly InputAction m_Gameplay_Jump;
private readonly InputAction m_Gameplay_Attack;
private readonly InputAction m_Gameplay_Interact;
private readonly InputAction m_Gameplay_Pause;
private readonly InputAction m_Gameplay_OpenInventory;
private readonly InputAction m_Gameplay_RotateCamera;
private readonly InputAction m_Gameplay_MouseControlCamera;
private readonly InputAction m_Gameplay_Run;
public struct GameplayActions
{
private @GameInput m_Wrapper;
public GameplayActions(@GameInput wrapper) { m_Wrapper = wrapper; }
public InputAction @Move => m_Wrapper.m_Gameplay_Move;
public InputAction @Jump => m_Wrapper.m_Gameplay_Jump;
public InputAction @Attack => m_Wrapper.m_Gameplay_Attack;
public InputAction @Interact => m_Wrapper.m_Gameplay_Interact;
public InputAction @Pause => m_Wrapper.m_Gameplay_Pause;
public InputAction @OpenInventory => m_Wrapper.m_Gameplay_OpenInventory;
public InputAction @RotateCamera => m_Wrapper.m_Gameplay_RotateCamera;
public InputAction @MouseControlCamera => m_Wrapper.m_Gameplay_MouseControlCamera;
public InputAction @Run => m_Wrapper.m_Gameplay_Run;
public InputActionMap Get() { return m_Wrapper.m_Gameplay; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(GameplayActions set) { return set.Get(); }
public void SetCallbacks(IGameplayActions instance)
{
if (m_Wrapper.m_GameplayActionsCallbackInterface != null)
{
@Move.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMove;
@Move.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMove;
@Move.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMove;
@Jump.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnJump;
@Jump.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnJump;
@Jump.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnJump;
@Attack.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnAttack;
@Attack.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnAttack;
@Attack.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnAttack;
@Interact.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnInteract;
@Interact.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnInteract;
@Interact.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnInteract;
@Pause.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnPause;
@Pause.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnPause;
@Pause.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnPause;
@OpenInventory.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnOpenInventory;
@OpenInventory.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnOpenInventory;
@OpenInventory.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnOpenInventory;
@RotateCamera.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnRotateCamera;
@RotateCamera.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnRotateCamera;
@RotateCamera.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnRotateCamera;
@MouseControlCamera.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMouseControlCamera;
@MouseControlCamera.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMouseControlCamera;
@MouseControlCamera.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMouseControlCamera;
@Run.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnRun;
@Run.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnRun;
@Run.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnRun;
}
m_Wrapper.m_GameplayActionsCallbackInterface = instance;
if (instance != null)
{
@Move.started += instance.OnMove;
@Move.performed += instance.OnMove;
@Move.canceled += instance.OnMove;
@Jump.started += instance.OnJump;
@Jump.performed += instance.OnJump;
@Jump.canceled += instance.OnJump;
@Attack.started += instance.OnAttack;
@Attack.performed += instance.OnAttack;
@Attack.canceled += instance.OnAttack;
@Interact.started += instance.OnInteract;
@Interact.performed += instance.OnInteract;
@Interact.canceled += instance.OnInteract;
@Pause.started += instance.OnPause;
@Pause.performed += instance.OnPause;
@Pause.canceled += instance.OnPause;
@OpenInventory.started += instance.OnOpenInventory;
@OpenInventory.performed += instance.OnOpenInventory;
@OpenInventory.canceled += instance.OnOpenInventory;
@RotateCamera.started += instance.OnRotateCamera;
@RotateCamera.performed += instance.OnRotateCamera;
@RotateCamera.canceled += instance.OnRotateCamera;
@MouseControlCamera.started += instance.OnMouseControlCamera;
@MouseControlCamera.performed += instance.OnMouseControlCamera;
@MouseControlCamera.canceled += instance.OnMouseControlCamera;
@Run.started += instance.OnRun;
@Run.performed += instance.OnRun;
@Run.canceled += instance.OnRun;
}
}
}
public GameplayActions @Gameplay => new GameplayActions(this);
// Gameplay
private readonly InputActionMap m_Gameplay;
private IGameplayActions m_GameplayActionsCallbackInterface;
private readonly InputAction m_Gameplay_Move;
private readonly InputAction m_Gameplay_Jump;
private readonly InputAction m_Gameplay_Attack;
private readonly InputAction m_Gameplay_Interact;
private readonly InputAction m_Gameplay_Pause;
private readonly InputAction m_Gameplay_OpenInventory;
private readonly InputAction m_Gameplay_RotateCamera;
private readonly InputAction m_Gameplay_MouseControlCamera;
private readonly InputAction m_Gameplay_Run;
public struct GameplayActions
{
private @GameInput m_Wrapper;
public GameplayActions(@GameInput wrapper) { m_Wrapper = wrapper; }
public InputAction @Move => m_Wrapper.m_Gameplay_Move;
public InputAction @Jump => m_Wrapper.m_Gameplay_Jump;
public InputAction @Attack => m_Wrapper.m_Gameplay_Attack;
public InputAction @Interact => m_Wrapper.m_Gameplay_Interact;
public InputAction @Pause => m_Wrapper.m_Gameplay_Pause;
public InputAction @OpenInventory => m_Wrapper.m_Gameplay_OpenInventory;
public InputAction @RotateCamera => m_Wrapper.m_Gameplay_RotateCamera;
public InputAction @MouseControlCamera => m_Wrapper.m_Gameplay_MouseControlCamera;
public InputAction @Run => m_Wrapper.m_Gameplay_Run;
public InputActionMap Get() { return m_Wrapper.m_Gameplay; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(GameplayActions set) { return set.Get(); }
public void SetCallbacks(IGameplayActions instance)
{
if (m_Wrapper.m_GameplayActionsCallbackInterface != null)
{
@Move.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMove;
@Move.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMove;
@Move.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMove;
@Jump.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnJump;
@Jump.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnJump;
@Jump.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnJump;
@Attack.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnAttack;
@Attack.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnAttack;
@Attack.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnAttack;
@Interact.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnInteract;
@Interact.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnInteract;
@Interact.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnInteract;
@Pause.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnPause;
@Pause.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnPause;
@Pause.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnPause;
@OpenInventory.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnOpenInventory;
@OpenInventory.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnOpenInventory;
@OpenInventory.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnOpenInventory;
@RotateCamera.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnRotateCamera;
@RotateCamera.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnRotateCamera;
@RotateCamera.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnRotateCamera;
@MouseControlCamera.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMouseControlCamera;
@MouseControlCamera.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMouseControlCamera;
@MouseControlCamera.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMouseControlCamera;
@Run.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnRun;
@Run.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnRun;
@Run.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnRun;
}
m_Wrapper.m_GameplayActionsCallbackInterface = instance;
if (instance != null)
{
@Move.started += instance.OnMove;
@Move.performed += instance.OnMove;
@Move.canceled += instance.OnMove;
@Jump.started += instance.OnJump;
@Jump.performed += instance.OnJump;
@Jump.canceled += instance.OnJump;
@Attack.started += instance.OnAttack;
@Attack.performed += instance.OnAttack;
@Attack.canceled += instance.OnAttack;
@Interact.started += instance.OnInteract;
@Interact.performed += instance.OnInteract;
@Interact.canceled += instance.OnInteract;
@Pause.started += instance.OnPause;
@Pause.performed += instance.OnPause;
@Pause.canceled += instance.OnPause;
@OpenInventory.started += instance.OnOpenInventory;
@OpenInventory.performed += instance.OnOpenInventory;
@OpenInventory.canceled += instance.OnOpenInventory;
@RotateCamera.started += instance.OnRotateCamera;
@RotateCamera.performed += instance.OnRotateCamera;
@RotateCamera.canceled += instance.OnRotateCamera;
@MouseControlCamera.started += instance.OnMouseControlCamera;
@MouseControlCamera.performed += instance.OnMouseControlCamera;
@MouseControlCamera.canceled += instance.OnMouseControlCamera;
@Run.started += instance.OnRun;
@Run.performed += instance.OnRun;
@Run.canceled += instance.OnRun;
}
}
}
public GameplayActions @Gameplay => new GameplayActions(this);
// Menus
private readonly InputActionMap m_Menus;
private IMenusActions m_MenusActionsCallbackInterface;
private readonly InputAction m_Menus_MoveSelection;
private readonly InputAction m_Menus_Navigate;
private readonly InputAction m_Menus_Submit;
private readonly InputAction m_Menus_Confirm;
private readonly InputAction m_Menus_Cancel;
private readonly InputAction m_Menus_MouseMove;
private readonly InputAction m_Menus_Unpause;
private readonly InputAction m_Menus_ChangeTab;
private readonly InputAction m_Menus_InventoryActionButton;
private readonly InputAction m_Menus_Click;
private readonly InputAction m_Menus_Point;
private readonly InputAction m_Menus_RightClick;
private readonly InputAction m_Menus_CloseInventory;
public struct MenusActions
{
private @GameInput m_Wrapper;
public MenusActions(@GameInput wrapper) { m_Wrapper = wrapper; }
public InputAction @MoveSelection => m_Wrapper.m_Menus_MoveSelection;
public InputAction @Navigate => m_Wrapper.m_Menus_Navigate;
public InputAction @Submit => m_Wrapper.m_Menus_Submit;
public InputAction @Confirm => m_Wrapper.m_Menus_Confirm;
public InputAction @Cancel => m_Wrapper.m_Menus_Cancel;
public InputAction @MouseMove => m_Wrapper.m_Menus_MouseMove;
public InputAction @Unpause => m_Wrapper.m_Menus_Unpause;
public InputAction @ChangeTab => m_Wrapper.m_Menus_ChangeTab;
public InputAction @InventoryActionButton => m_Wrapper.m_Menus_InventoryActionButton;
public InputAction @Click => m_Wrapper.m_Menus_Click;
public InputAction @Point => m_Wrapper.m_Menus_Point;
public InputAction @RightClick => m_Wrapper.m_Menus_RightClick;
public InputAction @CloseInventory => m_Wrapper.m_Menus_CloseInventory;
public InputActionMap Get() { return m_Wrapper.m_Menus; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(MenusActions set) { return set.Get(); }
public void SetCallbacks(IMenusActions instance)
{
if (m_Wrapper.m_MenusActionsCallbackInterface != null)
{
@MoveSelection.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnMoveSelection;
@MoveSelection.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnMoveSelection;
@MoveSelection.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnMoveSelection;
@Navigate.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnNavigate;
@Navigate.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnNavigate;
@Navigate.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnNavigate;
@Submit.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnSubmit;
@Submit.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnSubmit;
@Submit.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnSubmit;
@Confirm.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnConfirm;
@Confirm.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnConfirm;
@Confirm.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnConfirm;
@Cancel.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnCancel;
@Cancel.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnCancel;
@Cancel.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnCancel;
@MouseMove.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnMouseMove;
@MouseMove.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnMouseMove;
@MouseMove.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnMouseMove;
@Unpause.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnUnpause;
@Unpause.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnUnpause;
@Unpause.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnUnpause;
@ChangeTab.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnChangeTab;
@ChangeTab.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnChangeTab;
@ChangeTab.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnChangeTab;
@InventoryActionButton.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnInventoryActionButton;
@InventoryActionButton.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnInventoryActionButton;
@InventoryActionButton.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnInventoryActionButton;
@Click.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnClick;
@Click.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnClick;
@Click.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnClick;
@Point.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnPoint;
@Point.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnPoint;
@Point.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnPoint;
@RightClick.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnRightClick;
@RightClick.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnRightClick;
@RightClick.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnRightClick;
@CloseInventory.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnCloseInventory;
@CloseInventory.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnCloseInventory;
@CloseInventory.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnCloseInventory;
}
m_Wrapper.m_MenusActionsCallbackInterface = instance;
if (instance != null)
{
@MoveSelection.started += instance.OnMoveSelection;
@MoveSelection.performed += instance.OnMoveSelection;
@MoveSelection.canceled += instance.OnMoveSelection;
@Navigate.started += instance.OnNavigate;
@Navigate.performed += instance.OnNavigate;
@Navigate.canceled += instance.OnNavigate;
@Submit.started += instance.OnSubmit;
@Submit.performed += instance.OnSubmit;
@Submit.canceled += instance.OnSubmit;
@Confirm.started += instance.OnConfirm;
@Confirm.performed += instance.OnConfirm;
@Confirm.canceled += instance.OnConfirm;
@Cancel.started += instance.OnCancel;
@Cancel.performed += instance.OnCancel;
@Cancel.canceled += instance.OnCancel;
@MouseMove.started += instance.OnMouseMove;
@MouseMove.performed += instance.OnMouseMove;
@MouseMove.canceled += instance.OnMouseMove;
@Unpause.started += instance.OnUnpause;
@Unpause.performed += instance.OnUnpause;
@Unpause.canceled += instance.OnUnpause;
@ChangeTab.started += instance.OnChangeTab;
@ChangeTab.performed += instance.OnChangeTab;
@ChangeTab.canceled += instance.OnChangeTab;
@InventoryActionButton.started += instance.OnInventoryActionButton;
@InventoryActionButton.performed += instance.OnInventoryActionButton;
@InventoryActionButton.canceled += instance.OnInventoryActionButton;
@Click.started += instance.OnClick;
@Click.performed += instance.OnClick;
@Click.canceled += instance.OnClick;
@Point.started += instance.OnPoint;
@Point.performed += instance.OnPoint;
@Point.canceled += instance.OnPoint;
@RightClick.started += instance.OnRightClick;
@RightClick.performed += instance.OnRightClick;
@RightClick.canceled += instance.OnRightClick;
@CloseInventory.started += instance.OnCloseInventory;
@CloseInventory.performed += instance.OnCloseInventory;
@CloseInventory.canceled += instance.OnCloseInventory;
}
}
}
public MenusActions @Menus => new MenusActions(this);
// Menus
private readonly InputActionMap m_Menus;
private IMenusActions m_MenusActionsCallbackInterface;
private readonly InputAction m_Menus_MoveSelection;
private readonly InputAction m_Menus_Navigate;
private readonly InputAction m_Menus_Submit;
private readonly InputAction m_Menus_Confirm;
private readonly InputAction m_Menus_Cancel;
private readonly InputAction m_Menus_MouseMove;
private readonly InputAction m_Menus_Unpause;
private readonly InputAction m_Menus_ChangeTab;
private readonly InputAction m_Menus_InventoryActionButton;
private readonly InputAction m_Menus_Click;
private readonly InputAction m_Menus_Point;
private readonly InputAction m_Menus_RightClick;
private readonly InputAction m_Menus_CloseInventory;
public struct MenusActions
{
private @GameInput m_Wrapper;
public MenusActions(@GameInput wrapper) { m_Wrapper = wrapper; }
public InputAction @MoveSelection => m_Wrapper.m_Menus_MoveSelection;
public InputAction @Navigate => m_Wrapper.m_Menus_Navigate;
public InputAction @Submit => m_Wrapper.m_Menus_Submit;
public InputAction @Confirm => m_Wrapper.m_Menus_Confirm;
public InputAction @Cancel => m_Wrapper.m_Menus_Cancel;
public InputAction @MouseMove => m_Wrapper.m_Menus_MouseMove;
public InputAction @Unpause => m_Wrapper.m_Menus_Unpause;
public InputAction @ChangeTab => m_Wrapper.m_Menus_ChangeTab;
public InputAction @InventoryActionButton => m_Wrapper.m_Menus_InventoryActionButton;
public InputAction @Click => m_Wrapper.m_Menus_Click;
public InputAction @Point => m_Wrapper.m_Menus_Point;
public InputAction @RightClick => m_Wrapper.m_Menus_RightClick;
public InputAction @CloseInventory => m_Wrapper.m_Menus_CloseInventory;
public InputActionMap Get() { return m_Wrapper.m_Menus; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(MenusActions set) { return set.Get(); }
public void SetCallbacks(IMenusActions instance)
{
if (m_Wrapper.m_MenusActionsCallbackInterface != null)
{
@MoveSelection.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnMoveSelection;
@MoveSelection.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnMoveSelection;
@MoveSelection.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnMoveSelection;
@Navigate.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnNavigate;
@Navigate.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnNavigate;
@Navigate.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnNavigate;
@Submit.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnSubmit;
@Submit.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnSubmit;
@Submit.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnSubmit;
@Confirm.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnConfirm;
@Confirm.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnConfirm;
@Confirm.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnConfirm;
@Cancel.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnCancel;
@Cancel.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnCancel;
@Cancel.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnCancel;
@MouseMove.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnMouseMove;
@MouseMove.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnMouseMove;
@MouseMove.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnMouseMove;
@Unpause.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnUnpause;
@Unpause.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnUnpause;
@Unpause.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnUnpause;
@ChangeTab.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnChangeTab;
@ChangeTab.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnChangeTab;
@ChangeTab.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnChangeTab;
@InventoryActionButton.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnInventoryActionButton;
@InventoryActionButton.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnInventoryActionButton;
@InventoryActionButton.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnInventoryActionButton;
@Click.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnClick;
@Click.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnClick;
@Click.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnClick;
@Point.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnPoint;
@Point.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnPoint;
@Point.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnPoint;
@RightClick.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnRightClick;
@RightClick.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnRightClick;
@RightClick.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnRightClick;
@CloseInventory.started -= m_Wrapper.m_MenusActionsCallbackInterface.OnCloseInventory;
@CloseInventory.performed -= m_Wrapper.m_MenusActionsCallbackInterface.OnCloseInventory;
@CloseInventory.canceled -= m_Wrapper.m_MenusActionsCallbackInterface.OnCloseInventory;
}
m_Wrapper.m_MenusActionsCallbackInterface = instance;
if (instance != null)
{
@MoveSelection.started += instance.OnMoveSelection;
@MoveSelection.performed += instance.OnMoveSelection;
@MoveSelection.canceled += instance.OnMoveSelection;
@Navigate.started += instance.OnNavigate;
@Navigate.performed += instance.OnNavigate;
@Navigate.canceled += instance.OnNavigate;
@Submit.started += instance.OnSubmit;
@Submit.performed += instance.OnSubmit;
@Submit.canceled += instance.OnSubmit;
@Confirm.started += instance.OnConfirm;
@Confirm.performed += instance.OnConfirm;
@Confirm.canceled += instance.OnConfirm;
@Cancel.started += instance.OnCancel;
@Cancel.performed += instance.OnCancel;
@Cancel.canceled += instance.OnCancel;
@MouseMove.started += instance.OnMouseMove;
@MouseMove.performed += instance.OnMouseMove;
@MouseMove.canceled += instance.OnMouseMove;
@Unpause.started += instance.OnUnpause;
@Unpause.performed += instance.OnUnpause;
@Unpause.canceled += instance.OnUnpause;
@ChangeTab.started += instance.OnChangeTab;
@ChangeTab.performed += instance.OnChangeTab;
@ChangeTab.canceled += instance.OnChangeTab;
@InventoryActionButton.started += instance.OnInventoryActionButton;
@InventoryActionButton.performed += instance.OnInventoryActionButton;
@InventoryActionButton.canceled += instance.OnInventoryActionButton;
@Click.started += instance.OnClick;
@Click.performed += instance.OnClick;
@Click.canceled += instance.OnClick;
@Point.started += instance.OnPoint;
@Point.performed += instance.OnPoint;
@Point.canceled += instance.OnPoint;
@RightClick.started += instance.OnRightClick;
@RightClick.performed += instance.OnRightClick;
@RightClick.canceled += instance.OnRightClick;
@CloseInventory.started += instance.OnCloseInventory;
@CloseInventory.performed += instance.OnCloseInventory;
@CloseInventory.canceled += instance.OnCloseInventory;
}
}
}
public MenusActions @Menus => new MenusActions(this);
// Dialogues
private readonly InputActionMap m_Dialogues;
private IDialoguesActions m_DialoguesActionsCallbackInterface;
private readonly InputAction m_Dialogues_MoveSelection;
private readonly InputAction m_Dialogues_AdvanceDialogue;
public struct DialoguesActions
{
private @GameInput m_Wrapper;
public DialoguesActions(@GameInput wrapper) { m_Wrapper = wrapper; }
public InputAction @MoveSelection => m_Wrapper.m_Dialogues_MoveSelection;
public InputAction @AdvanceDialogue => m_Wrapper.m_Dialogues_AdvanceDialogue;
public InputActionMap Get() { return m_Wrapper.m_Dialogues; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(DialoguesActions set) { return set.Get(); }
public void SetCallbacks(IDialoguesActions instance)
{
if (m_Wrapper.m_DialoguesActionsCallbackInterface != null)
{
@MoveSelection.started -= m_Wrapper.m_DialoguesActionsCallbackInterface.OnMoveSelection;
@MoveSelection.performed -= m_Wrapper.m_DialoguesActionsCallbackInterface.OnMoveSelection;
@MoveSelection.canceled -= m_Wrapper.m_DialoguesActionsCallbackInterface.OnMoveSelection;
@AdvanceDialogue.started -= m_Wrapper.m_DialoguesActionsCallbackInterface.OnAdvanceDialogue;
@AdvanceDialogue.performed -= m_Wrapper.m_DialoguesActionsCallbackInterface.OnAdvanceDialogue;
@AdvanceDialogue.canceled -= m_Wrapper.m_DialoguesActionsCallbackInterface.OnAdvanceDialogue;
}
m_Wrapper.m_DialoguesActionsCallbackInterface = instance;
if (instance != null)
{
@MoveSelection.started += instance.OnMoveSelection;
@MoveSelection.performed += instance.OnMoveSelection;
@MoveSelection.canceled += instance.OnMoveSelection;
@AdvanceDialogue.started += instance.OnAdvanceDialogue;
@AdvanceDialogue.performed += instance.OnAdvanceDialogue;
@AdvanceDialogue.canceled += instance.OnAdvanceDialogue;
}
}
}
public DialoguesActions @Dialogues => new DialoguesActions(this);
private int m_KeyboardOrGamepadSchemeIndex = -1;
public InputControlScheme KeyboardOrGamepadScheme
{
get
{
if (m_KeyboardOrGamepadSchemeIndex == -1) m_KeyboardOrGamepadSchemeIndex = asset.FindControlSchemeIndex("KeyboardOrGamepad");
return asset.controlSchemes[m_KeyboardOrGamepadSchemeIndex];
}
}
public interface IGameplayActions
{
void OnMove(InputAction.CallbackContext context);
void OnJump(InputAction.CallbackContext context);
void OnAttack(InputAction.CallbackContext context);
void OnInteract(InputAction.CallbackContext context);
void OnPause(InputAction.CallbackContext context);
void OnOpenInventory(InputAction.CallbackContext context);
void OnRotateCamera(InputAction.CallbackContext context);
void OnMouseControlCamera(InputAction.CallbackContext context);
void OnRun(InputAction.CallbackContext context);
}
public interface IMenusActions
{
void OnMoveSelection(InputAction.CallbackContext context);
void OnNavigate(InputAction.CallbackContext context);
void OnSubmit(InputAction.CallbackContext context);
void OnConfirm(InputAction.CallbackContext context);
void OnCancel(InputAction.CallbackContext context);
void OnMouseMove(InputAction.CallbackContext context);
void OnUnpause(InputAction.CallbackContext context);
void OnChangeTab(InputAction.CallbackContext context);
void OnInventoryActionButton(InputAction.CallbackContext context);
void OnClick(InputAction.CallbackContext context);
void OnPoint(InputAction.CallbackContext context);
void OnRightClick(InputAction.CallbackContext context);
void OnCloseInventory(InputAction.CallbackContext context);
}
public interface IDialoguesActions
{
void OnMoveSelection(InputAction.CallbackContext context);
void OnAdvanceDialogue(InputAction.CallbackContext context);
}
// Dialogues
private readonly InputActionMap m_Dialogues;
private IDialoguesActions m_DialoguesActionsCallbackInterface;
private readonly InputAction m_Dialogues_MoveSelection;
private readonly InputAction m_Dialogues_AdvanceDialogue;
public struct DialoguesActions
{
private @GameInput m_Wrapper;
public DialoguesActions(@GameInput wrapper) { m_Wrapper = wrapper; }
public InputAction @MoveSelection => m_Wrapper.m_Dialogues_MoveSelection;
public InputAction @AdvanceDialogue => m_Wrapper.m_Dialogues_AdvanceDialogue;
public InputActionMap Get() { return m_Wrapper.m_Dialogues; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(DialoguesActions set) { return set.Get(); }
public void SetCallbacks(IDialoguesActions instance)
{
if (m_Wrapper.m_DialoguesActionsCallbackInterface != null)
{
@MoveSelection.started -= m_Wrapper.m_DialoguesActionsCallbackInterface.OnMoveSelection;
@MoveSelection.performed -= m_Wrapper.m_DialoguesActionsCallbackInterface.OnMoveSelection;
@MoveSelection.canceled -= m_Wrapper.m_DialoguesActionsCallbackInterface.OnMoveSelection;
@AdvanceDialogue.started -= m_Wrapper.m_DialoguesActionsCallbackInterface.OnAdvanceDialogue;
@AdvanceDialogue.performed -= m_Wrapper.m_DialoguesActionsCallbackInterface.OnAdvanceDialogue;
@AdvanceDialogue.canceled -= m_Wrapper.m_DialoguesActionsCallbackInterface.OnAdvanceDialogue;
}
m_Wrapper.m_DialoguesActionsCallbackInterface = instance;
if (instance != null)
{
@MoveSelection.started += instance.OnMoveSelection;
@MoveSelection.performed += instance.OnMoveSelection;
@MoveSelection.canceled += instance.OnMoveSelection;
@AdvanceDialogue.started += instance.OnAdvanceDialogue;
@AdvanceDialogue.performed += instance.OnAdvanceDialogue;
@AdvanceDialogue.canceled += instance.OnAdvanceDialogue;
}
}
}
public DialoguesActions @Dialogues => new DialoguesActions(this);
private int m_KeyboardOrGamepadSchemeIndex = -1;
public InputControlScheme KeyboardOrGamepadScheme
{
get
{
if (m_KeyboardOrGamepadSchemeIndex == -1)
m_KeyboardOrGamepadSchemeIndex = asset.FindControlSchemeIndex("KeyboardOrGamepad");
return asset.controlSchemes[m_KeyboardOrGamepadSchemeIndex];
}
}
public interface IGameplayActions
{
void OnMove(InputAction.CallbackContext context);
void OnJump(InputAction.CallbackContext context);
void OnAttack(InputAction.CallbackContext context);
void OnInteract(InputAction.CallbackContext context);
void OnPause(InputAction.CallbackContext context);
void OnOpenInventory(InputAction.CallbackContext context);
void OnRotateCamera(InputAction.CallbackContext context);
void OnMouseControlCamera(InputAction.CallbackContext context);
void OnRun(InputAction.CallbackContext context);
}
public interface IMenusActions
{
void OnMoveSelection(InputAction.CallbackContext context);
void OnNavigate(InputAction.CallbackContext context);
void OnSubmit(InputAction.CallbackContext context);
void OnConfirm(InputAction.CallbackContext context);
void OnCancel(InputAction.CallbackContext context);
void OnMouseMove(InputAction.CallbackContext context);
void OnUnpause(InputAction.CallbackContext context);
void OnChangeTab(InputAction.CallbackContext context);
void OnInventoryActionButton(InputAction.CallbackContext context);
void OnClick(InputAction.CallbackContext context);
void OnPoint(InputAction.CallbackContext context);
void OnRightClick(InputAction.CallbackContext context);
void OnCloseInventory(InputAction.CallbackContext context);
}
public interface IDialoguesActions
{
void OnMoveSelection(InputAction.CallbackContext context);
void OnAdvanceDialogue(InputAction.CallbackContext context);
}
}

8
UOP1_Project/Assets/Scripts/Inventory/ScriptableObjects/InventorySO.cs


public bool[] IngredientsAvailability(List<ItemStack> ingredients)
{
if (ingredients == null)
return null;
return null;
bool[] availabilityArray = new bool[ingredients.Count];
for (int i = 0; i < ingredients.Count; i++)

}
public void Init()
{
if(_items == null)
if (_items == null)
_items = new List<ItemStack>();
_items = new List<ItemStack>();
_items.Add(item);
_items.Add(item);
}
}

2
UOP1_Project/Assets/Scripts/Inventory/ScriptableObjects/ItemSO.cs


public LocalizedString Description => _description;
public ItemTypeSO ItemType => _itemType;
public GameObject Prefab => _prefab;
public virtual List<ItemStack> IngredientsList { get;}
public virtual List<ItemStack> IngredientsList { get; }
public virtual ItemSO ResultingDish { get; }
public virtual bool IsLocalized { get; }

2
UOP1_Project/Assets/Scripts/Inventory/ScriptableObjects/LocalizedItemSO.cs


[SerializeField]
private bool _isLocalized = false;
private bool _isLocalized = false;
[SerializeField]
private LocalizedSprite _localizePreviewImage = default;

2
UOP1_Project/Assets/Scripts/Menu/MultiInputButton.cs


{
if (_menuSelectionHandler == null)
_menuSelectionHandler = transform.root.gameObject.GetComponentInChildren<MenuSelectionHandler>();
_menuSelectionHandler.UpdateSelection(gameObject);
}

263
UOP1_Project/Assets/Scripts/Quests/Editor/QuestEditorWindow.cs


}
public class QuestEditorWindow : EditorWindow
{
private StepSO _currentSelectedStep=default;
private QuestSO _currentSeletedQuest=default;
private QuestlineSO _currentSelectedQuestLine=default;
private StepSO _currentSelectedStep = default;
private QuestSO _currentSeletedQuest = default;
private QuestlineSO _currentSelectedQuestLine = default;
private int _idQuestlineSelected = default;
private int _idQuestSelected = default;
private int _idStepSelected = default;

{
QuestEditorWindow wnd = GetWindow<QuestEditorWindow>();
wnd.titleContent = new GUIContent("QuestEditorWindow");
// Sets a minimum size to the window.
wnd.titleContent = new GUIContent("QuestEditorWindow");
// Sets a minimum size to the window.
{
// Opens the window, otherwise focuses it if it’s already open.
QuestEditorWindow window = GetWindow<QuestEditorWindow>();
// Adds a title to the window.
window.titleContent = new GUIContent("QuestEditorWindow");
// Sets a minimum size to the window.
window.minSize = new Vector2(250, 250);
//window.SetTool();
{
// Opens the window, otherwise focuses it if it’s already open.
QuestEditorWindow window = GetWindow<QuestEditorWindow>();
// Adds a title to the window.
window.titleContent = new GUIContent("QuestEditorWindow");
// Sets a minimum size to the window.
window.minSize = new Vector2(250, 250);
//window.SetTool();
VisualElement root = rootVisualElement;
// Import UXML
VisualElement root = rootVisualElement;
// Import UXML
root.Add(visualTree.CloneTree());
//Import USS
root.Add(visualTree.CloneTree());
//Import USS
root.styleSheets.Add(styleSheet);
//Register button event
root.styleSheets.Add(styleSheet);
//Register button event
Button refreshQuestPreviewBtn = root.Q<Button>("refresh-preview-btn");
refreshQuestPreviewBtn.RegisterCallback<ClickEvent>((evt) => SetUpQuestPreview(_currentSeletedQuest));

if (createQuestButton != null)
{
createQuestButton.SetEnabled(true);
removeQuestButton.SetEnabled(true);
removeQuestButton.SetEnabled(true);
}
if (createStepButton != null)
{

listElements.Add("dialogue-info-scroll");
break;
break;
}
foreach (string elementName in listElements)
{

private void LoadAllQuestsData()
{
//Load all questlines
{
//Load all questlines
FindAllSOByType(out QuestlineSO[] questLineSOs);
RefreshListView(out ListView allQuestlinesListView, "questlines-list", questLineSOs);
ClearElements(selectionType.Questline);

_idStepSelected = allStepsListView.selectedIndex;
_currentSelectedStep = GetDataFromListViewItem<StepSO>(stepEnumerable);
DisplayAllProperties(_currentSelectedStep, "step-info-scroll");
ClearElements(selectionType.Step);
//Find all DialogueDataSOs in the same folder of the StepSO
ClearElements(selectionType.Step);
//Find all DialogueDataSOs in the same folder of the StepSO
FindAllDialogueInStep(_currentSelectedStep, out DialogueDataSO[] dialogueDataSOs);
if (dialogueDataSOs != null)
{

dialoguesListView.onSelectionChange += (dialogueEnumerable) =>
{
{
SetAddDialogueButtonsForStep(out VisualElement ButtonsPanel);
//DialogueList.Q<VisualElement>("buttons-panel").Clear();
DialogueList.Add(ButtonsPanel);
SetAddDialogueButtonsForStep(out VisualElement ButtonsPanel);
//DialogueList.Q<VisualElement>("buttons-panel").Clear();
DialogueList.Add(ButtonsPanel);
};
}

}
private void OnDisable()
{
AssetDatabase.SaveAssets();
AssetDatabase.SaveAssets();
}
private T GetDataFromListViewItem<T>(IEnumerable<object> enumberable) where T : ScriptableObject
{

AllDialogue = null;
List<DialogueDataSO> AllDialogueList = new List<DialogueDataSO>();
if (step != null)
{
{
if (step.DialogueBeforeStep != null)
{

}
}
}
}
private void AddDialogueBeforeStep()
{

int questId = 0;
questId = _currentSeletedQuest.IdQuest;
int stepId = 0;
stepId = _currentSeletedQuest.Steps.FindIndex(o=>o==_currentSelectedStep)+1;
stepId = _currentSeletedQuest.Steps.FindIndex(o => o == _currentSelectedStep) + 1;
_currentSelectedStep.DialogueBeforeStep=asset;
_currentSelectedStep.DialogueBeforeStep = asset;
asset.CreateLine();
asset.CreateLine();
rootVisualElement.Q<VisualElement>("steps-list").Q<ListView>().SetSelection(_idStepSelected);
}
private void AddCompletionDialogue()

int questId = 0;
questId = _currentSeletedQuest.IdQuest;
int stepId = 0;
stepId = _currentSeletedQuest.Steps.FindIndex(o => o == _currentSelectedStep)+1;
stepId = _currentSeletedQuest.Steps.FindIndex(o => o == _currentSelectedStep) + 1;
AssetDatabase.CreateAsset(asset, "Assets/ScriptableObjects/Quests/Questline" + questlineId + "/Quest" + questId + "/Step" + stepId + "/CD-S" + stepId + "-Q" + questId + "-QL" + questlineId + ".asset");
_currentSelectedStep.CompleteDialogue = asset;
asset.DialogueType = DialogueType.winDialogue;

AssetDatabase.SaveAssets();
AssetDatabase.SaveAssets();
rootVisualElement.Q<VisualElement>("steps-list").Q<ListView>().SetSelection(_idStepSelected);
}
private void AddIncompletionDialogue()

int questId = 0;
questId = _currentSeletedQuest.IdQuest;
int stepId = 0;
stepId = _currentSeletedQuest.Steps.FindIndex(o => o == _currentSelectedStep)+1;
stepId = _currentSeletedQuest.Steps.FindIndex(o => o == _currentSelectedStep) + 1;
AssetDatabase.CreateAsset(asset, "Assets/ScriptableObjects/Quests/Questline" + questlineId + "/Quest" + questId + "/Step" + stepId + "/ID-S" + stepId + "-Q" + questId + "-QL" + questlineId + ".asset");
asset.DialogueType = DialogueType.loseDialogue;

}
private void LoadAndInitStepUXML(StepSO step)
{
//Clear actor conversations area
ScrollView actorConversationsVE = rootVisualElement.Q<ScrollView>("actor-conversations");
// Import UXML
{
//Clear actor conversations area
ScrollView actorConversationsVE = rootVisualElement.Q<ScrollView>("actor-conversations");
// Import UXML
VisualElement dialogueAreaVE = stepVE.Q<VisualElement>("dialogue-area");
//Title
if(step!=null)
stepVE.Q<Label>("step-title-label").text = "Step" + step.name[1];
//IsDone
VisualElement dialogueAreaVE = stepVE.Q<VisualElement>("dialogue-area");
//Title
if (step != null)
stepVE.Q<Label>("step-title-label").text = "Step" + step.name[1];
//IsDone
DialogueDataSO dialogueToPreview = default;
DialogueDataSO dialogueToPreview = default;
{
//setPreview Actor for each step
{
//setPreview Actor for each step
Image actorPreview = LoadActorImage(step.Actor.name);
//Add Image
Image actorPreview = LoadActorImage(step.Actor.name);
//Add Image
}
//Type (Check Item etc)
}
//Type (Check Item etc)
if (step.Type == StepType.Dialogue)
{
VisualElement itemValidateVE = stepVE.Q<VisualElement>("item-validate");

}
private void LoadAndInitOptionsDialogueLineUXML(DialogueDataSO completeDialogue, DialogueDataSO incompleteDialogue, VisualElement parent)
{
// Import UXML
{
// Import UXML
VisualElement dialogueVE = dialogueVisualTree.CloneTree();
// Set line
VisualElement dialogueVE = dialogueVisualTree.CloneTree();
// Set line
Label leftLineLabel = dialogueVE.Q<Label>("left-line-label");
Label rightLineLabel = dialogueVE.Q<Label>("right-line-label");

rightLineLabel.text = incompleteDialogue.DialogueLines[0].GetLocalizedStringImmediateSafe();
// hide options
rightLineLabel.text = incompleteDialogue.DialogueLines[0].GetLocalizedStringImmediateSafe();
// hide options
VisualElement buttonArea = dialogueVE.Q<VisualElement>("buttons");
buttonArea.style.display = DisplayStyle.None;

var nameProperty = itemsSource[i].GetType().GetProperty("name");
if (nameProperty != null)
{
if(itemsSource[i]!=null)
(element as Label).text = nameProperty.GetValue(itemsSource[i]) as string;
if (itemsSource[i] != null)
(element as Label).text = nameProperty.GetValue(itemsSource[i]) as string;
}
};
listview.itemsSource = itemsSource;

}
private void DisplayAllProperties(Object data, string visualElementName)
{
//Clear panel
{
//Clear panel
parentVE.Clear();
//Add new scrollview
parentVE.Clear();
//Add new scrollview
ScrollView scrollView = new ScrollView();
SerializedObject dataObject = new SerializedObject(data);

parentVE.Add(scrollView);
}
void AddQuestline()
{
//get questline id
{
//get questline id
FindAllSOByType(out QuestlineSO[] questLineSOs);
int id = questLineSOs.Length;
id++;

AssetDatabase.CreateFolder("Assets/ScriptableObjects/Quests", "Questline" + id);
AssetDatabase.CreateAsset(asset, "Assets/ScriptableObjects/Quests/Questline" + id + "/QL" + id + ".asset");
EditorUtility.SetDirty(asset);
AssetDatabase.SaveAssets();
//refresh
AssetDatabase.SaveAssets();
//refresh
LoadAllQuestsData();
}
void RemoveQuestline()

{
QuestSO quest = _currentSelectedQuestLine.Quests[0];
RemoveQuest(quest);
_currentSelectedQuestLine.Quests.RemoveAt(0);
_currentSelectedQuestLine.Quests.RemoveAt(0);
AssetDatabase.DeleteAsset(_currentSelectedQuestLine.GetPath());
//refresh List
AssetDatabase.DeleteAsset(_currentSelectedQuestLine.GetPath());
//refresh List
LoadAllQuestsData();

int questlineId = 0;
questlineId = _currentSelectedQuestLine.IdQuestline;
int questId = 0;
questId = _currentSelectedQuestLine.Quests.Count + 1;
if (!AssetDatabase.IsValidFolder("Assets/ScriptableObjects/Quests/Questline" + questlineId + "/Quest" + questId ))
questId = _currentSelectedQuestLine.Quests.Count + 1;
if (!AssetDatabase.IsValidFolder("Assets/ScriptableObjects/Quests/Questline" + questlineId + "/Quest" + questId))
AssetDatabase.CreateFolder("Assets/ScriptableObjects/Quests/Questline" + questlineId, "Quest" + questId);
AssetDatabase.CreateAsset(asset, "Assets/ScriptableObjects/Quests/Questline" + questlineId + "/Quest" + questId + "/Q" + questId + "-QL" + questlineId + ".asset");
asset.SetQuestId(questId);

AssetDatabase.SaveAssets();
//refresh
AssetDatabase.SaveAssets();
//refresh
rootVisualElement.Q<VisualElement>("questlines-list").Q<ListView>().SetSelection(_idQuestlineSelected);
}

return;
//When removing a step, remove its references in the parent quest
return;
//When removing a step, remove its references in the parent quest
_currentSelectedQuestLine.Quests.Remove(_currentSelectedQuestLine.Quests.Find(o => o == _currentSeletedQuest));
//when removing a step remove its dialogues
while(_currentSeletedQuest.Steps.Count>0)
{
StepSO step = _currentSeletedQuest.Steps[0];
_currentSelectedQuestLine.Quests.Remove(_currentSelectedQuestLine.Quests.Find(o => o == _currentSeletedQuest));
//when removing a step remove its dialogues
while (_currentSeletedQuest.Steps.Count > 0)
{
StepSO step = _currentSeletedQuest.Steps[0];
_idQuestSelected = -1;
//refresh List
_idQuestSelected = -1;
//refresh List
rootVisualElement.Q<VisualElement>("questlines-list").Q<ListView>().SetSelection(_idQuestlineSelected);
}

return;
//when removing a step remove its dialogues
return;
//when removing a step remove its dialogues
{
//When removing a step, remove its references in the parent quest
{
//When removing a step, remove its references in the parent quest
RemoveStep(step);
}

questId = _currentSeletedQuest.IdQuest;
int stepId = 0;
stepId = _currentSeletedQuest.Steps.Count + 1;
if (!AssetDatabase.IsValidFolder("Assets/ScriptableObjects/Quests/Questline" + questlineId + "/Quest" + questId+"/Step" + stepId))
AssetDatabase.CreateFolder("Assets/ScriptableObjects/Quests/Questline" + questlineId + "/Quest" + questId, "Step" + stepId);
if (!AssetDatabase.IsValidFolder("Assets/ScriptableObjects/Quests/Questline" + questlineId + "/Quest" + questId + "/Step" + stepId))
AssetDatabase.CreateFolder("Assets/ScriptableObjects/Quests/Questline" + questlineId + "/Quest" + questId, "Step" + stepId);
AssetDatabase.SaveAssets();
//refresh
AssetDatabase.SaveAssets();
//refresh
rootVisualElement.Q<VisualElement>("quests-list").Q<ListView>().SetSelection(_idQuestSelected);

if (_currentSelectedStep == null)
return;
//When removing a step, remove its references in the parent quest
return;
//When removing a step, remove its references in the parent quest
_currentSeletedQuest.Steps.Remove(_currentSeletedQuest.Steps.Find(o => o == _currentSelectedStep));
//when removing a step remove its dialogues
if (_currentSelectedStep.DialogueBeforeStep!=null)
_currentSeletedQuest.Steps.Remove(_currentSeletedQuest.Steps.Find(o => o == _currentSelectedStep));
//when removing a step remove its dialogues
if (_currentSelectedStep.DialogueBeforeStep != null)
RemoveDialogue(_currentSelectedStep.DialogueBeforeStep);
RemoveDialogue(_currentSelectedStep.DialogueBeforeStep);
}
if (_currentSelectedStep.CompleteDialogue != null)
{

RemoveDialogue(_currentSelectedStep.IncompleteDialogue);
}
AssetDatabase.DeleteAsset(_currentSelectedStep.GetPath());
_idStepSelected = -1;
//refresh List
_idStepSelected = -1;
//refresh List
return;
//when removing a step remove its dialogues
return;
//when removing a step remove its dialogues
stepToRemove.DialogueBeforeStep = null;
stepToRemove.DialogueBeforeStep = null;
}
if (stepToRemove.CompleteDialogue != null)
{

}
AssetDatabase.DeleteAsset(stepToRemove.GetPath());
}
void RemoveDialogue( DialogueDataSO dialogueToRemove) {
dialogueToRemove.RemoveLineFromSharedTable();
void RemoveDialogue(DialogueDataSO dialogueToRemove)
{
dialogueToRemove.RemoveLineFromSharedTable();
AssetDatabase.DeleteAsset(dialogueToRemove.GetPath());
}

6
UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestSO.cs


get => _isDone;
set => _isDone = value;
}
public VoidEventChannelSO EndQuestEvent => _endQuestEvent;
public VoidEventChannelSO EndQuestEvent => _endQuestEvent;
if(_endQuestEvent != null)
if (_endQuestEvent != null)
_endQuestEvent.RaiseEvent();
_endQuestEvent.RaiseEvent();
}
}

4
UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/QuestlineSO.cs


}
public void FinishQuestline()
{
if(_endQuestlineEvent!=null)
{ _endQuestlineEvent.RaiseEvent(); }
if (_endQuestlineEvent != null)
{ _endQuestlineEvent.RaiseEvent(); }
_isDone = true;
}
public void SetQuestlineId(int id)

13
UOP1_Project/Assets/Scripts/Quests/ScriptableObjects/StepSO.cs


bool _isDone = false;
[SerializeField]
VoidEventChannelSO _endStepEvent = default;
public DialogueDataSO DialogueBeforeStep {
public DialogueDataSO DialogueBeforeStep
{
get { return _dialogueBeforeStep; }
set { _dialogueBeforeStep = value; }
}

}
public ItemSO Item => _item;
public VoidEventChannelSO EndStepEvent => _endStepEvent;
public VoidEventChannelSO EndStepEvent => _endStepEvent;
public StepType Type => _type;
public bool IsDone
{

public void FinishStep()
{
if(_endStepEvent!=null)
_endStepEvent.RaiseEvent();
if (_endStepEvent != null)
_endStepEvent.RaiseEvent();
public DialogueDataSO StepToDialogue()
{
DialogueDataSO dialogueData = new DialogueDataSO();

{
dialogueData = new DialogueDataSO(DialogueBeforeStep);
dialogueData = new DialogueDataSO(DialogueBeforeStep);
if (DialogueBeforeStep.Choices != null)
{
if (CompleteDialogue != null)

4
UOP1_Project/Assets/Scripts/SaveSystem/FileManager.cs


public static bool LoadFromFile(string fileName, out string result)
{
var fullPath = Path.Combine(Application.persistentDataPath, fileName);
if(!File.Exists(fullPath))
if (!File.Exists(fullPath))
File.WriteAllText(fullPath, "");
File.WriteAllText(fullPath, "");
}
try
{

22
UOP1_Project/Assets/Scripts/SaveSystem/SaveSystem.cs


public class SaveSystem : ScriptableObject
{
[SerializeField] private LoadEventChannelSO _loadLocation = default;
[SerializeField] private InventorySO _playerInventory=default;
[SerializeField] private InventorySO _playerInventory = default;
private QuestManagerSO _questManagerSO = default;
public string saveFilename = "save.chop";
private QuestManagerSO _questManagerSO = default;
public string saveFilename = "save.chop";
public string backupSaveFilename = "save.chop.bak";
public Save saveData = new Save();

public IEnumerator LoadSavedInventory()
{
_playerInventory.Items.Clear();
_playerInventory.Items.Clear();
foreach (var serializedItemStack in saveData._itemStacks)
{
var loadItemOperationHandle = Addressables.LoadAssetAsync<ItemSO>(serializedItemStack.itemGuid);

}
public void LoadSavedQuestlineStatus()
{
_questManagerSO.SetFinishedQuestlineItemsFromSave(saveData._finishedQuestlineItemsGUIds);
_questManagerSO.SetFinishedQuestlineItemsFromSave(saveData._finishedQuestlineItemsGUIds);
}
public void SaveDataToDisk()

{
saveData._itemStacks.Add(new SerializedItemStack(itemStack.Item.Guid, itemStack.Amount));
saveData._itemStacks.Add(new SerializedItemStack(itemStack.Item.Guid, itemStack.Amount));
saveData._finishedQuestlineItemsGUIds.Add(item);
saveData._finishedQuestlineItemsGUIds.Add(item);
}
if (FileManager.MoveFile(saveFilename, backupSaveFilename))

public void WriteEmptySaveFile()
{
FileManager.WriteToFile(saveFilename, "");
_playerInventory.Init();
_playerInventory.Init();
SaveDataToDisk();
SaveDataToDisk();
}
}

2
UOP1_Project/Assets/Scripts/SceneManagement/LocationEntrance.cs


private void Awake()
{
if(_pathStorage.lastPathTaken == _entrancePath)
if (_pathStorage.lastPathTaken == _entrancePath)
{
entranceShot.Priority = 100;
_onSceneReady.OnEventRaised += PlanTransition;

6
UOP1_Project/Assets/Scripts/SceneManagement/StartGame.cs


void StartNewGame()
{
_hasSaveData = false;
_saveSystem. WriteEmptySaveFile();
_saveSystem.WriteEmptySaveFile();
_saveSystem.SetNewGameData();
//Start new game
_startGameEvent.RaiseEvent(_locationsToLoad, _showLoadScreen);

IEnumerator LoadSaveGame()
{
yield return StartCoroutine(_saveSystem.LoadSavedInventory());
_saveSystem.LoadSavedQuestlineStatus();
_saveSystem.LoadSavedQuestlineStatus();
var locationGuid = _saveSystem.saveData._locationId;
var asyncOperationHandle = Addressables.LoadAssetAsync<LocationSO>(locationGuid);
yield return asyncOperationHandle;

2
UOP1_Project/Assets/Scripts/UI/Dialogue/UIDialogueManager.cs


[SerializeField] private UIDialogueChoicesManager _choicesManager = default;
[SerializeField] private DialogueChoicesChannelSO _showChoicesEvent = default;
private void OnEnable ()
private void OnEnable()
{
_showChoicesEvent.OnEventRaised += ShowChoices;

2
UOP1_Project/Assets/Scripts/UI/Inventory/UIInventoryInspector.cs


_inspectorDescription.FillDescription(itemToInspect);
if (isForCooking && availabilityArray!= null)
if (isForCooking && availabilityArray != null)
{
_recipeIngredients.FillIngredients(itemToInspect.IngredientsList, availabilityArray);
_recipeIngredients.gameObject.SetActive(true);

10
UOP1_Project/Assets/Scripts/UI/Settings/UIPaginationFiller.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.UI;
[SerializeField] private Image _imagePaginationPrefab= default;
[SerializeField] private Image _imagePaginationPrefab = default;
[SerializeField] private Transform _parentPagination = default;
[SerializeField] private Sprite _emptyPagination = default;

if (i >= _instantiatedImages.Count)
{
Image instantiatedImage = Instantiate(_imagePaginationPrefab, _parentPagination);
_instantiatedImages.Add(instantiatedImage);
_instantiatedImages.Add(instantiatedImage);
}
if (i < paginationCount)

}
}
SetCurrentPagination(selectedPaginationIndex);
}
}
}
public void SetCurrentPagination(int selectedPaginationIndex)

}
}
else
Debug.LogError("Error in pagination number");
Debug.LogError("Error in pagination number");
}
}

51
UOP1_Project/Assets/Scripts/UI/Settings/UISettingFieldsFiller.cs


[SerializeField]
private UISettingItemFiller[] _settingfieldsList = default;
[SerializeField]
private InputReader _inputReader = default;
private InputReader _inputReader = default;
if(i < settingItems.Count)
if (i < settingItems.Count)
{
SetField(settingItems[i], _settingfieldsList[i]);
_settingfieldsList[i].gameObject.SetActive(true);

}
}
int paginationCount=0;
int selectedPaginationIndex=0;
string selectedOption=default;
LocalizedString fieldTitle=field.title;
SettingFieldType fieldType= field.settingFieldType;
switch (field.settingFieldType)
int paginationCount = 0;
int selectedPaginationIndex = 0;
string selectedOption = default;
LocalizedString fieldTitle = field.title;
SettingFieldType fieldType = field.settingFieldType;
switch (field.settingFieldType)
selectedOption = LocalizationSettings.SelectedLocale.LocaleName;
selectedOption = LocalizationSettings.SelectedLocale.LocaleName;
break;
case SettingFieldType.AntiAliasing:

selectedOption = "Off";
break;
case SettingFieldType.GraphicQuality:
selectedPaginationIndex = QualitySettings.GetQualityLevel();
selectedPaginationIndex = QualitySettings.GetQualityLevel();
selectedOption = QualitySettings.names[QualitySettings.GetQualityLevel()];
selectedOption = QualitySettings.names[QualitySettings.GetQualityLevel()];
break;
case SettingFieldType.Resolution:

break;
case SettingFieldType.Volume_Music:
case SettingFieldType.Volume_SFx:
paginationCount = 10;
selectedPaginationIndex = 5;
selectedOption = "5";
break;
paginationCount = 10;
selectedPaginationIndex = 5;
selectedOption = "5";
break;
uiField.FillSettingField(paginationCount, selectedPaginationIndex, selectedOption, fieldTitle, fieldType);
uiField.FillSettingField(paginationCount, selectedPaginationIndex, selectedOption, fieldTitle, fieldType);
string title = "";
string title = "";
case (int) QualityLevel.Beautiful:
title = QualityLevel.Beautiful.ToString();
case (int)QualityLevel.Beautiful:
title = QualityLevel.Beautiful.ToString();
break;
case (int)QualityLevel.Fantastic:
title = QualityLevel.Fantastic.ToString();

}
int IsFullscreen()
{
if(Screen.fullScreen)
if (Screen.fullScreen)
return 0;
}else
return 0;
}
else
return 1;
return 1;
}
}

16
UOP1_Project/Assets/Scripts/UI/Settings/UISettingItemFiller.cs


using UnityEngine.UI;
using TMPro;
using UnityEngine.Localization.Components;
using UnityEngine.Localization;
using UnityEngine.Localization;
using UnityEngine.Events;
public class UISettingItemFiller : MonoBehaviour

[SerializeField] private Sprite _bgSelected = default;
[SerializeField] private Sprite _bgUnselected = default;
private SettingFieldType _fieldType = default;
private SettingFieldType _fieldType = default;
_fieldType = fieldType;
_fieldType = fieldType;
_title.StringReference= fieldTitle;
_title.StringReference = fieldTitle;
}
public void FillSettingNewOption(int selectedPaginationIndex, string selectedOption)
{

public void NextOption()
{
_nextOption.Invoke();
_nextOption.Invoke();
_previousOption.Invoke();
_previousOption.Invoke();
}

20
UOP1_Project/Assets/Scripts/UI/Settings/UISettingTabFiller.cs


using UnityEngine;
using UnityEngine.Localization.Components;
using UnityEngine.UI;
using TMPro;
public class UISettingTabFiller : MonoBehaviour
using TMPro;
public class UISettingTabFiller : MonoBehaviour
{
[SerializeField] private LocalizeStringEvent _localizedTabTitle;
[SerializeField] private Image _bgSelectedTab;

SettingTabType _currentTabType;
SettingTabType _currentTabType;
_currentTabType = settingTab.settingTabsType;
_currentTabType = settingTab.settingTabsType;
{ SelectTab(); }
{ SelectTab(); }
{ UnselectTab(); }
{ UnselectTab(); }
}
public void SetTab(SettingTabType tabType)
{

else
{ UnselectTab(); }
}
void SelectTab()
void SelectTab()
_bgSelectedTab.enabled=true;
_bgSelectedTab.enabled = true;
void UnselectTab()
void UnselectTab()
_localizedTabTitle.GetComponent<TextMeshProUGUI>().color = _colorUnselectedTab;
_localizedTabTitle.GetComponent<TextMeshProUGUI>().color = _colorUnselectedTab;
}
}

6
UOP1_Project/Assets/Scripts/UI/Settings/UISettingTabsFiller.cs


public class UISettingTabsFiller : MonoBehaviour
{
[SerializeField]
private UISettingTabFiller [] _settingTabsList = default;
public void FillTabs(List<SettingTab> settingTabs)
[SerializeField]
private UISettingTabFiller[] _settingTabsList = default;
public void FillTabs(List<SettingTab> settingTabs)
{
for (int i = 0; i < settingTabs.Count; i++)
{

正在加载...
取消
保存