本文整理汇总了C#中Instance.discovery方法的典型用法代码示例。如果您正苦于以下问题:C# Instance.discovery方法的具体用法?C# Instance.discovery怎么用?C# Instance.discovery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Instance
的用法示例。
在下文中一共展示了Instance.discovery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
public void Start()
{
UnityConstants.init();
selfTransform = GameObject.Find (UnityConstants.selfTransformPath).transform;
playersParentTransform = GameObject.Find(UnityConstants.playerParentPath).transform;
minimapCamera = GameObject.Find(UnityConstants.selfTransformPath + UnityConstants.minimapCameraPath).transform;
renderString = Constants.DefaultRenderString;
AsteroidInstantiate.init ();
playerTransform = GameObject.Find (UnityConstants.playerTransformPath).transform;
cubeTransform = GameObject.Find (UnityConstants.cubeTransformPath).transform;
UnityEngine.Vector3 dollPosUnity = UnityConstants.startingLocOne;
transform.position = dollPosUnity;
remap.NDNMOG.DiscoveryModule.Vector3 dollPos = new remap.NDNMOG.DiscoveryModule.Vector3 (dollPosUnity.x, dollPosUnity.y, dollPosUnity.z);
List<int> startingOct = CommonUtility.getOctantIndicesFromVector3 (dollPos);
populateAsteroids(startingOct);
log = new Logging (playerName, UnityConstants.gameLogName, UnityConstants.libraryLogName);
if (!readConfFromFile (UnityConstants.configFilePath)) {
playerName = "default";
log.writeLog ("Didn't parse config file, using default as name.");
}
if (loggingLevel != UnityConstants.LoggingLevelNone) {
log.level_ = LoggingLevel.All;
} else {
log.level_ = LoggingLevel.None;
}
instance = new Instance (startingOct, playerName, dollPos, setPosCallback, log.libraryWriteCallback, infoCallback, null, null, null, renderString, hubPrefix);
instance.discovery ();
instantiated = true;
// instance is interested in its starting location
trackOctant (startingOct);
// set playerName for label: this is the full name of the local player.
GameObject.Find (UnityConstants.playerTransformPath + UnityConstants.labelTransformPath).guiText.text = instance.getSelfGameEntity().getHubPrefix() + "/" + Constants.PlayersPrefix + "/" + playerName;
GameObject entity = GameObject.Find (UnityConstants.playerTransformPath + UnityConstants.dollPath);
if (entity != null) {
string path = "Materials/" + renderString;
Material unityMaterial = Resources.Load (path, typeof(Material)) as Material;
if (unityMaterial != null) {
entity.GetComponent<MeshRenderer> ().material = unityMaterial;
}
}
}