Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - greigy

Pages: [1]
1
NGUI 3 Support / Re: 2D UI Zooming on click
« on: March 22, 2019, 05:26:17 PM »
Hi, I am encountering a similar bug, although I cannot use the demo scenes.


What was the name of the script to edit so that I can use nGUI again?

2
NGUI 3 Support / Re: Controlling NGUI lables from one script.
« on: February 20, 2015, 06:28:09 PM »
My fault for looking at the same code for too long!

- thanks

3
NGUI 3 Support / Re: Controlling NGUI lables from one script.
« on: February 19, 2015, 05:43:07 PM »
Hi,

what you have posted would be the next step, but...

it already calculates the seconds and mins. If you run the code and check the console, you will see the seconds ticking down.

What it is NOT DOING is updating the NGUI labels for seconds. Sorry if I wasn't clear before.

4
NGUI 3 Support / Controlling NGUI lables from one script.
« on: February 19, 2015, 01:32:19 AM »
The following is a script that I am in the process of creating for the purposes of a count down timer. For the sake of alignment and effects, I have created three labels as individual parts, but am seemingly unable to update the seconds. By disabling (commenting out) the minutes, the seconds are updated. - I have got rid of the milsec calcs to make sure they aren't influencing anything.

So what I need is a way to make all three update - or my mistake pointed out...


  1. using UnityEngine;
  2. using System.Collections;
  3. using System;
  4.  
  5. public class EHBoardTimer : MonoBehaviour {
  6.  
  7.         public UILabel theMilliSeccondsCounter;
  8.         public UILabel theSeccondsCounter;
  9.         public UILabel theMinutesCounter;
  10.         public float levelTime = 150.0f;
  11.  
  12.         private float startTime = 0.0f;
  13.         private float theDeltaTime = 0.0f;
  14.  
  15.         private float theMinutes = 0.0f;
  16.         private float theSecconds = 0.0f;
  17.         private float theMillisecconds = 0.0f;
  18.  
  19.         // Use this for initialization
  20.         void Start ()
  21.         {
  22.                 startTime = Time.time;
  23.        
  24.         }
  25.        
  26.         // Update is called once per frame
  27.         void Update ()
  28.         {
  29.                 theDeltaTime = Time.time - startTime;
  30.                 theDeltaTime = levelTime - theDeltaTime;
  31.  
  32.                 // get milliseconds to two dp by removing truncated value
  33.                 //theDeltaTime = (float)Math.Round((double)theDeltaTime, 2);
  34.                 //theMillisecconds = theDeltaTime - Mathf.Round(theDeltaTime);
  35.                 theDeltaTime = Mathf.Round(theDeltaTime);
  36.  
  37.                 // get secconds
  38.                 theSecconds = theDeltaTime %60;
  39.                 Debug.Log(theSecconds);
  40.  
  41.                 // get minutes
  42.                 theMinutes = theDeltaTime / 60;
  43.                 theMinutes = Mathf.Round(theMinutes);
  44.  
  45.                 // write to screen
  46.                 theMilliSeccondsCounter.text = theMillisecconds.ToString();
  47.                 theMinutesCounter.text = theSecconds.ToString();
  48.                 theMinutesCounter.text = theMinutes.ToString();
  49.         }
  50. }
  51.  

Pages: [1]