Пример #1
0
 // Use this for initialization
 void Start()
 {
     multiplier = MULT_START;
     w_dig      = whole.GetComponent <DigitController>();
     f_dig      = fract.GetComponent <DigitController>();
     SetGUI();
 }
 // Use this for initialization
 void Awake()
 {
     coins    = 0;
     hundreds = UIHundreds.GetComponent <DigitController>();
     tens     = UITens.GetComponent <DigitController>();
     ones     = UIOnes.GetComponent <DigitController>();
 }
    void Start()
    {
        enemy        = GameObject.FindObjectOfType <EnemyController> ();
        playerDigits = GameObject.FindGameObjectWithTag("Player").GetComponent <DigitController> ();
        tutorial     = GameObject.FindObjectOfType <TutorialController> ();

        description = gameObject.name;

        digitText       = GetComponentInChildren <Text> ();
        difficultyLevel = PlayerPrefController.GetDifficultyLevel();

        if (difficultyLevel == 1)
        {
            digitText.text = "20";
        }
        else if (difficultyLevel == 2)
        {
            digitText.text = "30";
        }
        else if (difficultyLevel == 3)
        {
            digitText.text = "50";
        }

        digitValue = int.Parse(digitText.text);
    }
Пример #4
0
    // Use this for initialization
    void Start()
    {
        DigitController [] digitControllers = this.GetComponentsInChildren <DigitController> ();
        if (digitControllers != null && digitControllers.Length == 2)
        {
            this.digit1 = digitControllers [0];
            this.digit2 = digitControllers [1];
        }
        else
        {
            Debug.LogWarning("Digits are missing");
        }

        this.trafficLight = this.GetComponentInChildren <TrafficLightController> ();

        this.counter = this.timer;
        this.wall    = this.GetComponent <BoxCollider> ();
        this.InvokeRepeating("DecreaseCounter", 1, 1);
    }
Пример #5
0
    // Use this for initialization
    void Start()
    {
        if (digits.Length != 10)
        {
            Debug.Log("Digits are not set correctly");
        }
        if (startTime >= 600)
        {
            Debug.Log("too long time, max is 600");
            startTime = 599;
        }
        if (startTime < 1)
        {
            Debug.Log("too small time");
            startTime = 1;
        }
        transform.FindChild("Sphere0").gameObject.GetComponent <Renderer> ().material.color = TimeColor;
        transform.FindChild("Sphere1").gameObject.GetComponent <Renderer> ().material.color = TimeColor;

        min   = transform.FindChild("min").gameObject.GetComponent <DigitController>();
        sec_t = transform.FindChild("sec_tenth").gameObject.GetComponent <DigitController>();
        sec_o = transform.FindChild("sec_one").gameObject.GetComponent <DigitController>();
        if (timeGap < timeChange + 0.15f)
        {
            Debug.Log("timeGap should be greater than timeChange");
            timeGap = timeChange + 0.15f;
        }
        min.switch_time   = timeChange;
        sec_t.switch_time = timeChange;
        sec_o.switch_time = timeChange;

        time_show = get_time(startTime);
        rest_time = startTime;
        time_next = startTime - 1;
        min.ChangeTo(digits [time_show / 100], TimeColor);
        sec_t.ChangeTo(digits [time_show % 100 / 10], TimeColor);
        sec_o.ChangeTo(digits [time_show % 10], TimeColor);
        _waiting = timeGap;
    }