当前位置: 首页>>代码示例>>C#>>正文


C# MObject.UpdateObject方法代码示例

本文整理汇总了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);
    }
开发者ID:SoulfulSolutions,项目名称:The_Last_Ranger,代码行数:20,代码来源:MViewRT.cs

示例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);
    }
开发者ID:SoulfulSolutions,项目名称:The_Last_Ranger,代码行数:18,代码来源:MViewRaster.cs


注:本文中的MObject.UpdateObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。