Initial commit

This commit is contained in:
Mausham
2025-12-26 17:56:05 -08:00
commit 7cb0a26dae
453 changed files with 53483 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
%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: 94786f68f321b5249b0997193bb0036b, type: 3}
m_Name: InputReaderSO
m_EditorClassIdentifier: CoreAssembly::Darkmatter.Core.InputReaderSO

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0805b8520c4573a4e99ea101253c2c9f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,57 @@
using System;
using UnityEngine;
using UnityEngine.InputSystem;
namespace Darkmatter.Core
{
[CreateAssetMenu(fileName = "InputReaderSO", menuName = "Scriptable Objects/InputReaderSO")]
public class InputReaderSO : ScriptableObject, IInputReader, GameInputAction.IPlayerActions
{
public GameInputAction action;
public event Action OnJumpPerformed;
public bool isShooting { get; private set; }
public Vector2 moveInput { get; private set; }
public Vector2 lookInput { get; private set; }
private void OnEnable()
{
if (action == null)
{
action = new GameInputAction();
}
action.Enable();
action.Player.SetCallbacks(this);
}
private void OnDisable()
{
action.Player.Disable();
}
public void OnMove(InputAction.CallbackContext context)
{
moveInput = context.ReadValue<Vector2>();
}
public void OnLook(InputAction.CallbackContext context)
{
lookInput = context.ReadValue<Vector2>();
}
public void OnJump(InputAction.CallbackContext context)
{
if(context.performed)
{
OnJumpPerformed?.Invoke();
}
}
public void OnShoot(InputAction.CallbackContext context)
{
isShooting = context.ReadValueAsButton();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 94786f68f321b5249b0997193bb0036b