本文整理汇总了C#中UnityEngine.CanvasRenderer类的典型用法代码示例。如果您正苦于以下问题:C# CanvasRenderer类的具体用法?C# CanvasRenderer怎么用?C# CanvasRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CanvasRenderer类属于UnityEngine命名空间,在下文中一共展示了CanvasRenderer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddInlineGraphicsChild
public void AddInlineGraphicsChild()
{
if (m_inlineGraphic != null)
{
//Debug.LogWarning("A child Inline Graphics object already exists.");
return;
}
GameObject inlineGraphicObj = new GameObject("Inline Graphic");
m_inlineGraphic = inlineGraphicObj.AddComponent<InlineGraphic>();
m_inlineGraphicRectTransform = inlineGraphicObj.GetComponent<RectTransform>();
m_inlineGraphicCanvasRenderer = inlineGraphicObj.GetComponent<CanvasRenderer>();
m_inlineGraphicRectTransform.SetParent(transform, false);
m_inlineGraphicRectTransform.localPosition = Vector3.zero;
m_inlineGraphicRectTransform.anchoredPosition3D = Vector3.zero;
m_inlineGraphicRectTransform.sizeDelta = Vector2.zero;
m_inlineGraphicRectTransform.anchorMin = Vector2.zero;
m_inlineGraphicRectTransform.anchorMax = Vector2.one;
m_TextMeshPro = gameObject.GetComponent<TextMeshPro>();
m_TextMeshProUI = gameObject.GetComponent<TextMeshProUGUI>();
}
开发者ID:SamSeidenberg,项目名称:DGames,代码行数:25,代码来源:InlineGraphicManager.cs
示例2: Start
// Use this for initialization
void Start()
{
textRenderer = GetComponent<CanvasRenderer>();
fadeTimeRemaining = fadeSec;
state = DisplayState_e.FADE_IN;
textRenderer.SetAlpha(0);
}
开发者ID:spencewenski,项目名称:Vision,代码行数:8,代码来源:TriggerText.cs
示例3: Awake
void Awake()
{
_backgroundRenderer = gameObject.transform.Find("Background").GetComponent<CanvasRenderer>();
_indicatorRenderer = gameObject.transform.Find("Indicator").GetComponent<CanvasRenderer>();
_backgroundRenderer.SetAlpha(_currentAlpha);
_indicatorRenderer.SetAlpha(_currentAlpha);
}
开发者ID:revisual,项目名称:Pipit-Unity,代码行数:7,代码来源:FadeProgress.cs
示例4: Start
// Use this for initialization
void Start ()
{
rectTransform = GetComponent<RectTransform>();
canvasRenderer = GetComponent<CanvasRenderer>();
//canvasRenderer.renderer.enabled = false;
transform.position = Vector3.one*10000.0f;
}
开发者ID:gabriensymons,项目名称:BreakfastWithUnity,代码行数:8,代码来源:TargetManager.cs
示例5: gaxb_init
public override void gaxb_init()
{
gameObject = new GameObject ("<Movie/>", typeof(RectTransform));
canvasRenderer = gameObject.AddComponent<CanvasRenderer> ();
image = gameObject.AddComponent<RawImage> ();
if (color != null) {
image.color = color.Value;
}
if (resourcePath != null) {
// Why, oh why are movie textures not supported in iOS?
#if (UNITY_IOS || UNITY_ANDROID || UNITY_WEBGL)
#else
// Set texture
MovieTexture tex = Resources.Load (resourcePath) as MovieTexture;
if (tex != null) {
image.texture = tex;
tex.Play ();
tex.loop = looping;
}
#endif
}
}
开发者ID:jun-nishikawa-grm,项目名称:PlanetUnity2,代码行数:29,代码来源:PUMovie.cs
示例6: Start
void Start()
{
_cr = GetComponent<CanvasRenderer>();
_fa = GetComponent<FadeAnimation>();
_fa.setAlpha(0f);
}
开发者ID:SatoshiKawabata,项目名称:education,代码行数:7,代码来源:HelpImage.cs
示例7: Awake
// Use this for initialization
void Awake()
{
textField = transform.Find("Text").gameObject.GetComponent<UnityEngine.UI.Text>();
canvRenderer = GetComponent<CanvasRenderer>();
canvRenderer.SetAlpha(0.0f);
initCaptions ();
}
开发者ID:monsieurplus,项目名称:Ylla,代码行数:9,代码来源:Subtitles_Scripting.cs
示例8: Awake
public void Awake()
{
canvas_r = GetComponent<CanvasRenderer>();
canvas_group = GetComponent<CanvasGroup>();
if (canvas_group != null) alpha_initial = canvas_group.alpha;
else alpha_initial = canvas_r.GetAlpha();
}
开发者ID:RPITeamTree,项目名称:Spelleo_RGS2015,代码行数:8,代码来源:UITransitionFlicker.cs
示例9: Start
// Use this for initialization
void Start()
{
pauseScreen = transform.FindChild("PauseScreen").gameObject.GetComponent<CanvasRenderer>();
pauseScreen.SetAlpha(0);
gameOverScreen = transform.FindChild("GameOverScreen").gameObject.GetComponent<CanvasRenderer>();
gameOverScreen.SetAlpha(0);
}
开发者ID:DonRobo,项目名称:satanic-buddies,代码行数:9,代码来源:HUDScript.cs
示例10: Start
// Use this for initialization
void Start()
{
remainingTime = fadeTime;
mainTitleImg.enabled = true;
fishingGirl.enabled = true;
girlRenderer = fishingGirl.GetComponent<CanvasRenderer>();
titleRenderer = mainTitleImg.GetComponent<CanvasRenderer>();
}
开发者ID:kurix2,项目名称:FishFishRevolution-PC,代码行数:9,代码来源:StartScreenScript.cs
示例11: WallFill
public WallFill(Canvas canvas, string name)
{
GameObject go = new GameObject(name, typeof(RectTransform));
go.transform.parent = canvas.transform;
this.canvasRender = go.AddComponent<CanvasRenderer>();
wallMaterial = new Material(Shader.Find("UI/Default"));
vertlist = new List<UIVertex>();
walls = new List<Wall2D>();
}
开发者ID:duanpeijian,项目名称:unity-drawline,代码行数:9,代码来源:WallFill.cs
示例12: Start
//Initialisation
void Start()
{
rend = this.gameObject.GetComponent<CanvasRenderer>();
canvas = this.gameObject.GetComponent<Canvas>();
//Get initial colour mode from Game Control
ChangeColourMode(GameControl.control.currentGameLevel);
allColours = GameControl.control.currentGameLevel > 3;
}
开发者ID:unit02,项目名称:SoftEng-306-Project-2,代码行数:10,代码来源:CanvasShader.cs
示例13: Start
// Use this for initialization
void Start()
{
finishedAnim = false;
initialiseElements = true;
optionsContainer = GameObject.Find("UI Color Options").GetComponent<RectTransform>();
UIBox = GameObject.Find("UIBox").GetComponent<CanvasRenderer>();
UIBox.SetAlpha(0);
}
开发者ID:Auranapse,项目名称:Scrubity-UI,代码行数:11,代码来源:initUISettingsScreen.cs
示例14: Awake
#pragma warning disable 0618
void Awake() {
button = gameObject.GetComponent<UnityEngine.UI.Button>() as UnityEngine.UI.Button;
buttonRenderer = button.GetComponentInChildren<CanvasRenderer>() as CanvasRenderer;
text = button.GetComponentInChildren<Text>() as Text;
// Hide the button
button.enabled = false;
buttonRenderer.SetAlpha(0);
text.color = Color.clear;
}
开发者ID:J-Dodds,项目名称:CanyonRun,代码行数:11,代码来源:UI_LaunchButton.cs
示例15: FadeAndDestroyObject
IEnumerator FadeAndDestroyObject(CanvasRenderer renderer, float time)
{
float a = renderer.GetAlpha();
while (renderer.GetAlpha() > 0)
{
renderer.SetAlpha(renderer.GetAlpha() - (Time.deltaTime / time) * a);
yield return null;
}
Destroy(gameObject);
}
开发者ID:gjrfytn,项目名称:planet-survival,代码行数:10,代码来源:Fader.cs
示例16: FadeIn
/// <summary>
/// Постепенно отображает объект UI (корутина).
/// </summary>
/// <returns>(Корутина).</returns>
/// <param name="renderer">CanvasRenderer объекта.</param>
/// <param name="time">Время появления.</param>
public static IEnumerator FadeIn(CanvasRenderer renderer, float time)
{
renderer.SetAlpha(0);
do
{
renderer.SetAlpha(renderer.GetAlpha() + Time.deltaTime / time);
yield return null;
}
while (renderer != null && renderer.GetAlpha() < 1);
}
开发者ID:gjrfytn,项目名称:planet-survival,代码行数:16,代码来源:RenderHelper.cs
示例17: Start
// Use this for initialization
void Start()
{
anim = GetComponent<Animator>();
animators = LinkedObjects.Select(i => i.GetComponent<Animator>()).ToArray();
canvasRenderer = GetComponent<CanvasRenderer>();
stateIdle = Animator.StringToHash("Message.Idle");
text = GetComponent<Text>();
message = text.text;
stateGlow = Animator.StringToHash("Photo.Glow");
}
开发者ID:algol001,项目名称:CSVRTutorial_Unity,代码行数:11,代码来源:MessageScript.cs
示例18: gaxb_init
public override void gaxb_init()
{
gameObject = new GameObject ("<Color/>", typeof(RectTransform));
canvasRenderer = gameObject.AddComponent<CanvasRenderer> ();
image = gameObject.AddComponent<Image> ();
if (image && color != null) {
image.color = color.Value;
}
}
开发者ID:jun-nishikawa-grm,项目名称:PlanetUnity2,代码行数:11,代码来源:PUColor.cs
示例19: Start
// Use this for initialization
void Start()
{
finishedAnim = false;
initialiseElements = true;
optionsContainer = GameObject.Find("Options").GetComponent<RectTransform>();
spaceship = GameObject.Find("Spaceship").GetComponent<RectTransform>();
optionsHelp = GameObject.Find("Options Tutorial").GetComponent<CanvasRenderer>();
optionsHelp.SetAlpha(0);
}
开发者ID:Auranapse,项目名称:Scrubity-UI,代码行数:12,代码来源:initCTRLSettingsScreen.cs
示例20: constructor
static public int constructor(IntPtr l) {
try {
UnityEngine.CanvasRenderer o;
o=new UnityEngine.CanvasRenderer();
pushValue(l,true);
pushValue(l,o);
return 2;
}
catch(Exception e) {
return error(l,e);
}
}
开发者ID:602147629,项目名称:2DPlatformer-SLua,代码行数:12,代码来源:Lua_UnityEngine_CanvasRenderer.cs
注:本文中的UnityEngine.CanvasRenderer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论