Initial commit

This commit is contained in:
Mausham Neupane
2026-01-05 00:11:51 +05:45
commit 05ee499ce3
2015 changed files with 835249 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
using Darkmatter.Core;
using UnityEngine;
namespace Darkmatter.Domain
{
public abstract class State<T> : IState
{
protected readonly T runner;
protected State(T runner)
{
this.runner = runner;
}
public virtual void Enter() { }
public virtual void Exit() { }
public virtual void Update() { }
public virtual void LateUpdate() { }
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 8e1f935f13391ea4b8a18a2c680cdcf9

View File

@@ -0,0 +1,27 @@
using Darkmatter.Core;
using UnityEngine;
namespace Darkmatter.Domain
{
public abstract class StateMachine
{
public IState CurrentState { get; private set; }
public void ChangeState(IState state)
{
CurrentState?.Exit();
CurrentState = state;
CurrentState?.Enter();
}
public void Update()
{
CurrentState.Update();
}
public void LateUpdate()
{
CurrentState.LateUpdate();
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: cda261417aa4df34eb86c2271ab5f6d5