public static GameCondition MakeCondition(GameConditionDef def, int duration = -1, int startTickOffset = 0)
        {
            GameCondition gameCondition = (GameCondition)Activator.CreateInstance(def.conditionClass);

            gameCondition.startTick = Find.TickManager.TicksGame + startTickOffset;
            gameCondition.def       = def;
            gameCondition.Duration  = duration;
            gameCondition.PostMake();
            return(gameCondition);
        }
示例#2
0
        public static GameCondition MakeCondition(GameConditionDef def, int duration = -1)
        {
            GameCondition obj = (GameCondition)Activator.CreateInstance(def.conditionClass);

            obj.startTick = Find.TickManager.TicksGame;
            obj.def       = def;
            obj.Duration  = duration;
            obj.uniqueID  = Find.UniqueIDsManager.GetNextGameConditionID();
            obj.PostMake();
            return(obj);
        }