예제 #1
0
파일: TestLog.cs 프로젝트: hbpp/GearUnity
    // Use this for initialization
    void Start()
    {
        t         = new EnterFrameTimer(200);
        t.OnTimer = onTimer;
        t.Start();

        ConsoleCommand   command;
        CompositeCommand cc = new CompositeCommand(CompositeCommandMode.SEQUENCE);

        cc.OnCommandItemComplete = delegate(AbstractCommand _command) {
            Debug.Log("Item Complete" + " " + (_command as ConsoleCommand).index.ToString());
        };
        cc.OnCommandComplete = delegate(AbstractCommand _command) {
            Debug.Log("All Complete");
        };
        int max = 10;

        for (int i = 0; i < max; i++)
        {
            command       = new ConsoleCommand();
            command.index = i;
            cc.AddCommand(command);
        }

        cc.Execute();
    }
예제 #2
0
    public static void SetTimeOut(uint delay, OnTimeOutDelegate OnTimeOut)
    {
        EnterFrameTimer timer = new EnterFrameTimer(delay, 1);

        timer.OnComplete = delegate() {
            timer.Stop();
            if (OnTimeOut != null)
            {
                OnTimeOut();
            }
        };
        timer.Start();
    }
예제 #3
0
파일: TestLog.cs 프로젝트: Assin/GearUnity
	// Use this for initialization
	void Start(){
		t = new EnterFrameTimer(200);
		t.OnTimer = onTimer;
		t.Start();

		ConsoleCommand command;
		CompositeCommand cc = new CompositeCommand(CompositeCommandMode.SEQUENCE);
		cc.OnCommandItemComplete = delegate(AbstractCommand _command) {
			Debug.Log("Item Complete" + " " + (_command as ConsoleCommand).index.ToString());
		};
		cc.OnCommandComplete = delegate(AbstractCommand _command) {
			Debug.Log("All Complete");
		};
		int max = 10;
		for (int i = 0; i < max; i++) {
			command = new ConsoleCommand();
			command.index = i;
			cc.AddCommand(command);
		}

		cc.Execute();

	}
예제 #4
0
	public static void SetTimeOut(uint delay, OnTimeOutDelegate OnTimeOut){
		EnterFrameTimer timer = new EnterFrameTimer(delay, 1);
		timer.OnComplete = delegate() {
			timer.Stop();
			if(OnTimeOut != null)
			{
				OnTimeOut();
			}
		};
		timer.Start();
	}