File size: 697 Bytes
ac55997
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using Photon.Deterministic;
using System;

namespace Quantum
{
	[BotSDKHidden]
	[System.Serializable]
	public unsafe partial class ResponseCurve : AIFunctionFP
	{
		public AIParamFP Input;

		[BotSDKHidden]
		public FPAnimationCurve Curve;

		public override void Loaded(IResourceManager resourceManager, Native.Allocator allocator)
		{
			base.Loaded(resourceManager, allocator);
		}

		public override FP Execute(Frame frame, EntityRef entity = default)
		{
			if (Input.FunctionRef == default) return 0;

			FP input = Input.ResolveFunction(frame, entity);
			FP result = Curve.Evaluate(input);

			if (result > 1) result = 1;
			else if (result < 0) result = 0;

			return result;
		}
	}
}