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


C# Instance.discovery方法代码示例

本文整理汇总了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;
            }
        }
    }
开发者ID:remap,项目名称:ndn-mog,代码行数:54,代码来源:Initialize.cs


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