rename members named pointer to cursor.
This commit is contained in:
@@ -33,8 +33,8 @@ public class Cursor : MonoBehaviour
|
|||||||
|
|
||||||
void UpdatePosition()
|
void UpdatePosition()
|
||||||
{
|
{
|
||||||
var x = (1f * monitor.pointerX / monitor.width - 0.5f) * modelScale.x;
|
var x = (1f * monitor.cursorX / monitor.width - 0.5f) * modelScale.x;
|
||||||
var y = (1f * monitor.pointerY / monitor.height - 0.5f) * modelScale.y;
|
var y = (1f * monitor.cursorY / monitor.height - 0.5f) * modelScale.y;
|
||||||
var iy = uddTexture_.invertY ? -1 : +1;
|
var iy = uddTexture_.invertY ? -1 : +1;
|
||||||
var localPos = transform.right * x + iy * transform.up * y;
|
var localPos = transform.right * x + iy * transform.up * y;
|
||||||
worldPosition = transform.TransformPoint(localPos);
|
worldPosition = transform.TransformPoint(localPos);
|
||||||
@@ -42,8 +42,8 @@ public class Cursor : MonoBehaviour
|
|||||||
|
|
||||||
void UpdateTexture()
|
void UpdateTexture()
|
||||||
{
|
{
|
||||||
var w = monitor.pointerShapeWidth;
|
var w = monitor.cursorShapeWidth;
|
||||||
var h = monitor.pointerShapeHeight;
|
var h = monitor.cursorShapeHeight;
|
||||||
if (w == 0 || h == 0) return;
|
if (w == 0 || h == 0) return;
|
||||||
|
|
||||||
var scale = new Vector2(w, h);
|
var scale = new Vector2(w, h);
|
||||||
@@ -53,17 +53,17 @@ public class Cursor : MonoBehaviour
|
|||||||
textures_.Add(scale, texture);
|
textures_.Add(scale, texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
var pointerTexture = textures_[scale];
|
var cursorTexture = textures_[scale];
|
||||||
monitor.UpdateCursorTexture(pointerTexture.GetNativeTexturePtr());
|
monitor.UpdateCursorTexture(cursorTexture.GetNativeTexturePtr());
|
||||||
uddTexture_.material.SetTexture("_CursorTex", pointerTexture);
|
uddTexture_.material.SetTexture("_CursorTex", cursorTexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateMaterial()
|
void UpdateMaterial()
|
||||||
{
|
{
|
||||||
var x = (float)monitor.pointerX / monitor.width;
|
var x = (float)monitor.cursorX / monitor.width;
|
||||||
var y = (float)monitor.pointerY / monitor.height;
|
var y = (float)monitor.cursorY / monitor.height;
|
||||||
var w = (float)monitor.pointerShapeWidth / monitor.width;
|
var w = (float)monitor.cursorShapeWidth / monitor.width;
|
||||||
var h = (float)monitor.pointerShapeHeight / monitor.height;
|
var h = (float)monitor.cursorShapeHeight / monitor.height;
|
||||||
uddTexture_.material.SetVector("_CursorPositionScale", new Vector4(x, y, w, h));
|
uddTexture_.material.SetVector("_CursorPositionScale", new Vector4(x, y, w, h));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,27 +86,27 @@ public class Monitor
|
|||||||
get { return Lib.IsCursorVisible(id); }
|
get { return Lib.IsCursorVisible(id); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int pointerX
|
public int cursorX
|
||||||
{
|
{
|
||||||
get { return Lib.GetCursorX(id); }
|
get { return Lib.GetCursorX(id); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int pointerY
|
public int cursorY
|
||||||
{
|
{
|
||||||
get { return Lib.GetCursorY(id); }
|
get { return Lib.GetCursorY(id); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int pointerShapeWidth
|
public int cursorShapeWidth
|
||||||
{
|
{
|
||||||
get { return Lib.GetCursorShapeWidth(id); }
|
get { return Lib.GetCursorShapeWidth(id); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int pointerShapeHeight
|
public int cursorShapeHeight
|
||||||
{
|
{
|
||||||
get { return Lib.GetCursorShapeHeight(id); }
|
get { return Lib.GetCursorShapeHeight(id); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public CursorShapeType pointerShapeType
|
public CursorShapeType cursorShapeType
|
||||||
{
|
{
|
||||||
get { return Lib.GetCursorShapeType(id); }
|
get { return Lib.GetCursorShapeType(id); }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user