本文整理汇总了C#中ISceneObject.CloneForNewScene方法的典型用法代码示例。如果您正苦于以下问题:C# ISceneObject.CloneForNewScene方法的具体用法?C# ISceneObject.CloneForNewScene怎么用?C# ISceneObject.CloneForNewScene使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISceneObject
的用法示例。
在下文中一共展示了ISceneObject.CloneForNewScene方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateObject
/**
* Object-related communications
*/
public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall)
{
if (destination == null)
return false;
foreach (Scene s in m_sceneList)
{
if (s.RegionInfo.RegionHandle == destination.RegionHandle)
{
//m_log.Debug("[LOCAL COMMS]: Found region to SendCreateObject");
if (isLocalCall)
{
// We need to make a local copy of the object
ISceneObject sogClone = sog.CloneForNewScene(s);
sogClone.SetState(sog.GetStateSnapshot(), s);
return s.IncomingCreateObject(sogClone);
}
else
{
// Use the object as it came through the wire
return s.IncomingCreateObject(sog);
}
}
}
return false;
}
示例2: CreateObject
/**
* Object-related communications
*/
public bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall)
{
if (destination == null)
return false;
if (m_scenes.ContainsKey(destination.RegionID))
{
// m_log.DebugFormat(
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
// s.RegionInfo.RegionName, destination.RegionHandle);
Scene s = m_scenes[destination.RegionID];
if (isLocalCall)
{
// We need to make a local copy of the object
ISceneObject sogClone = sog.CloneForNewScene();
sogClone.SetState(sog.GetStateSnapshot(), s);
return s.IncomingCreateObject(newPosition, sogClone);
}
else
{
// Use the object as it came through the wire
return s.IncomingCreateObject(newPosition, sog);
}
}
return false;
}