本文整理汇总了C#中Sphere.StopDirection方法的典型用法代码示例。如果您正苦于以下问题:C# Sphere.StopDirection方法的具体用法?C# Sphere.StopDirection怎么用?C# Sphere.StopDirection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sphere
的用法示例。
在下文中一共展示了Sphere.StopDirection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetupControllerButtons
public void SetupControllerButtons(Sphere sphere)
{
// Right
EventTrigger trigger = _rightController.gameObject.GetComponent<EventTrigger>();
EventTrigger.Entry entry = new EventTrigger.Entry { eventID = EventTriggerType.PointerDown };
entry.callback.AddListener((eventData) => { sphere.MoveDirection(Move.Right); });
trigger.triggers.Clear();
trigger.triggers.Add(entry);
entry = new EventTrigger.Entry { eventID = EventTriggerType.PointerUp };
entry.callback.AddListener((eventData) => { sphere.StopDirection(Move.Right); });
trigger.triggers.Add(entry);
// Down
trigger = _downController.gameObject.GetComponent<EventTrigger>();
entry = new EventTrigger.Entry { eventID = EventTriggerType.PointerDown };
entry.callback.AddListener((eventData) => { sphere.MoveDirection(Move.Down); });
trigger.triggers.Clear();
trigger.triggers.Add(entry);
entry = new EventTrigger.Entry { eventID = EventTriggerType.PointerUp };
entry.callback.AddListener((eventData) => { sphere.StopDirection(Move.Down); });
trigger.triggers.Add(entry);
// Left
trigger = _leftController.gameObject.GetComponent<EventTrigger>();
entry = new EventTrigger.Entry { eventID = EventTriggerType.PointerDown };
entry.callback.AddListener((eventData) => { sphere.MoveDirection(Move.Left); });
trigger.triggers.Clear();
trigger.triggers.Add(entry);
entry = new EventTrigger.Entry { eventID = EventTriggerType.PointerUp };
entry.callback.AddListener((eventData) => { sphere.StopDirection(Move.Left); });
trigger.triggers.Add(entry);
// Up
trigger = _upController.gameObject.GetComponent<EventTrigger>();
entry = new EventTrigger.Entry { eventID = EventTriggerType.PointerDown };
entry.callback.AddListener((eventData) => { sphere.MoveDirection(Move.Up); });
trigger.triggers.Clear();
trigger.triggers.Add(entry);
entry = new EventTrigger.Entry { eventID = EventTriggerType.PointerUp };
entry.callback.AddListener((eventData) => { sphere.StopDirection(Move.Up); });
trigger.triggers.Add(entry);
}