Esempio n. 1
0
 // 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);
 }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
    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
    }
Esempio n. 4
0
            /// <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);
            }
Esempio n. 5
0
 void Start()
 {
     text   = transform.Find("ReminderText").GetComponent <FadingText>();
     player = Managers.PlayerManager.Instance.GetPlayer();
 }
Esempio n. 6
0
 private void Awake()
 {
     m_text = GetComponent <FadingText>();
 }