Exemplo n.º 1
0
 /// <summary>
 /// Applied after OnSpawn runs.
 /// </summary>
 internal static void Postfix(PumpingStationGuide __instance)
 {
     if (__instance != null)
     {
         __instance.gameObject.AddOrGet <PumpingStationUpdater>();
     }
 }
Exemplo n.º 2
0
 internal static void RenderEveryTick(PumpingStationGuide instance, float dt)
 {
     _ = instance;
     _ = dt;
     // Dummy code to ensure no inlining
     while (System.DateTime.Now.Ticks > 0L)
     {
         throw new NotImplementedException("Reverse patch stub");
     }
 }
Exemplo n.º 3
0
 private void ConsumeMass()
 {
     if (amountPerTick > 0f)
     {
         float a = Mathf.Min(amountPerTick, amountToPickup - consumedAmount);
         a = Mathf.Max(a, 1f);
         HandleVector <Game.ComplexCallbackInfo <Sim.MassConsumedCallback> > .Handle handle = Game.Instance.massConsumedCallbackManager.Add(OnSimConsumeCallback, this, "LiquidPumpingStation");
         int gameCell = Grid.OffsetCell(cell, new CellOffset(0, -PumpingStationGuide.GetDepthAvailable(cell, pump)));
         SimMessages.ConsumeMass(gameCell, element, a, 3, handle.index);
     }
 }
Exemplo n.º 4
0
    private void RefreshDepthAvailable()
    {
        int num  = PumpingStationGuide.GetDepthAvailable(Grid.PosToCell(this), base.gameObject);
        int num2 = 4;

        if (num > depthAvailable)
        {
            KAnimControllerBase component = GetComponent <KAnimControllerBase>();
            for (int i = 1; i <= num2; i++)
            {
                component.SetSymbolVisiblity("pipe" + i.ToString(), i <= num);
            }
            PumpingStationGuide.OccupyArea(base.gameObject, num);
            depthAvailable = num;
        }
    }
    private static void AddGuide(GameObject go, bool occupy_tiles)
    {
        GameObject gameObject = new GameObject();

        gameObject.transform.parent = go.transform;
        gameObject.transform.SetLocalPosition(Vector3.zero);
        KBatchedAnimController kBatchedAnimController = gameObject.AddComponent <KBatchedAnimController>();

        kBatchedAnimController.Offset    = go.GetComponent <Building>().Def.GetVisualizerOffset();
        kBatchedAnimController.AnimFiles = new KAnimFile[1]
        {
            Assets.GetAnim(new HashedString("waterpump_kanim"))
        };
        kBatchedAnimController.initialAnim    = "place_guide";
        kBatchedAnimController.visibilityType = KAnimControllerBase.VisibilityType.OffscreenUpdate;
        kBatchedAnimController.isMovable      = true;
        PumpingStationGuide pumpingStationGuide = gameObject.AddComponent <PumpingStationGuide>();

        pumpingStationGuide.parent      = go;
        pumpingStationGuide.occupyTiles = occupy_tiles;
    }