void OnEnable()
    {
        localizedReference.key = localizedTextInOrder [count];
        localizedReference.OnUpdate();


        StartCoroutine(FadeInOutBeforeDisable());
        //StartCoroutine (FadeIn ());
    }
    void Update()
    {
        if (time >= 0)
        {
            time -= Time.unscaledDeltaTime * countDownSpeed;


            countingT.text = time.ToString("#");

            countDownTime = (int)time;



            switch (countDownTime)
            {
            case 5:

                countingT.fontSize = 28;
                countingT.text     = "Everything is well";
                localizedText.key  = localizedKeys [0];
                localizedText.OnUpdate();
                break;

            case 3:

                countingT.fontSize = 28;
                countingT.text     = "You are well";
                localizedText.key  = localizedKeys [1];
                localizedText.OnUpdate();
                break;

            case 0:

                countingT.fontSize = 28;
                countingT.text     = "Everything is OKAY!";
                localizedText.key  = localizedKeys [2];
                localizedText.OnUpdate();
                break;

            default:

                countingT.fontSize = 100;
                break;
            }
        }
        else
        {
            time = 10.0f;
        }
    }
Example #3
0
    void Start()
    {
        trackText     = GetComponent <Text> ();
        localizedText = GetComponent <LocalizedText> ();

        //while(!LocalizationManager.Instance.GetIsReady())
        localizedText.OnUpdate();
        trackText.text += " " + AudioManager.Instance.GetCurrentTrackName();
    }
    void Start()
    {
        thisTransform = transform;

        localizationText = GameScoreText.GetComponent <LocalizedText> ();
        localizationText.OnUpdate();
        spawnLocations = new Transform[transform.childCount];
        for (int i = 0; i < transform.childCount; i++)
        {
            spawnLocations[i] = transform.GetChild(i);
        }

        spawnSpeed = startSpawnSpeed;
        gameOverCanvas.SetActive(false);
    }
Example #5
0
    public void OnUpdateTrackName()
    {
//	IEnumerator Start () {


        trackText.text = string.Empty;
        localizedText.OnUpdate();

        //	while (true) {

        //yield return null;
        //Debug.Log ("testing this track");
        trackText.text += " " + AudioManager.Instance.GetCurrentTrackName();                //MusicController.Instance.GetCurrentTrackName();
        //if I leave space, text does not show up and cannot use yield return WaitForSeconds ???
    }
Example #6
0
    //Coroutitive;
    //private bool isResetTime;
    //public void TriggerInfo(){

    //	Debug.Log ("TRIGGERINGINFO");
    //	onInfoEnable.Invoke ();

    //	infoCanvasPrefab.SetActive (true);
    //	infoCanvasAnimator.SetBool ("IsActive", true);
    //	//infoActive =
    //		StartCoroutine (InfoActive ());


    //}


    //public float timerForActivation;
    //public IEnumerator InfoActive(){

    //	timerForActivation = timeActive;

    //	float time = 0;


    //	while (true) {

    //		time += Time.deltaTime;



    //		if (!isAutomaticRotation) {
    //			infoCanvasPrefab.transform.localRotation = Quaternion.AngleAxis (yInfoRotationOffset, Vector3.up);
    //			infoCanvasPrefab.transform.localRotation *= Quaternion.AngleAxis (xInfoRotationOffset, Vector3.right);
    //			infoCanvasPrefab.transform.localRotation *= Quaternion.AngleAxis (zInfoRotationOffset, Vector3.forward);

    //		} else {
    //			yield return new WaitForEndOfFrame ();
    //			infoCanvasPrefab.transform.LookAt (player.position, Vector3.up);
    //			infoCanvasPrefab.transform.localRotation *= Quaternion.AngleAxis (180, Vector3.up);
    //			if (isAutomaticStayUpRight) {
    //				infoCanvasPrefab.transform.eulerAngles = new Vector3 (0, infoCanvasPrefab.transform.eulerAngles.y, infoCanvasPrefab.transform.eulerAngles.z);

    //			}
    //		}


    //		if (time > timerForActivation) {
    //			infoCanvasAnimator.SetBool ("IsActive", false);

    //			if (infoCanvasAnimator.GetCurrentAnimatorStateInfo(0).IsName("Idle") || isUseQuickDisable)
    //			 {
    //				onInfoDisable.Invoke ();
    //				infoCanvasPrefab.SetActive (false);
    //				timerForActivation = timeActive;
    //				yield break;
    //			}

    //		}

    //		yield return null;

    //	}
    //}
    //public void TakeOffInfo(){

    //	Debug.Log ("unTRIGGERINGINFO");
    ////	if (infoCanvasPrefab.activeInHierarchy) {

    //		timerForActivation = 0f;

    //	//new10/11/2017
    //	if(isUseQuickDisable)
    //	infoCanvasAnimator.SetBool ("IsActive", false);
    //		/*infoCanvasAnimator.SetBool ("IsActive", false);
    //		if (infoCanvasAnimator.GetCurrentAnimatorStateInfo(0).IsName("Idle"))
    //		{
    //			StopAllCoroutines ();
    //			infoCanvasAnimator.SetBool ("IsActive", false);
    //			infoCanvasPrefab.SetActive (false);
    //			StopCoroutine (InfoActive ());
    //			StopCoroutine (infoActive);

    //			return;
    //		}*/
    ////	}


    //}
    public void SetTextLocalizedKey(string nKey)
    {
        localizedText.key = nKey;
        localizedText.OnUpdate();
    }