Upload project files

This commit is contained in:
Misaki
2024-09-16 00:08:10 +09:00
commit 0a4745662a
218 changed files with 13387 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
using System;
using Unity.Mathematics;
using UnityEngine;
namespace Misaki.ArtTool
{
public abstract class FieldBase : MonoBehaviour
{
public RemappingSetting remappingSetting = new();
public EventHandler propertyChanged;
public virtual void Initialize()
{
}
public abstract float Operate(float3 position);
protected float Remapping(float weight)
{
if (!remappingSetting.enable)
{
return weight;
}
weight = math.saturate(weight / (1.0f - remappingSetting.innerOffset));
weight = math.lerp(remappingSetting.min, remappingSetting.max, weight);
weight = remappingSetting.invert ? 1.0f - weight : weight;
weight *= remappingSetting.strength;
return weight;
}
private void Update()
{
if (transform.hasChanged)
{
propertyChanged.Invoke(this, null);
transform.hasChanged = false;
}
}
}
}