do not loop generation of monitors in creator.
This commit is contained in:
@@ -15,7 +15,6 @@ public class GazePointAnalyzer : MonoBehaviour
|
||||
{
|
||||
get { return GetWorldPositionFromCoord((int)averageCoord_.x, (int)averageCoord_.y); }
|
||||
}
|
||||
|
||||
private Vector2 preCursorCoord_ = Vector2.zero;
|
||||
|
||||
[Header("Filters")]
|
||||
@@ -118,8 +117,6 @@ public class GazePointAnalyzer : MonoBehaviour
|
||||
filter = noEventFilter;
|
||||
}
|
||||
|
||||
preCursorCoord_ = cursorCoord;
|
||||
|
||||
var cf = (filter / ((1f / 60) / Time.deltaTime));
|
||||
var vf = (velocityFilter / ((1f / 60) / Time.deltaTime));
|
||||
var targetCoord = averageCoord_ + (coord - averageCoord_) * cf;
|
||||
@@ -127,11 +124,13 @@ public class GazePointAnalyzer : MonoBehaviour
|
||||
|
||||
if (float.IsNaN(targetCoord.x) || float.IsNaN(targetCoord.y)) return;
|
||||
if (float.IsNaN(targetVelocity.x) || float.IsNaN(targetVelocity.y)) return;
|
||||
|
||||
|
||||
averageCoordVelocity_ += (targetVelocity - averageCoordVelocity_) * vf;
|
||||
averageCoord_ += averageCoordVelocity_;
|
||||
averageCoord_.x = Mathf.Clamp(averageCoord_.x, 0, monitor.width);
|
||||
averageCoord_.y = Mathf.Clamp(averageCoord_.y, 0, monitor.height);
|
||||
|
||||
preCursorCoord_ = cursorCoord;
|
||||
}
|
||||
|
||||
void Update()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Assertions;
|
||||
using System.Collections.Generic;
|
||||
using MeshForwardDirection = uDesktopDuplication.Texture.MeshForwardDirection;
|
||||
|
||||
@@ -110,7 +111,7 @@ public class MultipleMonitorCreator : MonoBehaviour
|
||||
ResetRemoveTimer();
|
||||
|
||||
// Create monitors
|
||||
for (int i = 0; i < uDesktopDuplication.Manager.monitorCount; ++i) {
|
||||
for (int i = 0; i < uDesktopDuplication.Manager.monitors.Count; ++i) {
|
||||
// Create monitor obeject
|
||||
var go = Instantiate(monitorPrefab);
|
||||
go.name = "Monitor " + i;
|
||||
|
||||
Reference in New Issue
Block a user