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


C# Canvas类代码示例

本文整理汇总了C#中Canvas的典型用法代码示例。如果您正苦于以下问题:C# Canvas类的具体用法?C# Canvas怎么用?C# Canvas使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Canvas类属于命名空间,在下文中一共展示了Canvas类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

 // Use this for initialization
 void Start()
 {
     cpt = 0.0F;
     GetComponent<AudioSource>().PlayOneShot(nekoNya);
     canvas = GameObject.FindGameObjectWithTag("marmotteUI").GetComponent<Canvas>();
     canvas.enabled = false;
 }
开发者ID:FuriousCatInteractive,项目名称:MarmotteWorld,代码行数:8,代码来源:marmotteSpeak.cs

示例2: OnShown

        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            mvarHDC = Internal.System.Windows.Methods.GetDC(this.Handle);
            mvarCanvas = new Canvas(mvarHDC, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
        }
开发者ID:Narinyir,项目名称:Sanjigen,代码行数:7,代码来源:WindowsForm.cs

示例3: Start

	// Use this for initialization
	void Start()
	{
		player = GameObject.FindGameObjectWithTag("Player").GetComponent<PuppetScript>();

		theGUI = GameObject.Find("GUI").GetComponent<Canvas>();
		tutorial = GameObject.Find("Tutorial").GetComponent<Canvas>();

		if (theGUI)
		{
			guardLeft = GameObject.Find("GUI/Panel/Guard HUD/Guard Left").GetComponent<Image>();
			guardRight = GameObject.Find("GUI/Panel/Guard HUD/Guard Right").GetComponent<Image>();
			guardTop = GameObject.Find("GUI/Panel/Guard HUD/Guard Top").GetComponent<Image>();

			tally1 = GameObject.Find("GUI/Panel/Tally1").GetComponent<Image>();
			tally2 = GameObject.Find("GUI/Panel/Tally2").GetComponent<Image>();
			tally3 = GameObject.Find("GUI/Panel/Tally3").GetComponent<Image>();
		}

		dances.Add("Twerk");
		dances.Add("Gangnam Style");
		dances.Add("Robot");
		dances.Add("Thriller 1");
		dances.Add("Thriller 2");
		dances.Add("Thriller 3");
		dances.Add("Thriller 4");
	}
开发者ID:JPStank,项目名称:CRISPY_Samurai,代码行数:27,代码来源:GUI.cs

示例4: UnregisterGraphicForCanvas

 /// <summary>
 ///   <para>Deregister the given Graphic from a Canvas.</para>
 /// </summary>
 /// <param name="c">Canvas.</param>
 /// <param name="graphic">Graphic to deregister.</param>
 public static void UnregisterGraphicForCanvas(Canvas c, Graphic graphic)
 {
   IndexedSet<Graphic> indexedSet;
   if ((Object) c == (Object) null || !GraphicRegistry.instance.m_Graphics.TryGetValue(c, out indexedSet))
     return;
   indexedSet.Remove(graphic);
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:12,代码来源:GraphicRegistry.cs

示例5: GetGraphicsForCanvas

 /// <summary>
 ///   <para>Return a list of Graphics that are registered on the Canvas.</para>
 /// </summary>
 /// <param name="canvas">Input canvas.</param>
 /// <returns>
 ///   <para>Graphics on the input canvas.</para>
 /// </returns>
 public static IList<Graphic> GetGraphicsForCanvas(Canvas canvas)
 {
   IndexedSet<Graphic> indexedSet;
   if (GraphicRegistry.instance.m_Graphics.TryGetValue(canvas, out indexedSet))
     return (IList<Graphic>) indexedSet;
   return (IList<Graphic>) GraphicRegistry.s_EmptyList;
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:14,代码来源:GraphicRegistry.cs

示例6: Start

	// Use this for initialization
	void Start () {

        winningPlayer = 0;
        Time.timeScale = 1;
        players = GameObject.FindGameObjectsWithTag("Player");

        if (players.Length > numOfPlayers)
        {
            for (int i = 0; i < players.Length; i++)
            {
                if (players[i].GetComponent<CarScript>().player > numOfPlayers)
                    if (players[i].transform.name != ("RC Car 1"))
                    {
                        Destroy(players[i].gameObject);
                    }
                else
                    continue;
            }
        }

        lapText = GameObject.Find("Lap Text").GetComponent<Text>();
        winnerText = GameObject.Find("Winner Text").GetComponent<Text>();
        gameOverCanvas = GameObject.Find("Game Over Canvas").GetComponent<Canvas>();
        pauseCanvas = GameObject.Find("Pause Canvas").GetComponent<Canvas>();
        hudCanvas = GameObject.Find("HUD").GetComponent<Canvas>();

        pauseCanvas.enabled = false;
        gameOverCanvas.enabled = false;
	
	}
开发者ID:johnsonnikolaus,项目名称:VR-RC-Racing,代码行数:31,代码来源:GameManager.cs

示例7: Start

 // Use this for initialization
 void Start()
 {
     quitMenu = quitMenu.GetComponent<Canvas> ();
     play = play.GetComponent<Button> ();
     quit = quit.GetComponent<Button> ();
     quitMenu.enabled = false;
 }
开发者ID:Menkid,项目名称:OKUNiD,代码行数:8,代码来源:MenuScript.cs

示例8: Start

    // Use this for initialization
    void Start()
    {
        SetSound();

        Image[] images = GetComponentsInChildren<Image>();
        foreach (Image i in images)
            if (i.name == "SoundButton")
            {
                _soundImage = i;
                _soundImage.sprite = (sound == 1) ? soundOnImage : soundOffImage;
            }

        _startMenuCanvas = GetComponentInChildren<Canvas>();
        _startMenuCanvas.enabled = true;

        try {
            _highScoreCanvas = GameObject.Find("HighScoreUI").GetComponentInChildren<Canvas>();
            if (_highScoreCanvas != null)
            {
                _highScoreCanvas.enabled = false;
                SetFontSize(_startMenuCanvas);
            }
        }
        catch(Exception e) { Debug.Log(e);  }

        Text[] textArry = _startMenuCanvas.GetComponentsInChildren<Text>();
        foreach (Text ctext in textArry)
        {
            if (ctext.name.Contains("Score")) ctext.text = "" + Score.getScore();
        }
    }
开发者ID:ShinWonYoung,项目名称:HGU-SE-15,代码行数:32,代码来源:MenuManager.cs

示例9: Awake

	public void Awake () 
	{
		_canvas = FindObjectOfType<Canvas>();
		_renderers = FindObjectsOfType<Renderer>();
		_scnManager = FindObjectOfType<SceneManager> ();
		DOTween.Init();
	}
开发者ID:MaDDoXbr,项目名称:https---github.com-magneticservices-Palomar,代码行数:7,代码来源:LineGraph.cs

示例10: Start

        public int KeepWindowInCanvas = 5;            // # of pixels of the window that must stay inside the canvas view.

        // Use this for initialization
        void Start()
        {
            m_transform = GetComponent<RectTransform>();
            m_originalCoods = m_transform.position;
            m_canvas = GetComponentInParent<Canvas>();
            m_canvasRectTransform = m_canvas.GetComponent<RectTransform>();
        }
开发者ID:illvisation,项目名称:cellVIEW_bdbox,代码行数:10,代码来源:UIWindowBase.cs

示例11: initUI

    private void initUI()
    {
        //UI Initializations - Grab Canvas with find object, then grab children for efficiency
        gameUI = FindObjectOfType<Canvas>();

        //get all child sliders
        Component[] canvasSliders = gameUI.GetComponentsInChildren<Slider> ();
        //get all text sliders
        Component[] canvasTexts = gameUI.GetComponentsInChildren<Text> ();

        //loop through and find specific slider
        foreach (Slider child in canvasSliders) {
            if (child.tag.Equals("Enemy HP")) {
                enemyHealth = child;
            }
        }

        //loop through and find specific text
        foreach (Text child in canvasTexts) {
            if (child.tag.Equals("Enemy Ratio")) {
                enemyRatio = child;
            }
        }

        //create listener to run delegate function for updating text ratio of enemy
        enemyHealth.onValueChanged.AddListener (updateEnemyRatio);
    }
开发者ID:Edj3,项目名称:Unity_3PShooter,代码行数:27,代码来源:FireGun.cs

示例12: Start

	// Use this for initialization
	void Start () {
		quitMenu = quitMenu.GetComponent<Canvas> ();
		playText = playText.GetComponent<Button> ();
		exitText = exitText.GetComponent<Button> ();
		quitMenu.enabled = false;

	}
开发者ID:ajm1996,项目名称:MorningRitual,代码行数:8,代码来源:Menu.cs

示例13: Start

	void Start () {
		sceneManagerScript.setUserVisited(41);
		sceneManagerScript.printCurrentKillerID();
		
		dialogue_1 = sceneManagerScript.readFile("Scene41_1.txt");
		emotion_1 = sceneManagerScript.readEmotion("41_1.txt");
		dialogue_1Length = dialogue_1.Length;

		dialogue_2 = sceneManagerScript.readFile("Scene41_2.txt");
		emotion_2 = sceneManagerScript.readEmotion("41_2.txt");
		dialogue_2Length = dialogue_2.Length;

		dialogue_3 = sceneManagerScript.readFile("Scene41_3.txt");
		emotion_3 = sceneManagerScript.readEmotion("41_3.txt");
		dialogue_3Length = dialogue_3.Length;

		dialogue_4 = sceneManagerScript.readFile("Scene41_4.txt");
		emotion_4 = sceneManagerScript.readEmotion("41_4.txt");
		dialogue_4Length = dialogue_4.Length;

		dialogue_5 = sceneManagerScript.readFile("Scene41_5.txt");
		emotion_5 = sceneManagerScript.readEmotion("41_5.txt");
		dialogue_5Length = dialogue_5.Length;

		dialogue_6 = sceneManagerScript.readFile("Scene41_6.txt");
		emotion_6 = sceneManagerScript.readEmotion("41_6.txt");
		dialogue_6Length = dialogue_6.Length;

		displayDialogue();

		sceneCanvas = sceneCanvas.GetComponent<Canvas>(); 
		sceneCanvas.enabled = true; 
		decision1Canvas = decision1Canvas.GetComponent<Canvas>();
		decision1Canvas.enabled = false;
	}
开发者ID:InvistiGator,项目名称:DogTective,代码行数:35,代码来源:scene41Manager.cs

示例14: Start

 void Start()
 {
     exitText = exitText.GetComponent<Canvas> ();
     menu = menu.GetComponent<Canvas> ();
     menu.enabled = true;
     exitText.enabled = false;
 }
开发者ID:YoGames,项目名称:SumoWrestling,代码行数:7,代码来源:Menu.cs

示例15: Awake

 void Awake()
 {
     text = GameObject.Find("Info").GetComponent<Text>();
     myCanvas = transform.parent.parent.parent.GetComponent<Canvas>();
     infoMessage = new List<string>();
     DisableMe();
 }
开发者ID:HaKDMoDz,项目名称:Capstone_Space_Game,代码行数:7,代码来源:Info.cs


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