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


C# Photo.getPlayerAvatarPoseID方法代码示例

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


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

示例1: producePhotoRender


//.........这里部分代码省略.........
            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>());
            Animator nwPlayerAni = nwPlayerAvObj.gameObject.AddComponent<Animator>();
            nwPlayerAni.runtimeAnimatorController = Resources.Load<RuntimeAnimatorController>("Prefabs/Animation/Poses/AVBigController");

            ClothingApplicator cApp = nwPlayerAvObj.gameObject.AddComponent<ClothingApplicator>();
            cApp.setSubject(nwPlayerAvObj.gameObject,nwPlayerAni.runtimeAnimatorController);
            cApp.applyClothingConfig(playerAvSettings.getClothingSettings(),ClothingSize.BIG);
            MonoBehaviour.Destroy(cApp);

            nwPlayerAvObj.localScale = playerAvatarGuide.transform.localScale;

            nwPlayerAvObj.GetComponent<Animator>().Play("AVPhotoPose_"+para_photoDetails.getPlayerAvatarPoseID());
            nwPlayerAvObj.parent = nwPhotoBackbone.transform;

            // Render quest giver in photo.
            Transform nwQuestGiverObj = (Transform) MonoBehaviour.Instantiate(questGiverPrefab,questGiverGuide.position,Quaternion.identity);
            nwQuestGiverObj.name = "QuestGiver";
            nwQuestGiverObj.GetComponent<Animator>().Play("SCPhotoPose_"+questGiverInfo.getPoseID());
            nwQuestGiverObj.localScale = questGiverGuide.transform.localScale;
            nwQuestGiverObj.parent = nwPhotoBackbone.transform;

            // Render activity owner in photo.
            Transform nwActivityOwnerObj = null;
            if(activityOwnerPrefab != null)
            {
                nwActivityOwnerObj = (Transform) MonoBehaviour.Instantiate(activityOwnerPrefab,activityOwnerGuide.position,Quaternion.identity);
                nwActivityOwnerObj.name = "ActivityOwner";
                nwActivityOwnerObj.GetComponent<Animator>().Play("SCPhotoPose_"+activityOwnerInfo.getPoseID());
                nwActivityOwnerObj.localScale = activityOwnerGuide.localScale;
                nwActivityOwnerObj.parent = nwPhotoBackbone.transform;
            }

            // Render board text.
            GameObject nwBoardTextObj = WordBuilderHelper.buildWordBox(99,boardText,CommonUnityUtils.get2DBounds(noticeBoardTAGuide.renderer.bounds),noticeBoardTAGuide.transform.position.z,new bool[]{false,true,false},wordBoxPrefab);
            nwBoardTextObj.name = "PhotoBoardText";
            WordBuilderHelper.setBoxesToUniformTextSize(new List<GameObject>() {nwBoardTextObj},para_maxFontCharSize);
            MonoBehaviour.Destroy(nwBoardTextObj.transform.FindChild("Board").gameObject);
            nwBoardTextObj.transform.FindChild("Text").renderer.sortingOrder = 200;
            nwBoardTextObj.transform.parent = nwPhotoBackbone.transform;

            // Apply rotation.
            nwPhotoBackbone.transform.eulerAngles = new Vector3(para_photoRotAngles.x,para_photoRotAngles.y,para_photoRotAngles.z);

            // Apply scale.
            nwPhotoBackbone.transform.localScale = new Vector3(nwXScale,nwYScale,1);

            // Set speed of all animators to 0.
            if(nwQuestGiverObj.GetComponent<Animator>() != null) { nwQuestGiverObj.GetComponent<Animator>().speed = 0; }
            if(nwPlayerAvObj.GetComponent<Animator>() != null) { nwPlayerAvObj.GetComponent<Animator>().speed = 0; }
            if((nwActivityOwnerObj != null)&&(nwActivityOwnerObj.GetComponent<Animator>() != null)) { nwActivityOwnerObj.GetComponent<Animator>().speed = 0; }

            // TMP - Remove This Later - Remove any shadow child objects.
            if(nwQuestGiverObj != null) { removeShadowObjects(nwQuestGiverObj.gameObject); }
            if(nwActivityOwnerObj != null) { removeShadowObjects(nwActivityOwnerObj.gameObject); }
            //if(nwPlayerAvObj != null) { removeShadowObjects(nwPlayerAvObj); }

            // TMP - Remove This Later - Update all character rend order so that they appear in front of everything.
            CommonUnityUtils.setSortingOrderOfEntireObject(nwQuestGiverObj.gameObject,502);
            if(nwActivityOwnerObj != null)
            {
                CommonUnityUtils.setSortingOrderOfEntireObject(nwActivityOwnerObj.gameObject,502);
            }
            CommonUnityUtils.setSortingOrderOfEntireObject(nwPlayerAvObj.gameObject,502);

            // Destroy guides.
            MonoBehaviour.Destroy(questGiverGuide.gameObject);
            MonoBehaviour.Destroy(activityOwnerGuide.gameObject);
            MonoBehaviour.Destroy(playerAvatarGuide.gameObject);
            MonoBehaviour.Destroy(noticeBoardTAGuide.gameObject);

            return nwPhotoBackbone;
        }
    }
开发者ID:TAPeri,项目名称:WordsMatter,代码行数:101,代码来源:PhotoVisualiser.cs


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