コード例 #1
0
    protected void CalculateTimes(RaycastHit hit, out Vector3 transformedPoint, out float realTime, out float roundedTime, out float roundedCurrent, out float offsetTime)
    {
        Transform hitTransform = hit.transform;

        transformedPoint = interfaceGridParent.InverseTransformPoint(hit.point);
        transformedPoint = new Vector3(transformedPoint.x * hitTransform.lossyScale.x,
                                       transformedPoint.y, transformedPoint.z * hitTransform.lossyScale.z);
        realTime       = (transformedPoint.z / (EditorScaleController.EditorScale * (hitTransform.parent.localScale.z / 10f))) + atsc.CurrentBeat;
        roundedTime    = atsc.FindRoundedBeatTime(realTime) + atsc.offsetBeat;
        roundedCurrent = atsc.FindRoundedBeatTime(atsc.CurrentBeat);
        offsetTime     = hit.collider.gameObject.name.Contains("Interface") ? 0 : atsc.CurrentBeat - roundedCurrent;
        if (!atsc.IsPlaying)
        {
            roundedTime += offsetTime;
        }
    }
コード例 #2
0
    protected void CalculateTimes(RaycastHit hit, out Vector3 roundedHit, out float roundedTime)
    {
        float currentBeat = isDraggingObjectAtTime ? draggedObjectData._time : atsc.CurrentBeat;

        roundedHit = parentTrack.InverseTransformPoint(hit.point);
        float realTime = roundedHit.z / EditorScaleController.EditorScale;

        if (hit.transform.parent.name.Contains("Interface"))
        {
            realTime = parentTrack.InverseTransformPoint(hit.transform.parent.position).z / EditorScaleController.EditorScale;
        }

        float roundedCurrent = atsc.FindRoundedBeatTime(currentBeat);
        float offsetTime     = currentBeat - roundedCurrent;

        roundedTime = atsc.FindRoundedBeatTime(realTime - offsetTime) + atsc.offsetBeat;

        if (!atsc.IsPlaying)
        {
            roundedTime += offsetTime;
        }
    }