コード例 #1
0
    public void Update(SystemDataFilter filter)
    {
        Counter counter = filter.GetWritableResc <Counter>();

        counter.current++;
        filter.SetWritableResc(counter);
    }
コード例 #2
0
    public void Update(SystemDataFilter filter)
    {
        Time time = filter.GetWritableResc <Time>();

        if (time.initialized)
        {
            time.deltaTime = DateTime.Now.Millisecond - time.lastTime;
            time.lastTime  = DateTime.Now.Millisecond;
            time.total    += time.deltaTime;
        }
        else
        {
            time.lastTime    = DateTime.Now.Millisecond;
            time.total       = 0;
            time.deltaTime   = 0;
            time.initialized = true;
        }
        filter.SetWritableResc <Time>(time);
    }