示例#1
0
    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));
    }
示例#2
0
    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));
    }
示例#3
0
 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);
 }
示例#5
0
 public override bool isDifferent(SyncableType other)
 {
     removeOld();
     return(triggerIndecies.Count > 0);
 }
示例#6
0
 public virtual SyncableType interp(SyncableType b, float percent)
 {
     return(this);
 }
示例#7
0
 // Server side:
 public abstract bool isDifferent(SyncableType other);