本文整理汇总了C#中Transform.BroadcastMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Transform.BroadcastMessage方法的具体用法?C# Transform.BroadcastMessage怎么用?C# Transform.BroadcastMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transform
的用法示例。
在下文中一共展示了Transform.BroadcastMessage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendSignal
public static void SendSignal(Transform recipient, string messageWhenTriggered, string messageArgument)
{
if(string.IsNullOrEmpty(messageArgument))
{
recipient.BroadcastMessage(messageWhenTriggered, messageArgument);
}
else
{
recipient.BroadcastMessage(messageWhenTriggered);
}
}
示例2: InitializeInstance
private void InitializeInstance (Transform instance)
{
if (_parentInstances) {
instance.parent = transform;
}
instance.gameObject.SetActive (true);
instance.BroadcastMessage ("OnPoolCreate", this, SendMessageOptions.DontRequireReceiver);
}
示例3: Despawn
// Despawn effect or audio and send OnDespawned message
public void Despawn(Transform obj)
{
obj.BroadcastMessage("OnDespawned", SendMessageOptions.DontRequireReceiver);
obj.gameObject.SetActive(false);
}
示例4: touchDown
void touchDown(Transform touchTarget, Vector3 touchPosition)
{
if (!touchTarget) return;
lastTouchDownPos = touchPosition;
touchTarget.BroadcastMessage("touchDown", new TouchDownEvent(touchTarget, touchPosition), SendMessageOptions.DontRequireReceiver);
}
示例5: touchUp
public void touchUp(Transform touchTarget, Transform startTarget, Vector2 touchPosition, Vector2 touchDirection, float touchTime)
{
if (!startTarget) return;
startTarget.BroadcastMessage("touchUp", new TouchUpEvent(touchTarget, startTarget, touchPosition, touchDirection, touchTime), SendMessageOptions.DontRequireReceiver);
}
示例6: touchDrag
public void touchDrag(Vector2 touchDelta, Vector2 touchDistance, Vector2 touchPosition, Transform touchTarget, Transform startTarget)
{
if (!startTarget) return;
startTarget.BroadcastMessage("drag", new TouchDragEvent(touchDelta, touchDistance, touchPosition, touchTarget, startTarget), SendMessageOptions.DontRequireReceiver);
}
示例7: tap
public void tap(Transform touchTarget, Vector2 touchPosition)
{
if (!touchTarget) return;
touchTarget.BroadcastMessage("tap", new TapEvent(touchTarget, touchPosition), SendMessageOptions.DontRequireReceiver);
}
示例8: ReleaseInstance
public void ReleaseInstance(Transform instance)
{
instance.BroadcastMessage("OnPoolRelease", this, SendMessageOptions.DontRequireReceiver);
instance.gameObject.SetActive(false);
_instances.Push(instance);
}