本文整理汇总了C#中Point2.GetY方法的典型用法代码示例。如果您正苦于以下问题:C# Point2.GetY方法的具体用法?C# Point2.GetY怎么用?C# Point2.GetY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point2
的用法示例。
在下文中一共展示了Point2.GetY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
// Update is called once per frame
protected void Update()
{
#if (UNITY_IPHONE || UNITY_ANDROID) && !UNITY_EDITOR
_touches = Input.touches;
#endif
if (_gui.GetCurrentMode () == PoolDesignerMode.PolygonEdition)
{
_cursor = _planTransformation.GetTransformedMousePosition ();
// on cherche le point et l'edge qui sont sous le curseur
FindIntersectedPoint ();
FindIntersectedEdge ();
//#if (UNITY_IPHONE || UNITY_ANDROID) && !UNITY_EDITOR
// if(Input.touchCount == 1)
// {
// _firstTouch = _planTransformation.GetTouches()[0];
// Touch testouch = _touches[0];
//
// if (!_gui.isOnUI () && _firstTouch.phase == TouchPhase.Began)
// {
// Debug.Log("---------> firstTouch "+_firstTouch.deltaTime+", "+_firstTouch.position+", "+_firstTouch.deltaPosition+", "+_firstTouch.phase);
// Debug.Log("---------> testTouch "+testouch.deltaTime+", "+testouch.position+", "+testouch.deltaPosition+", "+testouch.phase);
//#else
//if UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_EDITOR
if (!_gui.isOnUI () && _planTransformation.GetClickBegan()/*PC.In.Click1Down()*/ && !_gui.IsOpen())
{
//#endif
if(_gui.IsJustCloseMenu())
{
_gui.setIsJustCloseMenu(false);
return;
}
if (_selectedPointIndexCandidate >= 0) // selection
{
_selectedPointIndex = _selectedPointIndexCandidate;
_selectedPoint = _polygon.GetPoints ()[_selectedPointIndex];
if (!_polygon.IsClosed () && _selectedPointIndex == 0 /*&& _polygon.GetPoints ().Count > 2*/)
{
_polygon.Close ();
_selectedPointIndex = _polygon.GetPoints ().IndexOf (_selectedPoint);
}
_canMove = true;
}
else if (_selectedEdgeIndexCandidate >= 0) // insert point
{
_selectedEdgeIndex = _selectedEdgeIndexCandidate;
_selectedEdge = _polygon.GetEdges ()[_selectedEdgeIndex];
Point2 newPoint = new Point2 (_cursor);
newPoint.Set(newPoint.GetX()-_offsetWidth, newPoint.GetY()-_offsetHeight);
_polygon.InsertPoint (_selectedEdgeIndex, newPoint);
_selectedPointIndex = _polygon.GetPoints ().IndexOf (newPoint);
_selectedPoint = newPoint;
_canMove = true;
}
else if (!_polygon.IsClosed ()) // add point
{
Point2 newPoint = new Point2 (_cursor);
newPoint.Set(newPoint.GetX()-_offsetWidth, newPoint.GetY()-_offsetHeight);
_polygon.AddPoint (newPoint);
_selectedPointIndex = _polygon.GetPoints ().Count - 1;
_selectedPoint = newPoint;
_canMove = true;
}
else // deselection
{
_selectedPointIndex = -1;
_selectedPoint = null;
_selectedEdgeIndex = -1;
_selectedEdge = null;
}
if (_selectedPointIndex >= 0) // update radius slider values
{
_pointOffset = (Vector2)_selectedPoint - _cursor;
if (_selectedPoint.GetJunction () == JunctionType.Broken)
{
_gui.SetSliderValues (0, 1);
}
else if (_selectedPoint.GetJunction () == JunctionType.Curved)
{
ArchedPoint2 ar = _selectedPoint as ArchedPoint2;
_gui.SetSliderValues (ar.GetMeasuredRadius () / 100, ar.GetMaxRadius () / 100);
}
}
}
//#if (UNITY_IPHONE || UNITY_ANDROID) && !UNITY_EDITOR
// }
//.........这里部分代码省略.........