public override SyncableType interp(SyncableType b, float percent) { float newInterpValue; int rotA = value; int rotB = ((YRotation)b).value; if (Math.Abs(rotA - rotB) < 128) { newInterpValue = Mathf.Lerp(rotA, rotB, percent); } else { if (rotB > rotA) { rotB -= 256; } else { rotA -= 256; } newInterpValue = Mathf.Lerp(rotA, rotB, percent); if (newInterpValue < 0) { newInterpValue += 256; } } return(new YRotation(newInterpValue * 360f / 256)); }
public override SyncableType interp(SyncableType b, float percent) { int rotA = value; int rotB = ((UpDownRotation)b).value; float newInterpValue = getInterpValueFromByte(Mathf.Lerp(rotA, rotB, percent)); return(new UpDownRotation(newInterpValue)); }
public override bool isDifferent(SyncableType other) { return(value != ((YRotation)other).value); }
public override bool isDifferent(SyncableType other) { Debug.LogError("This should never be called! DamageNumber -> isDifferent()"); return(false); }
public override bool isDifferent(SyncableType other) { removeOld(); return(triggerIndecies.Count > 0); }
public virtual SyncableType interp(SyncableType b, float percent) { return(this); }
// Server side: public abstract bool isDifferent(SyncableType other);