本文整理汇总了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
}
示例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;
}
示例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
}
示例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
}
示例5: InitializeOther
protected override void InitializeOther(GameObject trackedItemGo) {
base.InitializeOther(trackedItemGo);
_revolver = trackedItemGo.GetSingleInterfaceInChildren<IRevolver>();
//TODO Revolver settings
_orbitSimulator = trackedItemGo.GetComponent<IMoon>().CelestialOrbitSimulator;
}
示例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;
});
}
}