本文整理汇总了C#中GUIText类的典型用法代码示例。如果您正苦于以下问题:C# GUIText类的具体用法?C# GUIText怎么用?C# GUIText使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GUIText类属于命名空间,在下文中一共展示了GUIText类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Start
// Use this for initialization
void Start () {
textObject = GetComponent<GUIText>();
// scale the wrap width to the proper size for the screen
wrapAtWidth = (wrapAtWidth * Screen.width) / targetResolutionWidth;
}
开发者ID:metanymie,项目名称:jga,代码行数:8,代码来源:WordWrapText.cs
示例17: Awake
/// <summary>
/// Used for initialization
/// </summary>
void Awake()
{
mInstructions = GameObject.Find("TextInstructions").GetComponent<GUIText>();
mInstructions.text += "\r\n";
if (SceneName == "Demo")
{
mInstructions.text += "Move - WASD or Left Stick" + "\r\n";
mInstructions.text += "Walk - WASD + Middle Mouse Button or Left Stick + Left Trigger" + "\r\n";
mInstructions.text += "Turn - Mouse + Right Mouse Button or Right Stick" + "\r\n";
}
else
{
mInstructions.text += "Move - WAD or Left Stick" + "\r\n";
mInstructions.text += "Target - WASD + Middle Mouse Button or Left Stick + Left Trigger" + "\r\n";
mInstructions.text += "View - Mouse + Right Mouse Button or Right Stick" + "\r\n";
}
mInstructions.text += "Jump - Space or 'A' Button" + "\r\n";
mInstructions.text += "Drop - Shift or 'Y' Button" + "\r\n";
mInstructions.text += "Sneak - T or Right Trigger" + "\r\n";
mInstructions.text += "" + "\r\n";
mInstructions.text += "Motions:" + "\r\n";
mInstructions.text += " Idle" + "\r\n";
mInstructions.text += " Forward" + "\r\n";
mInstructions.text += " Walk" + "\r\n";
mInstructions.text += " Sneak" + "\r\n";
mInstructions.text += " Slide" + "\r\n";
mInstructions.text += " Jump" + "\r\n";
mInstructions.text += " Fall" + "\r\n";
mInstructions.text += " Climb High" + "\r\n";
mInstructions.text += " Climb Mid" + "\r\n";
mSwap = new Rect(10, 100 + ((mBtnHeight + 10) * 0), mBtnWidth, mBtnHeight);
}
开发者ID:yzeal,项目名称:Weltenseele2,代码行数:38,代码来源:UI.cs
示例18: Start
// Use this for initialization
void Start()
{
lastContacts = new List<Contact>();
_guiText = GetComponent<GUIText>();
//Debug.Log(string.Format("lots of razors {0} should be here", "1337"));
//Time.timeScale = 0.5f;
}
开发者ID:AtrapadosGame,项目名称:Atrapados-Viejo,代码行数:8,代码来源:TestCoreCollisionEvents.cs
示例19: InitializeTemperature
private void InitializeTemperature()
{
TemperatureText = new GUIText();
TemperatureText.font = (Font)UnityEngine.Resources.Load("Fonts/Arial Black", typeof(Font));
TemperatureText.font.material.color = new Color(0f,255f,0f);
//CurrentTemp = NormalBodyTemp;
}
开发者ID:sethnel99,项目名称:HungerGame,代码行数:7,代码来源:HUDOverlay.cs
示例20: Start
// Use this for initialization
void Start () {
instance = this;
player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
GameObject mapCameraObj = GameObject.FindGameObjectWithTag ("mapCamera");
if(mapCameraObj != null){
mapCamera = mapCameraObj.GetComponent<Camera>();
mapCamera.enabled = false;
}
GUITexture[] hudGUIs = GetComponentsInChildren<GUITexture>();
powerImg = hudGUIs[0];
crosshairImg = hudGUIs[1];
matchImg = hudGUIs[2];
if (mapCamera != null) {
gunCrosshairImg = hudGUIs [3];
}
GUIText[] guiText = GetComponentsInChildren<GUIText>();
hintsText = guiText[0];
if (mapCamera != null) {
hpText = guiText [1];
bulletText = guiText [2];
hiScoreText = guiText [3];
scoreText = guiText [4];
}
HideCursor();
SetHiScore(hiScore);
}
开发者ID:whg333,项目名称:survivalIsland,代码行数:33,代码来源:GUIManager.cs
注:本文中的GUIText类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论