Exemplo n.º 1
0
        private V_Object(V_Main.UpdateType updateType)
        {
            V_Main.Init();
            instanceList.Add(this);
            id = GetNextId();

            this.updateType = updateType;

            isDestroyed = false;
            isDisabled  = false;

            activeLogicArr     = new V_IObjectActiveLogic[0];
            activeLogicArrCopy = new V_IObjectActiveLogic[0];

            allLogicList = new List <V_IObjectActiveLogic>();

            relatedObjectList = new List <object>();

            logicListDic = new Dictionary <Type, List <object> >();
            logicDic     = new Dictionary <Type, object>();

            GetPosition  = delegate() { return(Vector3.zero); };
            GetTransform = delegate() { return(null); };

            deltaTimeModifier = V_TimeScaleManager.GetTimeScale();
        }
Exemplo n.º 2
0
        public static void Init()
        {
            if (monoBehaviourHook != null)
            {
                // Already initialized
                return;
            }
            V_TimeScaleManager.Init();

            updateTypeArr = (UpdateType[])Enum.GetValues(typeof(UpdateType));

            updateTimeModDic = new Dictionary <UpdateType, float>();

            onUpdateListTypeDic     = new Dictionary <UpdateType, List <DelUpdate> >();
            onLateUpdateListTypeDic = new Dictionary <UpdateType, List <DelUpdate> >();

            foreach (UpdateType updateType in updateTypeArr)
            {
                updateTimeModDic[updateType] = 1f;

                onUpdateListTypeDic[updateType]     = new List <DelUpdate>();
                onLateUpdateListTypeDic[updateType] = new List <DelUpdate>();
            }

            GameObject gameObject = new GameObject("V_Main_GameObject");

            monoBehaviourHook          = gameObject.AddComponent <MonoBehaviourHook>();
            monoBehaviourHook.OnUpdate = Update;
        }
 public void Update(float deltaTime)
 {
     if (!active)
     {
         return;
     }
     if (useUnscaledDeltaTime)
     {
         deltaTime /= V_TimeScaleManager.GetTimeScale();
     }
     skeleton.Update(deltaTime);
 }