// Start is called before the first frame update void Start() { teamControllers = FindObjectsOfType <TeamController>(); goText = GameObject.Find("GoText").GetComponent <FadingText>(); readyText = GameObject.Find("ReadyText").GetComponent <FadingText>(); goalText = GameObject.Find("GoalText").GetComponent <FadingText>(); endText = GameObject.Find("EndText").GetComponent <FadingText>(); timeText = GameObject.Find("TimeText").GetComponent <FadingText>(); overTimeText = GameObject.Find("OverTimeText").GetComponent <FadingText>(); outText = GameObject.Find("OutText").GetComponent <FadingText>(); team1BG = GameObject.Find("ColorBG1"); team2BG = GameObject.Find("ColorBG2"); puck = GameObject.FindGameObjectWithTag("Puck"); players = FindObjectsOfType <PlayerController>(); minutesText = GameObject.Find("Minutes").GetComponent <Text>(); secondsText = GameObject.Find("Seconds").GetComponent <Text>(); score1Text = GameObject.Find("Score1").GetComponent <Text>(); score2Text = GameObject.Find("Score2").GetComponent <Text>(); periodText = GameObject.Find("Period").GetComponent <Text>(); goal1 = GameObject.Find("Goal1").transform.GetChild(0).GetComponent <GoalLogic>(); goal2 = GameObject.Find("Goal2").transform.GetChild(0).GetComponent <GoalLogic>(); startPositions = GameObject.Find("StartPositions"); Physics2D.IgnoreLayerCollision(8, 9); Physics2D.IgnoreLayerCollision(10, 11); Physics2D.IgnoreLayerCollision(8, 11); Physics2D.IgnoreLayerCollision(8, 8); SetPeriodTime(periodTime); }
public void SpawnText(Vector3 position, string text, Color color) { FadingText ft = Instantiate(ftPrefab); ft.SetText(text); ft.SetColor(color); ft.transform.position = position; ft.transform.SetParent(transform); }
public void createText(Vector3 position, float comboDamage) { // Instantiate the text. Debug.Log("Create text!"); GameObject textObject = Instantiate(this.damageTextPrefab, position, Quaternion.identity); FadingText fadeScript = textObject.GetComponent <FadingText>(); fadeScript.StartFade(comboDamage); //textObject.GetComponent<BillboardScript>().followCam = isAttacker ? Camera.main : Camera.main; //TODO: Change }
/// <summary> /// Creates fading text effect. (Requires screen overlay canvas) /// </summary> /// <param name="pos"> The world space position of object. </param> /// <param name="text"> The text component of effect. </param> /// <param name="clr"> The color of text. </param> public void CreateFadingText(Vector2 pos, string text, Color clr) { // Create fading text and set its position from world space to screen space. GameObject tmp = Instantiate(fadingText) as GameObject; tmp.transform.SetParent(worldSpaceCanvas.transform, false); Vector3 uiPos = Camera.main.WorldToScreenPoint(pos); tmp.transform.position = uiPos; // Setup text properties. FadingText ft = tmp.GetComponent <FadingText>(); TextMeshProUGUI tMesh = tmp.GetComponent <TextMeshProUGUI>(); ft.SetText(tMesh, text); ft.SetColor(tMesh, clr); }
void Start() { text = transform.Find("ReminderText").GetComponent <FadingText>(); player = Managers.PlayerManager.Instance.GetPlayer(); }
private void Awake() { m_text = GetComponent <FadingText>(); }