54 lines
1.0 KiB
C#
Raw Normal View History

2026-05-07 10:14:44 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace Wing.Gizmos
{
public class SnapBase : ISnap
{
protected bool mEnable = false;
protected float mPrecision = 0;
protected float mTolerance = 0;
public bool Enable
{
get
{
return mEnable;
}
set
{
mEnable = value;
}
}
public float Precision
{
get
{
return mPrecision;
}
set
{
mPrecision = value;
CalcTolerance();
}
}
protected virtual void CalcTolerance()
{
mTolerance = Precision * 0.2f;
}
public virtual bool Snap(Vector3 inVal, ref Vector3 outVal, bool force = false)
{
outVal = Vector3.zero;
return false;
}
}
}