30 lines
726 B
C#
30 lines
726 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using NUnit.Framework;
|
|
using UnityEngine;
|
|
using UnityEngine.TestTools;
|
|
namespace BITKit
|
|
{
|
|
public class ProcessorTester
|
|
{
|
|
[Test]
|
|
public void Test()
|
|
{
|
|
Processor processor = new();
|
|
processor.AddProcessor<int>("GetDamage", ReduceDamage);
|
|
|
|
var damage = processor.GetContext<int>("GetDamage", 64);
|
|
|
|
Debug.Log(damage);
|
|
processor.RemoveProcessor<int>("GetDamage", ReduceDamage);
|
|
|
|
damage = processor.GetContext<int>("GetDamage", 64);
|
|
Debug.Log(damage);
|
|
}
|
|
int ReduceDamage(int damage)
|
|
{
|
|
return damage / 2;
|
|
}
|
|
}
|
|
}
|