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


C# GUIText类代码示例

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


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

示例1: Start

 //public string objectNarration;
 // Use this for initialization
 void Start()
 {
     playerCamera = GameObject.Find("First Person Controller/Main Camera");
     objectNarration = GameObject.Find("Object Narration");
     objectNarrationGUI = objectNarration.GetComponent<GUIText>();
     objectNarrationGUI.enabled = false;
 }
开发者ID:vinlasan,项目名称:School,代码行数:9,代码来源:RaycastScript.cs

示例2: Start

    void Start()
    {
        introText = "";
        showIntroText = true;
        intro = new ArrayList();

        FileInfo theSourceFile = new FileInfo("Assets/StoryAssets/Level1.txt");
        StreamReader reader = theSourceFile.OpenText();
        SpeechBubbleText = GameObject.FindWithTag("SpeechBubbleText").GetComponent<GUIText>() as GUIText;
        string line;
        int i = 0;
        currentLine = 0;

        do
        {
            line = reader.ReadLine();
            intro.Add(line);
            i++;
        } while (line != null);

        do
        {
            if (currentLine >= 5)
            {
                showIntroText = false;
            }

            SpeechBubbleText.text = (intro[currentLine]).ToString();
            StartCoroutine(HideSpeechBubble());
        } while (showIntroText == true);
    }
开发者ID:Rameos,项目名称:PSMG_Alarm,代码行数:31,代码来源:StorySequenceScript.cs

示例3: Awake

 // Initialization
 void Awake()
 {
     // Get reference from the gameObject
     label = GetComponent<GUIText>();
     // Unity trick to create dinamic fonts
     label.fontSize = (int)(Screen.height * dinamicFontSize * 0.0035f);
 }
开发者ID:Juan73908,项目名称:ETCorps,代码行数:8,代码来源:GUILabel.cs

示例4: Start

 // Use this for initialization
 void Start()
 {
     hScore = PlayerPrefs.GetFloat ("highscore");
     gText = score.GetComponent<GUIText> ();
     hgText = hscore.GetComponent<GUIText> ();
     InvokeRepeating("CreateAsteroid", 1f, .3f); //Manipulate last two parameters depending on desired spawn rate
 }
开发者ID:rtangxps9,项目名称:HackTX2015,代码行数:8,代码来源:WorldScript.cs

示例5: Start

    // Use this for initialization
    void Start() {
        start_text = this.gameObject.GetComponent<GUIText>();

        gui_color = Color.white;
        fade_start_text = false;
        fadeInLogo();
    }
开发者ID:FriedRice,项目名称:MetalGearSolidVRMissions,代码行数:8,代码来源:StartMenu.cs

示例6: Awake

	void Awake()
	{
		text = GetComponent<GUIText>();

		if (mode == Mode.WhileTrue || mode == Mode.WhileFalse)
			timer = fade * text.color.a;
	}
开发者ID:RoBorg,项目名称:nyan,代码行数:7,代码来源:SteamVR_StatusText.cs

示例7: Start

	// Use this for initialization
	void Start ()
	{	
		// The XML file containing the atlas UVs
		FastGUIElement.uvxmlFile = @"assets//resources//Frontend_AtlasUV.xml";
		
		// Persistent across tabs
		Store_Background = new FastGUIElement (
			new Vector2 (0, 0),
			FastGUIElement.UVsFrom (@"Store_Background.png"));		
		General_BackButton = new FastGUIElement (
			new Vector2 (0, 0),
			FastGUIElement.UVsFrom (@"General_BackButton.png"));
		General_CoinDisplay = new FastGUIElement (
			new Vector2 (1536, 0),
			FastGUIElement.UVsFrom (@"General_CoinDisplay.png"));
		
		// Create tabs
		wardrobe = new StoreWardrobe ();
		gear = new StoreGear ();
		bank = new StoreBank ();
		
		// Create the GUITexts
		//aGUIText = (GUIText)gameObject.AddComponent (typeof (GUIText));
		GameObject go = Instantiate (Resources.Load ("Frontend_GUIText")) as GameObject;  // Note need to clone prefab as can't access pixel correct property from script
		aGUIText = go.guiText;
		aGUIText.transform.position = new Vector3 (.775f, .995f, 0);
		aGUIText.transform.localScale = new Vector3 (.5f, .5f, 1);
		aGUIText.text = "Coins\nGDs\nXP Level";
		aGUIText.color = Color.red;
	}
开发者ID:eddaly,项目名称:elvis,代码行数:31,代码来源:store.cs

示例8: Start

 // Use this for initialization
 void Start()
 {
     anim = GetComponent<Animator>();
     playerScript = GetComponent<PlayerControl>();
     leftAmmo = ammo;
     ammoText = GameObject.FindWithTag("AmmoText").GetComponent<GUIText>();
 }
开发者ID:anitricks,项目名称:FruityDeathmatch,代码行数:8,代码来源:PlayerShootingControl.cs

示例9: Start

	void Start() {
		// Find the GUI components
		GameObject go = GameObject.Find("ShotCounter");
		shotCounter = go.GetComponent<GUIText>();
		go = GameObject.Find("ShotRating");
		shotRating = go.GetComponent<GUIText>();
		go = GameObject.Find("_Check_64");
		checkMark = go.GetComponent<GUITexture>();
		go = GameObject.Find ("WhiteOut");
		whiteOut = go.GetComponent<GUITexture>();
		// Hide the checkMark and whiteOut
		checkMark.enabled = false;
		whiteOut.enabled = false;

		// Load all the shots from PlayerPrefs
		Shot.LoadShots();
		// If there were shots stored in PlayerPrefs
		if (Shot.shots.Count>0) {
			shotNum = 0;
			ResetPlayerShotsAndRatings();
			ShowShot(Shot.shots[shotNum]);
		}

		// Hide the cursor (Note: this doesn't work in the Unity Editor unless
		// the Game pane is set to Maximize on Play.)
		Screen.showCursor = false;

		camRectNormal = camera.rect;
	}
开发者ID:ITIGameDesign,项目名称:QuickSnap,代码行数:29,代码来源:TargetCamera.cs

示例10: Start

 // Use this for initialization
 void Start()
 {
     audio = GameObject.FindWithTag("Audio");
     a = audio.GetComponents<AudioSource>();
     m = GameObject.FindWithTag("Contador");
     marcador = m.GetComponent<GUIText>();
 }
开发者ID:Adrxx,项目名称:MultiGame,代码行数:8,代码来源:Contador.cs

示例11: AddPoints

    //----------------------------------- End Of Delcarations --------------------------------------------------------------------------------------------------
    public void AddPoints(int v)
    {
        score += v;
        guiscore = GameObject.Find("GuiScore").GetComponent<GUIText>();

        guiscore.text = "Score : " + score;
    }
开发者ID:perlatsp,项目名称:Tubloid,代码行数:8,代码来源:PaddleScript.cs

示例12: Start

		// Use this for initialization
		void Start ()
		{
				GUI_gameover = GameObject.Find ("GUI gameover").GetComponent<GUIText> ();
				
				GameObject.Find ("GUI score").GetComponent<GUIText> ().text = "Score: 0";
				SpawnBall ();
		}
开发者ID:ameyagadkari,项目名称:portfolio,代码行数:8,代码来源:bat.cs

示例13: Start

    // Use this for initialization
    void Start()
    {
        armor = 5;

        if (gameObject.name.IndexOf('(') != -1)
        {
            maxHP = PlayerPrefs.GetFloat(gameObject.name.Substring(0, gameObject.name.IndexOf('(')) + "_heart") * 100 <= 0 ? 100 : PlayerPrefs.GetFloat(gameObject.name.Substring(0, gameObject.name.IndexOf('(')) + "_heart") * 100;
            armor += PlayerPrefs.GetFloat(gameObject.name.Substring(0, gameObject.name.IndexOf('(')) + "_armor") * 5;
        }
        else if (gameObject.name == "gunman")
        {
            maxHP = 100;
        }

        currentHP = maxHP;

        text = gameObject.AddComponent<GUIText>();

        timespan = 0f;
        checktime = 2.0f;

        //HP = Instantiate(HP, new Vector3(gameObject.transform.position.x, gameObject.transform.position.y, gameObject.transform.position.z), gameObject.transform.rotation) as Canvas;

        animation = GetComponent<Animator>();

        hpBar = GetComponentsInChildren<Image>();
    }
开发者ID:sprms,项目名称:Unity,代码行数:28,代码来源:HPManager.cs

示例14: Awake

	void Awake () {
		timer = timerObj.GetComponent<timer>();
		clearText = GameObject.Find("ClearText").GetComponent<GUIText>();
		isPlaying = true;
		isClear = false;
		isGameOver = false;
	}
开发者ID:Shimoaraiso,项目名称:GGJ2016,代码行数:7,代码来源:GameController.cs

示例15: Start

    void Start()
    {
        guiTextClock = GetComponentInChildren<GUIText> ();

        particles = GetComponentInChildren<ParticleSystem> ();
        particles.enableEmission = false;
    }
开发者ID:joaokucera,项目名称:unity-ludum-dare-29,代码行数:7,代码来源:Caudron.cs


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