本文整理汇总了C#中PlayerCharacter.GetTransformData方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerCharacter.GetTransformData方法的具体用法?C# PlayerCharacter.GetTransformData怎么用?C# PlayerCharacter.GetTransformData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerCharacter
的用法示例。
在下文中一共展示了PlayerCharacter.GetTransformData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResumeScene
virtual protected void ResumeScene()
{
CheckSceneStageConfig();
PlayerManager.Instance.CreatePlayerChar();
m_PlayerChar = PlayerManager.Instance.GetPlayerInstance();
TerrainManager.Instance.InitializeTerrain(m_CurrentStage.StageMapId, AppManager.Instance.m_bIsShowTerrainTrigger);
m_PlayerChar.GetTransformData().SetPosition(WorldSceneDispatchController.Instance.GetParam().m_PlayerTransform.pos);
m_PlayerChar.GetTransformData().SetRotation(WorldSceneDispatchController.Instance.GetParam().m_PlayerTransform.rot);
//set npc player
foreach(var elem in WorldSceneDispatchController.Instance.GetParam().m_NpcTransformList)
{
int id = elem.Key;
Npc npc = null;
if(TerrainManager.Instance.GetNpcList().TryGetValue(id,out npc))
{
if(null != npc)
{
npc.GetTransformData().SetPosition(elem.Value.pos);
npc.GetTransformData().SetRotation(elem.Value.rot);
}
}
}
RegisterMsg();
//Setup MainCam
GlobalScripts.Instance.Initialize();
GlobalScripts.Instance.mGameCamera.SetTarget(((CharTransformData)(m_PlayerChar.GetTransformData())).GetGameObject().transform);
//FingureGeture
GestureManager.Instance.Initialize();
GestureManager.Instance.EnableMoveChar();
if(WorldSceneDispatchController.Instance.GetParam().m_ActionId != -1)
{
//trigger to play action
MessageDispatcher.Instance.BroadcastMessage(new MessageObject(ClientCustomMessageDefine.C_PLAY_ACTION, WorldSceneDispatchController.Instance.GetParam().m_ActionId));
}
DoResumeScene();
}
示例2: InitScene
virtual protected void InitScene()
{
CheckSceneStageConfig();
PlayerManager.Instance.CreatePlayerChar();
m_PlayerChar = PlayerManager.Instance.GetPlayerInstance();
TerrainManager.Instance.InitializeTerrain(m_CurrentStage.StageMapId, AppManager.Instance.m_bIsShowTerrainTrigger);
m_PlayerChar.GetTransformData().SetPosition(TerrainManager.Instance.GetPlayerInitPos().Pos.GetVector3());
m_PlayerChar.GetTransformData().SetRotation(TerrainManager.Instance.GetPlayerInitPos().Rot.GetVector3());
//trigger enter scene
DoEnterScene();
RegisterMsg();
//Setup MainCam
GlobalScripts.Instance.Initialize();
GlobalScripts.Instance.mGameCamera.SetTarget(((CharTransformData)(m_PlayerChar.GetTransformData())).GetGameObject().transform);
//FingureGeture
GestureManager.Instance.Initialize();
GestureManager.Instance.EnableMoveChar();
}
示例3: CreatePlayerCharactor
private void CreatePlayerCharactor(int id,Vector3 pos,Vector3 rot)
{
if (null != m_PlayerChar)
{
//
EditorUtility.DisplayDialog("错误", "只能有一个玩家在场景中", "ok");
return;
}
CharactorConfig tmpConfig = ConfigManager.Instance.GetCharactorConfig(id);
if (null == tmpConfig)
{
EditorUtility.DisplayDialog("id 错误", "请检查表中char id ,错误 id= " + id, "ok");
return;
}
GameObject sourceObj = ResourceManager.Instance.LoadBuildInResource<GameObject>(tmpConfig.ModelResource,
AssetType.Char);
if (null == sourceObj)
{
EditorUtility.DisplayDialog("模型 id 错误", "请检查表中char id ,错误 id= " + tmpConfig.ModelResource, "ok");
return;
}
var player = PlayerCharacter.Create(id);
m_PlayerChar = player;
((CharTransformData) (m_PlayerChar.GetTransformData())).SetPhysicStatus(false);
m_PlayerChar.GetTransformData().SetPosition(pos);
m_PlayerChar.GetTransformData().SetRotation(rot);
}