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


C# UnityEngine.CanvasRenderer类代码示例

本文整理汇总了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>();
        }
开发者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


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