コード例 #1
0
    protected override IEnumerator OnEnableObjectCoroutine()
    {
        while (true)
        {
            _listDestroyIndex.Clear();
            int iUpdateObjectCount = 0;
            int iListCount         = g_listObject.Count;
            for (int i = 0; i < iListCount; i++)
            {
                IUpdateAble pUpdateAble = g_listObject[i];
                if (pUpdateAble.IUpdateAble_IsRequireUpdate())
                {
                    pUpdateAble.OnUpdate();
                    ++iUpdateObjectCount;
                }
            }

            //for(int i = 0; i < _listDestroyIndex.Count; i++)
            //    g_listObject.RemoveAt(_listDestroyIndex[i]);


#if UNITY_EDITOR
            if (iUpdateObjectCount != _iPrevObjectCount)
            {
                _iPrevObjectCount = iUpdateObjectCount;
                name = string.Format("업데이트 매니져/{0}개 업데이트중", iUpdateObjectCount);
            }
#endif

            yield return(null);
        }
    }
コード例 #2
0
ファイル: Timer.cs プロジェクト: ashleydl/BLueC_CLockDisplay
 public Timer(IUpdateAble nextDisplay, IUpdateAble clock)
 {
     // we willen elke seconde een update
     timeoutInMillisecons = 1000;
     this.nextDisplay     = nextDisplay;
     this.clock           = clock;
 }
コード例 #3
0
    public void DoRemoveObject(IUpdateAble pObject)
    {
        if (g_setUpdateObject.Contains(pObject) == false)
        {
            return;
        }

        g_setUpdateObject.Remove(pObject);
        g_listObject.Remove(pObject);

#if UNITY_EDITOR
        _listObject_ForDebug.Remove(pObject);
#endif
    }
コード例 #4
0
    // ========================================================================== //

    /* public - [Do] Function
     * 외부 객체가 호출(For External class call)*/

    public void DoAddObject(IUpdateAble pObject)
    {
        if (g_setUpdateObject.Contains(pObject))
        {
            return;
        }

        g_setUpdateObject.Add(pObject);
        g_listObject.AddLast(pObject);

#if UNITY_EDITOR
        _listObject_ForDebug.Add(pObject);
#endif
    }
コード例 #5
0
    // ========================================================================== //

    /* public - [Do] Function
     * 외부 객체가 호출(For External class call)*/

    public void DoAddObject(IUpdateAble pObject, bool bForceAdd = false)
    {
        if (g_setUpdateObject.Contains(pObject))
        {
            if (bForceAdd)
            {
                g_setUpdateObject.Remove(pObject);
            }
            else
            {
                return;
            }
        }

        g_setUpdateObject.Add(pObject);
        g_listObject.Add(pObject);

#if UNITY_EDITOR
        _listObject_ForDebug.Add(pObject);
#endif
    }
コード例 #6
0
    protected override IEnumerator OnEnableObjectCoroutine()
    {
        while (true)
        {
            _listDestroyIndex.Clear();

            float fDeltaTime         = Time.deltaTime;
            int   iUpdateObjectCount = 0;
            int   iListCount         = g_listObject.Count;
            for (int i = 0; i < iListCount; i++)
            {
                IUpdateAble pUpdateAble = g_listObject[i];

                bool  bIsUpdate  = false;
                float fTimeScale = 1f;
                pUpdateAble.IUpdateAble_GetUpdateInfo(ref bIsUpdate, ref fTimeScale);
                if (bIsUpdate)
                {
                    pUpdateAble.OnUpdate(fTimeScale);
                    ++iUpdateObjectCount;
                }
            }

            //for(int i = 0; i < _listDestroyIndex.Count; i++)
            //    g_listObject.RemoveAt(_listDestroyIndex[i]);


#if UNITY_EDITOR
            if (iUpdateObjectCount != _iPrevObjectCount)
            {
                _iPrevObjectCount = iUpdateObjectCount;
                name = string.Format("업데이트 매니져/{0}개 업데이트중", iUpdateObjectCount);
            }
#endif

            yield return(null);
        }
    }
コード例 #7
0
        public NumberDisplay(int modules, IUpdateAble nextNumberDisplay)
        {
            this.modules = modules;

            this.nextNumberDisplay = nextNumberDisplay;
        }
コード例 #8
0
 public void DoRemoveObject(IUpdateAble pObject)
 {
     _listObject.Remove(pObject);
 }
コード例 #9
0
    // ========================================================================== //

    /* public - [Do] Function
     * 외부 객체가 호출(For External class call)*/

    public void DoAddObject(IUpdateAble pObject)
    {
        _listObject.Add(pObject);
    }