本文整理汇总了C#中BaseObject.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# BaseObject.SendMessage方法的具体用法?C# BaseObject.SendMessage怎么用?C# BaseObject.SendMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseObject
的用法示例。
在下文中一共展示了BaseObject.SendMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryToLiftObject
//
// Returns true if any object was lifted or thrown. Return false otherwise.
//
bool TryToLiftObject()
{
//
// Trata de levantar un objeto...
//
if ( liftedObject == null )
{
if ( liftSensor != null && liftSensor.sensedObject != null && liftSensor.sensedObject.isLiftable )
{
Transform lifted = liftSensor.sensedObject.transform;
lifted.parent = transform;
// Pone el objeto en la cabeza del flaco.
iTween.MoveTo( lifted.gameObject, iTween.Hash ( "isLocal", true, "position", new Vector3(0,0.6f,0), "time", 0.2f, "easetype", iTween.EaseType.easeOutCirc ) );
// To keep track.
liftedObject = lifted.gameObject.GetComponent<BaseObject>();
// Lo desactiva.
liftedObject.gravityEnabled = false;
liftedObject.collisionEnabled = false;
liftedObject.SendMessage ("OnLifted", gameObject, SendMessageOptions.DontRequireReceiver);
liftSensor.gameObject.SetActive( false );
return true;
}
}
else
{
liftedObject.velocity += (direction * 0.02f) + (velocity * 1.0f);
liftedObject.gravity.y -= 0.025f;
liftedObject.transform.parent = worldOwner.transform;
liftedObject.gravityEnabled = true;
liftedObject.collisionEnabled = true;
objectToIgnore = liftedObject;
objectToIgnoreTimer = 0.3f;
ResetLiftSensor();
return true;
}
return false;
}