本文整理汇总了C#中System.Line.GetComponent方法的典型用法代码示例。如果您正苦于以下问题:C# Line.GetComponent方法的具体用法?C# Line.GetComponent怎么用?C# Line.GetComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Line
的用法示例。
在下文中一共展示了Line.GetComponent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CurveHandle
/// <summary>
/// </summary>
/// <param name="buttonTemplate"> </param>
/// <param name="lineTemplate"> </param>
/// <param name="pos"> </param>
/// <param name="prevComponent"> </param>
/// <param name="nextComponent"> </param>
public CurveHandle(ButtonGenerator buttonTemplate, LineGenerator lineTemplate, Vector2 pos, Vector2 prevComponent, Vector2 nextComponent)
{
buttonTemplate = new ButtonGenerator("HullEditorHandle.json");
buttonTemplate.Identifier = (int) HandleType.Center;
buttonTemplate.X = pos.X;
buttonTemplate.Y = pos.Y;
_centerButton = buttonTemplate.GenerateButton();
_centerButton.GetComponent<DraggableComponent>().DragMovementDispatcher += TranslateToLinks;
_centerButton.GetComponent<DraggableComponent>().DragMovementClamp += ClampHandleMovement;
buttonTemplate.Identifier = (int) HandleType.Prev;
buttonTemplate.X = prevComponent.X + pos.X;
buttonTemplate.Y = prevComponent.Y + pos.Y;
_prevButton = buttonTemplate.GenerateButton();
_prevButton.GetComponent<DraggableComponent>().DragMovementDispatcher += TranslateToLinks;
_prevButton.GetComponent<DraggableComponent>().DragMovementClamp += ClampHandleMovement;
buttonTemplate.Identifier = (int) HandleType.Next;
buttonTemplate.X = nextComponent.X + pos.X;
buttonTemplate.Y = nextComponent.Y + pos.Y;
_nextButton = buttonTemplate.GenerateButton();
_nextButton.GetComponent<DraggableComponent>().DragMovementDispatcher += TranslateToLinks;
_nextButton.GetComponent<DraggableComponent>().DragMovementClamp += ClampHandleMovement;
_prevLine = lineTemplate.GenerateLine();
_nextLine = lineTemplate.GenerateLine();
_prevLine.OriginPoint = _centerButton.CentPosition;
_prevLine.DestPoint = _prevButton.CentPosition;
_nextLine.OriginPoint = _centerButton.CentPosition;
_nextLine.DestPoint = _nextButton.CentPosition;
_nextButton.GetComponent<FadeComponent>().ForceFadeout();
_prevButton.GetComponent<FadeComponent>().ForceFadeout();
_centerButton.GetComponent<FadeComponent>().ForceFadeout();
_prevLine.GetComponent<FadeComponent>().ForceFadeout();
_nextLine.GetComponent<FadeComponent>().ForceFadeout();
_nextButton.GetComponent<FadeComponent>().ForceFadeout();
_prevButton.GetComponent<FadeComponent>().ForceFadeout();
_centerButton.GetComponent<FadeComponent>().ForceFadeout();
_prevLine.GetComponent<FadeComponent>().ForceFadeout();
_nextLine.GetComponent<FadeComponent>().ForceFadeout();
InterlinkButtonEvents();
}