本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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
}
示例5: Start
// Use this for initialization
void Start() {
start_text = this.gameObject.GetComponent<GUIText>();
gui_color = Color.white;
fade_start_text = false;
fadeInLogo();
}
示例6: Awake
void Awake()
{
text = GetComponent<GUIText>();
if (mode == Mode.WhileTrue || mode == Mode.WhileFalse)
timer = fade * text.color.a;
}
示例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;
}
示例8: Start
// Use this for initialization
void Start()
{
anim = GetComponent<Animator>();
playerScript = GetComponent<PlayerControl>();
leftAmmo = ammo;
ammoText = GameObject.FindWithTag("AmmoText").GetComponent<GUIText>();
}
示例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;
}
示例10: Start
// Use this for initialization
void Start()
{
audio = GameObject.FindWithTag("Audio");
a = audio.GetComponents<AudioSource>();
m = GameObject.FindWithTag("Contador");
marcador = m.GetComponent<GUIText>();
}
示例11: AddPoints
//----------------------------------- End Of Delcarations --------------------------------------------------------------------------------------------------
public void AddPoints(int v)
{
score += v;
guiscore = GameObject.Find("GuiScore").GetComponent<GUIText>();
guiscore.text = "Score : " + score;
}
示例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 ();
}
示例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>();
}
示例14: Awake
void Awake () {
timer = timerObj.GetComponent<timer>();
clearText = GameObject.Find("ClearText").GetComponent<GUIText>();
isPlaying = true;
isClear = false;
isGameOver = false;
}
示例15: Start
void Start()
{
guiTextClock = GetComponentInChildren<GUIText> ();
particles = GetComponentInChildren<ParticleSystem> ();
particles.enableEmission = false;
}