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


C# Photo.getActivityOwnerInfo方法代码示例

本文整理汇总了C#中Photo.getActivityOwnerInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Photo.getActivityOwnerInfo方法的具体用法?C# Photo.getActivityOwnerInfo怎么用?C# Photo.getActivityOwnerInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Photo的用法示例。


在下文中一共展示了Photo.getActivityOwnerInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: producePhotoRender

    public GameObject producePhotoRender(string para_photoGObjStringName,
												   Photo para_photoDetails,
	                                     		   float para_maxFontCharSize,
	                               				   Vector3 para_photoSpawnPt,
					                               float para_photoWidth,
					                               float para_photoHeight,
					                               Vector3 para_photoRotAngles)
    {
        // Extract Details.
        int areaTypeID = para_photoDetails.getPhotoAreaTypeID();
        int areaBackgroundID = para_photoDetails.getPhotoAreaBackgroundID();
        PhotoCharacterElement questGiverInfo = para_photoDetails.getQuestGiverInfo();
        PhotoCharacterElement activityOwnerInfo = para_photoDetails.getActivityOwnerInfo();
        PlayerAvatarSettings playerAvSettings = para_photoDetails.getPlayerAvatarInfo();
        string boardText = para_photoDetails.getBoardText();

        // Select and create photo backbone.
        string areaTypeIDString = ""+areaTypeID;
        string areaBackgroundIDString = ""+areaBackgroundID;
        if((areaTypeID < 0)||(areaTypeID > 8))
        {
            areaTypeIDString = "W";
        }

        if(areaBackgroundID < 0)
        {
            areaBackgroundIDString = "0";
        }

        string pathToPhotoGuide = "Prefabs/PhotoBackbones/Area_"+areaTypeIDString+"/Area"+areaTypeIDString+"_Setup"+areaBackgroundIDString;
        Transform reqPhotoBackbone = Resources.Load<Transform>(pathToPhotoGuide);

        if(reqPhotoBackbone == null)
        {
            // Do something if photo guide not found.
            return  null;
        }
        else
        {
            Rect worldSpawnBounds = new Rect(para_photoSpawnPt.x - (para_photoWidth/2f),
                                             para_photoSpawnPt.y + (para_photoHeight/2f),
                                             para_photoWidth,
                                             para_photoHeight);

            GameObject guideBackground = reqPhotoBackbone.FindChild("PhotoBackground").gameObject;
            float nwXScale = worldSpawnBounds.width / guideBackground.renderer.bounds.size.x;
            float nwYScale = worldSpawnBounds.height / guideBackground.renderer.bounds.size.y;

            //GameObject nwPhotoBackbone = WorldSpawnHelper.initObjWithinWorldBounds(reqPhotoBackbone,para_photoGObjStringName,worldSpawnBounds,para_photoSpawnPt.z,new bool[]{false,true,false});
            GameObject nwPhotoBackbone = ((Transform) MonoBehaviour.Instantiate(reqPhotoBackbone,para_photoSpawnPt,Quaternion.identity)).gameObject;
            nwPhotoBackbone.name = para_photoGObjStringName;

            // Find,replace and setup characters in the photo.

            Transform questGiverGuide = nwPhotoBackbone.transform.FindChild("QuestGiver");
            Transform activityOwnerGuide = nwPhotoBackbone.transform.FindChild("ActivityOwner");
            Transform playerAvatarGuide = nwPhotoBackbone.transform.FindChild("PlayerAvatar");
            Transform noticeBoardTAGuide = nwPhotoBackbone.transform.FindChild("PhotoNoticeBoard").FindChild("BoardTextArea");
            questGiverGuide.parent = null;
            activityOwnerGuide.parent = null;
            playerAvatarGuide.parent = null;
            noticeBoardTAGuide.parent = null;
            questGiverGuide.name += "Guide";
            activityOwnerGuide.name += "Guide";
            playerAvatarGuide.name += "Guide";

            //GhostbookManagerLight gbMang = GhostbookManagerLight.getInstance();

            int questGiverID = questGiverInfo.getCharacterID();
            int activityOwnerID = activityOwnerInfo.getCharacterID();

            Transform questGiverPrefab;
            if(questGiverID < 9)
            {
                string artNumber = "0"+(questGiverID+1);
                questGiverPrefab = Resources.Load<Transform>("Prefabs/AvatarsBigVersions/Big_PCs/Big_PC"+artNumber);
            }
            else
            {
                int tmpArtNum = ((questGiverID - 9)+1);
                string artNumber = ""+tmpArtNum;
                if(tmpArtNum < 10) { artNumber = "0" + artNumber; }
                questGiverPrefab = Resources.Load<Transform>("Prefabs/AvatarsBigVersions/Big_SCs/Big_SC"+artNumber);
            }

            Transform activityOwnerPrefab = null;
            if(questGiverID != activityOwnerID)
            {
                string artNumber = "0"+(activityOwnerID+1);
                activityOwnerPrefab = Resources.Load<Transform>("Prefabs/AvatarsBigVersions/Big_PCs/Big_PC"+artNumber);
            }

            Transform playerAvatarBasePrefab = Resources.Load<Transform>("Prefabs/AvatarsBigVersions/Big_AVs/Big_AV01"); //Resources.Load<Transform>("Prefabs/Avatars/MainAvatar01");
            Transform wordBoxPrefab = Resources.Load<Transform>("Prefabs/GenericWordBox");

            // Render player avatar in photo.
            Transform nwPlayerAvObj = (Transform) MonoBehaviour.Instantiate(playerAvatarBasePrefab,playerAvatarGuide.position,Quaternion.identity);
            nwPlayerAvObj.name = "PlayerAvatar";

            MonoBehaviour.DestroyImmediate(nwPlayerAvObj.GetComponent<Animator>());
//.........这里部分代码省略.........
开发者ID:TAPeri,项目名称:WordsMatter,代码行数:101,代码来源:PhotoVisualiser.cs


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