本文整理汇总了C#中UnityEngine.CanvasRenderer类的典型用法代码示例。如果您正苦于以下问题:C# CanvasRenderer类的具体用法?C# CanvasRenderer怎么用?C# CanvasRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CanvasRenderer类属于UnityEngine命名空间,在下文中一共展示了CanvasRenderer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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>();
}
示例2: Start
// Use this for initialization
void Start()
{
textRenderer = GetComponent<CanvasRenderer>();
fadeTimeRemaining = fadeSec;
state = DisplayState_e.FADE_IN;
textRenderer.SetAlpha(0);
}
示例3: Awake
void Awake()
{
_backgroundRenderer = gameObject.transform.Find("Background").GetComponent<CanvasRenderer>();
_indicatorRenderer = gameObject.transform.Find("Indicator").GetComponent<CanvasRenderer>();
_backgroundRenderer.SetAlpha(_currentAlpha);
_indicatorRenderer.SetAlpha(_currentAlpha);
}
示例4: Start
// Use this for initialization
void Start ()
{
rectTransform = GetComponent<RectTransform>();
canvasRenderer = GetComponent<CanvasRenderer>();
//canvasRenderer.renderer.enabled = false;
transform.position = Vector3.one*10000.0f;
}
示例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
}
}
示例6: Start
void Start()
{
_cr = GetComponent<CanvasRenderer>();
_fa = GetComponent<FadeAnimation>();
_fa.setAlpha(0f);
}
示例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 ();
}
示例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();
}
示例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);
}
示例10: Start
// Use this for initialization
void Start()
{
remainingTime = fadeTime;
mainTitleImg.enabled = true;
fishingGirl.enabled = true;
girlRenderer = fishingGirl.GetComponent<CanvasRenderer>();
titleRenderer = mainTitleImg.GetComponent<CanvasRenderer>();
}
示例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>();
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}