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


C# GameObject.GetSingleInterfaceInChildren方法代码示例

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


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

示例1: InitializeOther

 protected override void InitializeOther(GameObject itemGo) {
     base.InitializeOther(itemGo);
     _revolver = itemGo.GetSingleInterfaceInChildren<IRevolver>();
     //_revolver.IsActivated = false;    // enabled = false in Awake
     if (_revolver.RotateDuringPause) {
         D.Warn("FYI. {0} revolver set to rotate during a pause.", DebugName);
     }
     //TODO Revolver settings
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:9,代码来源:FacilityDisplayManager.cs

示例2: InitializePrimaryMesh

        protected override MeshRenderer InitializePrimaryMesh(GameObject elementItemGo) {
            //D.Log("{0}.InitializePrimaryMesh({1}) called.", DebugName, elementItemGo.name);
            IHull hull = elementItemGo.GetSingleInterfaceInChildren<IHull>();
            var primaryMeshRenderer = hull.HullMesh.GetComponent<MeshRenderer>();
            primaryMeshRenderer.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
            primaryMeshRenderer.receiveShadows = true;
            __ValidateAndCorrectMeshLayer(primaryMeshRenderer.gameObject);

            // Note: currently could use renderer.sharedMaterial here for greater efficiency, but only until each element gets assigned its own material
            InitializePrimaryMeshMaterial(primaryMeshRenderer.material);
            return primaryMeshRenderer;
        }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:12,代码来源:AElementDisplayManager.cs

示例3: InitializeOther

        protected override void InitializeOther(GameObject itemGo) {
            base.InitializeOther(itemGo);
            _glowBillboard = itemGo.GetSingleInterfaceInChildren<IBillboard>();

            var starLight = itemGo.GetComponentInChildren<Light>();
            // UNCLEAR no runtime assessable option to set Baking = Realtime
            starLight.type = LightType.Point;
            starLight.range = References.GameManager.GameSettings.UniverseSize.Radius(); //References.DebugControls.UniverseSize.Radius();
            starLight.intensity = 1F;
            //starLight.bounceIntensity = 1F; // bounce light shadowing not currently supported for point lights
            starLight.shadows = LightShadows.None;  // point light shadows are expensive
            starLight.renderMode = LightRenderMode.Auto;
            starLight.cullingMask = StarLightCullingMask;
            starLight.enabled = true;

            _revolvers = itemGo.GetSafeInterfacesInChildren<IRevolver>();
            //_revolvers.ForAll(r => r.IsActivated = false);  // enabled = false in Awake
            //TODO Revolver settings
        }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:19,代码来源:StarDisplayManager.cs

示例4: InitializeOther

 protected override void InitializeOther(GameObject trackedItemGo) {
     base.InitializeOther(trackedItemGo);
     _revolver = trackedItemGo.GetSingleInterfaceInChildren<IRevolver>();
     //_revolver.IsActivated = false;    // enabled = false in Awake
     //TODO Revolver settings
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:6,代码来源:UniverseCenterDisplayManager.cs

示例5: InitializeOther

 protected override void InitializeOther(GameObject trackedItemGo) {
     base.InitializeOther(trackedItemGo);
     _revolver = trackedItemGo.GetSingleInterfaceInChildren<IRevolver>();
     //TODO Revolver settings
     _orbitSimulator = trackedItemGo.GetComponent<IMoon>().CelestialOrbitSimulator;
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:6,代码来源:MoonDisplayManager.cs

示例6: InitializeSecondaryMeshes

 protected override void InitializeSecondaryMeshes(GameObject elementItemGo) {   // Mounts
     base.InitializeSecondaryMeshes(elementItemGo);
     var hullGo = elementItemGo.GetSingleInterfaceInChildren<IHull>().transform.gameObject;
     _secondaryMeshRenderers = hullGo.GetComponentsInChildren<MeshRenderer>().Except(_primaryMeshRenderer);
     if (_secondaryMeshRenderers.Any()) {
         //D.Log("{0} is initializing Mount Renderers.", DebugName);
         _secondaryMeshRenderers.ForAll(r => {
             __ValidateAndCorrectMeshLayer(r.gameObject);
             r.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On;
             r.receiveShadows = true;
             r.enabled = false;
         });
     }
 }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:14,代码来源:AElementDisplayManager.cs


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