本文整理汇总了C#中MObject.UpdateObject方法的典型用法代码示例。如果您正苦于以下问题:C# MObject.UpdateObject方法的具体用法?C# MObject.UpdateObject怎么用?C# MObject.UpdateObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MObject
的用法示例。
在下文中一共展示了MObject.UpdateObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransformObjAccordActor
private void TransformObjAccordActor(MObject obj, MActor actor)
{
Transform actorTrans = actor.transform;
//get the position of the actor within the world
Vector2 actorVpPos = WorldToMap(actorTrans.position);
//and it's map coordinates
Vector2 objCoord = actorVpPos - currentCenterCoord;
//if mask either doesn't exist or exists and the actor is in the visible area of the mask
//also cut out actors outside of visible area of the view
float xPos = (actorVpPos.x + rTrans.rect.width / 2 - currentCenterCoord.x) / rTrans.rect.width;
float yPos = (actorVpPos.y + rTrans.rect.height / 2 - currentCenterCoord.y) / rTrans.rect.height;
bool isVisible = false;
if (xPos <= 1.0f && xPos >= 0.0f && yPos <= 1.0f && yPos >= 0.0f)
isVisible = IsWithinMaskTex(new Vector2(xPos, yPos));
obj.UpdateObject(orientation, objCoord, actorTrans.forward, isVisible, currentCenterCoord, mObjectDefaultSize, CalculateZoomScaleRatio(), isScalingMObjects, isZoomingSmoothly, smoothZoomSpeed);
}
示例2: TransformObjAccordActor
private void TransformObjAccordActor(MObject obj, MActor actor)
{
Transform actorTrans = actor.transform;
//object's map coordinates
Vector2 actorCoord = WorldToMap(actorTrans.position);
Vector2 objCoord = actorCoord - currentCenterCoord;
//calculate the position within the mask and check if it is within the mask
Rect locRect = rTrans.rect;
float xPos = (actorCoord.x + locRect.width / 2 - currentCenterCoord.x) / locRect.width;
float yPos = (actorCoord.y + locRect.height / 2 - currentCenterCoord.y) / locRect.height;
bool isVisible = false;
if (xPos <= 1.0f && xPos >= 0.0f && yPos <= 1.0f && yPos >= 0.0f)
isVisible = IsWithinMaskTex(new Vector2(xPos, yPos));
obj.UpdateObject(orientation, objCoord, actorTrans.forward, isVisible, currentCenterCoord, mObjectDefaultSize, CalculateZoomScaleRatio(), isScalingMObjects, isZoomingSmoothly, smoothZoomSpeed);
}