示例#1
0
            void _Show(timer t)
            {
                if (_avi != _tv._avi || _i != _tv._hotIndex)
                {
                    return;
                }
                if (_tt == null)
                {
                    _tt = new ToolTip()
                    {
                        PlacementTarget  = _tv,                        //need for correct DPI in non-primary screen
                        Placement        = PlacementMode.Right,
                        HorizontalOffset = 4,
                        HasDropShadow    = false                      //why no shadow on Win10?
                    };
                    if (osVersion.minWin8)
                    {
                        _tt.Padding = new Thickness(2, -1, 2, 1);                                        //on Win7 makes too small
                    }
                }
                var r = _tv.GetRectLogical(_i, clampX: true);

                r.X -= 4; r.Width += 4;
                _tt.PlacementRectangle = r;
                _tt.Content            = _avi[_i].item.DisplayText;
                _tt.IsOpen             = true;
            }
示例#2
0
	void Awake () {
		timer = timerObj.GetComponent<timer>();
		clearText = GameObject.Find("ClearText").GetComponent<GUIText>();
		isPlaying = true;
		isClear = false;
		isGameOver = false;
	}
示例#3
0
    public timer AddTimer(float duration, EventManager.voidHandle func, int loopTime = 1)
    {
        timer m_timer = new timer(duration, loopTime, func);

        timerList.Add(m_timer);
        return(m_timer);
    }
示例#4
0
 private void Start()
 {
     tim = transform.root.GetComponentInChildren<timer>();
     m_Rigidbody = GetComponent<Rigidbody>();
     startpos = transform.position;
     startrot = transform.rotation;
 }
示例#5
0
        static void Main(string[] args)
        {
            timer t = new timer();

            t.hour = 54;
            Console.WriteLine(t.day());
        }
示例#6
0
文件: timer.cs 项目: kkaren/ES2016B
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
示例#7
0
    public void displayMenu(string s)
    {
        timer          playerTimer   = carObj.GetComponent <timer>();
        CarController  carController = carObj.GetComponent <CarController>();
        CarUserControl carUser       = carObj.GetComponent <CarUserControl>();

        // Slow down Car
        carController.m_FullTorqueOverAllWheels = 0;
        carController.m_Topspeed = 20;

        // Disable Controls and Time
        carUser.isEnabled = false;
        carObj.GetComponent <timer>().enabled = false;

        // Convert time
        float playerBestTime = playerTimer.time;
        int   minutes        = Mathf.FloorToInt(playerBestTime / 60F);
        int   seconds        = Mathf.FloorToInt(playerBestTime - minutes * 60);

        // Set text to UI
        stateText.SetText(s);
        yourTime.text   = string.Format("{0:00}:{1:00}", minutes, seconds);
        targetText.text = string.Format("{0:00}:{1:00}", playerTimer.minutes2, playerTimer.seconds2);
        panel.SetActive(true);
    }
示例#8
0
 void Awake()
 {
     time = GameObject.Find("Timer").GetComponent <timer>();
     end  = false;
     win  = false;
     lose = false;
 }
示例#9
0
    void reduceTimer(float reduceTime)
    {
        timer playerTimer = this.GetComponent <timer>();

        playerTimer.time -= reduceTime;
        check             = true;
    }
示例#10
0
文件: Motor.cs 项目: shuvo70/superCar
 private void Start()
 {
     tim         = transform.root.GetComponentInChildren <timer>();
     m_Rigidbody = GetComponent <Rigidbody>();
     startpos    = transform.position;
     startrot    = transform.rotation;
 }
示例#11
0
    public void NextRound()
    {
        Debug.Log("Reinicio juego " + round);

        round++;

        DestroyObjects();

        if (round < 6)
        {
            //Now re-create them
            initMap();
            timer c = GameObject.FindObjectOfType(typeof(timer)) as timer;
            c.ResetTimer();
        }
        else
        {
            if (pl1_score == pl2_score)
            {
                initMap();
            }
            else
            {
                //Game Ends
                GoToWinScreen();
            }
        }
    }
示例#12
0
    void OnTriggerEnter2D()
    {
        GameObject ob           = GameObject.Find("Text");
        timer      playerScript = ob.GetComponent <timer>();

        timerText.text = playerScript.min + ":" + playerScript.sec;
        completeLevelUI.SetActive(true);
    }
    // Use this for initialization
    void Start()
    {
        Button btn = someButton.GetComponent <Button> ();

        btn.onClick.AddListener(clicked);
        enemy     = FindObjectOfType <randomEnemy> ();
        timeReset = FindObjectOfType <timer> ();
    }
示例#14
0
 private void button1_Click(object sender, EventArgs e)
 {
     mytimer          = new timer();
     mytimer.elipse  += Elipse;
     mytimer.Interval = 1000;
     mytimer.Enable   = true;
     mytimer.start(this);
 }
示例#15
0
    public void RestartGame()
    {
        Debug.Log("RESTART");
        //EditorApplication.isPlaying = false;
        timer gameTimer = GameObject.FindWithTag("timer").GetComponent <timer>();

        Debug.Log("RESTART");
        gameTimer.restart(0.2f);
    }
示例#16
0
 // Start is called before the first frame update
 void Start()
 {
     horse       = GameObject.FindObjectOfType <Horse>();
     Timer       = GameObject.FindObjectOfType <timer>();
     waitValue   = shootWait;
     HunterSpawn = GameObject.FindGameObjectWithTag("HunterSpawn");
     gameObject.transform.position = HunterSpawn.transform.position;
     bulletText.text = numberOfShots.ToString();
 }
示例#17
0
        public Message(player player, int recipient, string message)
        {
            _timer     = CreateTimer();
            _player    = player;
            _recipient = recipient;
            _message   = message;

            _timerRunning = false;
            _disposing    = false;
        }
示例#18
0
    void OnCollisionEnter(Collision other)
    {
        if (other.gameObject.tag == "Player")
        {
            timingz = FindObjectOfType <timer>();

            //timingz.timeIncrease ();
            Destroy(gameObject);
        }
    }
示例#19
0
    public static void GuardarDatos(timer datos)
    {
        BinaryFormatter formatter          = new BinaryFormatter();
        string          path               = Application.persistentDataPath + "/gameStats.data";
        FileStream      stream             = new FileStream(path, FileMode.Create);
        statsData       datosSerializables = new statsData(datos);

        formatter.Serialize(stream, datosSerializables);
        stream.Close();
    }
示例#20
0
    void OnMouseDown()
    {
        timer timer = scoreCounter.GetComponent <timer> ();

        score_counter scorecnt = scoreCounter.GetComponent <score_counter>();

        scorecnt.playWrongPlasmidAudioClip();

        timer.DecreaseTime();
    }
示例#21
0
    private void Awake()
    {
        // get the car controller reference
        m_CarController = GetComponent <Motor>();

        // give the random perlin a random value
        m_RandomPerlin = Random.value * 100;

        m_Rigidbody = GetComponent <Rigidbody>();
        tim         = transform.root.GetComponentInChildren <timer>();
    }
    private void OnTriggerEnter(Collider colReg) // Will be replaced with ice spell usage, but for now this is to test
    {
        if (colReg.gameObject.tag == "Player")
        {
            Debug.Log("Looks like water to me");
            waterBlockColliderCheck.enabled = false;

            iceTimer = new timer(countDown, Time.time); // Creates new timer
            //turn the water into ice
        }
    }
 // Update is called once per frame
 void FixedUpdate()
 {
     if (iceTimer.waitTime != 0)
     {
         if (iceTimer.checkTimer(Time.time))
         {
             iceTimer = new timer(0, 0f);
             waterBlockColliderCheck.enabled = true;
         }
     }
 }
示例#24
0
 public void RemoveTimer(timer m_timer)
 {
     if (m_timer == null)
     {
         return;
     }
     if (timerList.Contains(m_timer))
     {
         timerList.Remove(m_timer);
     }
 }
示例#25
0
        private void Awake()
        {
            // get the car controller reference
            m_CarController = GetComponent<Motor>();

            // give the random perlin a random value
            m_RandomPerlin = Random.value * 100;

            m_Rigidbody = GetComponent<Rigidbody>();
            tim = transform.root.GetComponentInChildren<timer>();
        }
示例#26
0
    public void saveTime(int id)
    {
        timer       t      = FindObjectOfType <timer>();
        TimeSpan    time   = t.timeElapsed;
        string      toSave = time.ToString().Substring(3, 9);
        GameManager gm     = (GameManager)FindObjectOfType(typeof(GameManager));

        if (gm.save.times[id] > (float)time.TotalMilliseconds)
        {
            gm.updateScores(id, (float)time.TotalMilliseconds, toSave);
        }
    }
示例#27
0
    // Use this for initialization
    void Start()
    {
        player = new DefultPlayer();

        m_wait_for_next_move = new timer(SPEED);
        position             = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <positions>();
        position_index       = 0;
        Vector3 player_pos = transform.position;

        player_pos.x       = position.position_values[position_index];
        transform.position = player_pos;
    }
示例#28
0
 void Awake()                   //Makes this a singleton class on awake
 {
     if (instance == null)      //Does an instance already exist?
     {
         instance = this;       //If not set instance to this
     }
     else if (instance != this) //If it already exists and is not this then destroy this
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);          //Set this to not be destroyed when reloading scene
 }
示例#29
0
 // Private methods
 private void Init()
 {
     blocks      = GameObject.FindGameObjectWithTag("Blocks").GetComponent <blocks>();
     target      = GameObject.FindGameObjectWithTag("Target").GetComponent <target>();
     sum         = GameObject.FindGameObjectWithTag("Sum").GetComponent <sum>();
     combo       = GameObject.FindGameObjectWithTag("Combo").GetComponent <combo>();
     timer       = GameObject.FindGameObjectWithTag("Timer").GetComponent <timer>();
     lifes_score = GameObject.FindGameObjectWithTag("LifesScore").GetComponent <lifes_score>();
     game_over   = GameObject.FindGameObjectWithTag("GameOver").GetComponent <game_over>();
     stage       = GameObject.FindGameObjectWithTag("Stage").GetComponent <stage>();
     refresh     = GameObject.FindGameObjectWithTag("Refresh").GetComponent <refresh>();
 }
示例#30
0
    void _ShowTextPopup(timer t)
    {
        var ci   = t.Tag as CiComplItem;
        var text = _compl.GetDescriptionDoc(ci, 0);

        if (text == null)
        {
            return;
        }
        _textPopup.Text        = text;
        _textPopup.OnLinkClick = (ph, e) => ph.Text = _compl.GetDescriptionDoc(ci, e.ToInt(1));
        _textPopup.Show(Panels.Editor.ZActiveDoc, _popup.Hwnd.Rect, Dock.Right);
    }
示例#31
0
    void Start () {

        SpaceKey = false;
        GameObject ESObject = GameObject.Find("EnemySpawnObject");//EnemySpawnObjectのオブジェクト取得
        ES = ESObject.GetComponent<enemySpawn>(); //EnemySpawnObjectオブジェクトの中のenemySpawnスクリプトを取得
        tm= GameObject.Find("TimerObject").GetComponent<timer>();
        tm.setTime(0.0f);
        point = playtime / 3;
        state = 0;
        clear = false;
        ES.Espeed = 0.0f;
        GameObject.Find("Main Camera").GetComponent<AudioSource>().Play();
    }
示例#32
0
    void OnTriggerEnter(Collider hit)
    {
        if (hit.tag.Equals("Checkpoint") && !check)
        {
            reduceTimer(5);
        }

        else if (hit.tag.Equals("resetEnter"))
        {
            check = false;
        }

        else if (hit.tag.Equals("Checkpoint2") && !check)
        {
            lapCheck = true;
            reduceTimer(5);
        }
        else if (hit.tag.Equals("lap") && lapCheck)
        {
            timer playerTimer = this.GetComponent <timer>();

            lap     += 1;
            lapCheck = false;
            if (lap <= 3)
            {
                reduceTimer(10);
                currentLap.SetText(lap + "/3");
            }
            check = false;

            if (lap > 3 && playerTimer.time < playerTimer.targetTime)
            {
                panel1.GetComponent <menuDisplay>().displayMenu("Mission Success!");
            }
            else if (lap > 3 && playerTimer.time > playerTimer.targetTime)
            {
                panel1.GetComponent <menuDisplay>().displayMenu("Mission Failed!");
            }


            //Reset lap
            // if (playerTimer.time < bestLap || bestLap == 0f){
            //  bestLap = playerTimer.time;
            //  playerTimer.time = 0;
            //  Debug.Log(bestLap);
            //  int minutes = Mathf.FloorToInt(bestLap / 60F);
            //  int seconds = Mathf.FloorToInt(bestLap - minutes * 60);
            //  bestLapLabel.text = string.Format("{0:00}:{1:00}", minutes, seconds);
            // }
        }
    }
示例#33
0
        static void main(string[] args)
        {
            int y;

            a = 10; b = 7;
            c = 15; d = 3;
            TimerCallback tc      = new TimeCallback(CheckTime);
            Thread        thread1 = new Thread(new ThreadStart(Program.Threadfunc1));
            Thread        thread2 = new Thread(new ThreadStart(Program.Threadfunc2));
            Thread        thread3 = new Thread(new ThreadStart(Program.Threadfunc3));
            Thread        thread4 = new Thread(new ThreadStart(Program.Threadfunc4));
            Timer         t       = new timer(tc, null, 0, 1000);

            Console.WriteLine("thread1.ThreadState=" + thread1.ThreadState);
            Console.WriteLine("thread2.ThreadState=" + thread2.ThreadState);
            Console.WriteLine("thread3.ThreadState=" + thread3.ThreadState);
            Console.WriteLine("thread4.ThreadState=" + thread4.ThreadState);
            thread1.start();
            thread2.start();

            Console.WriteLine("thread1.ThreadState=" + thread1.ThreadState);
            Console.WriteLine("thread2.ThreadState=" + thread2.ThreadState);
            Console.WriteLine("thread3.ThreadState=" + thread3.ThreadState);
            Console.WriteLine("thread4.ThreadState=" + thread4.ThreadState);
            thread1.join();
            thread2.join();

            Console.WriteLine("new threads ending");
            Console.WriteLine("y1=" + y1);
            Console.WriteLine("y2=" + y2);

            thread3.start();
            thread4.Start();
            Console.WriteLine("thread1.ThreadState=" + thread1.ThreadState);
            Console.WriteLine("thread2.ThreadState=" + thread2.ThreadState);
            Console.WriteLine("thread3.ThreadState=" + thread3.ThreadState);
            Console.WriteLine("thread4.ThreadState=" + thread4.ThreadState);

            thread3.join();
            thread4.join();

            Console.WriteLine("new threads ending");
            Console.WriteLine("y3=" + y3);
            Console.WriteLine("y4=" + y4);

            Thread.sleep(2000);
            y = y3 + y4;
            Console.WriteLine("y=" + y);
            t.dispose();
            Console.ReadLine();
        }
示例#34
0
 public void timer(Control ctr)
 {
     if (ctr.InvokeRequired)
     {
         timer st = new timer(timer);
         ctr.Invoke(st, ctr);
     }
     else
     {
         System.Windows.Forms.Timer t = new System.Windows.Forms.Timer();
         t.Enabled  = true;
         t.Interval = 1000;
         t.Tick    += new EventHandler(timer1_Tick);
         t.Start();
     }
 }
示例#35
0
文件: song.cs 项目: MikeLorry/Gitaroo
	// Use this for initialization
	void Start () {

		speed = 0.5f;
		dist = 30.0f;
		timeSpeed = Time.fixedDeltaTime;
		spawnDelay = (dist / speed) * timeSpeed;
		
		defBlocks.Add (new DefBlockTrigger ("left",4.00f));
		defBlocks.Add (new DefBlockTrigger ("right",4.25f));
		defBlocks.Add (new DefBlockTrigger ("right",5.00f));
		defBlocks.Add (new DefBlockTrigger ("up",6.00f));
		defBlocks.Add (new DefBlockTrigger ("up",6.20f));
		defBlocks.Add (new DefBlockTrigger ("down",6.50f));
		defBlocks.Add (new DefBlockTrigger ("down",7.00f));

		spawnList = GetSpawnList (defBlocks);

		GameObject timer = GameObject.Find("timer");
		timerScript = timer.GetComponent<timer>();
		timerScript.ResetTimer ();

	}
示例#36
0
	void Awake() {
		timer = GameObject.Find("TimerObject").GetComponent<timer>();
	}
示例#37
0
 void Start()
 {
     timeCounter = GameObject.FindGameObjectWithTag ("Player").GetComponent<timer> ();
     HiScore.text = PlayerPrefs.GetFloat (hiScoreKey).ToString ("F2");
 }
示例#38
0
        protected override DHJassValue Run()
        {
            trigger trigger = args["whichTrigger"].HandleValue as trigger;
            if (trigger == null) return new DHJassHandle(null, 0);

            timer timer = new timer();

            triggerevent tevent = new triggerevent(trigger, timer);
            timer.SetCallback(tevent.OnEvent);

            timer.start(args["timeout"].RealValue, args["periodic"].BoolValue);

            return new DHJassHandle(null, tevent.handle);
        }
示例#39
0
 protected override DHJassValue Run()
 {
     timer t = new timer();
     return new DHJassHandle(null, t.handle);
 }