當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。