Esempio n. 1
0
 /// <summary>
 /// Invoked after the terrain heights have been modified
 /// Thread: Simulation
 /// </summary>
 /// <param name="minX">Minimum X coord of modification.</param>
 /// <param name="minZ">Minimum Z coord of modification.</param>
 /// <param name="maxX">Maximum X coord of modification.</param>
 /// <param name="maxZ">Maximum Z coord of modification.</param>
 public void OnAfterHeightsModified(float minX, float minZ, float maxX, float maxZ)
 {
     terrainCallbacks.Call(new TerrainCallbackParam {
         minX = minX,
         minZ = minZ,
         maxX = maxX,
         maxZ = maxZ,
     });
 }
Esempio n. 2
0
        /// <summary>
        /// Called once per rendered frame.
        /// Thread: Main
        /// </summary>
        /// <param name="realTimeDelta">Seconds since previous frame.</param>
        /// <param name="simulationTimeDelta">Smoothly interpolated to be used
        /// from main thread. On normal speed it is roughly same as realTimeDelta.</param>
        public override void OnUpdate(float realTimeDelta, float simulationTimeDelta)
        {
            //Log($"Start frame callbacks, dt={realTimeDelta}, {simulationTimeDelta}");
            frameCallbacks.Call(new FrameCallbackParam {
                realTimeDelta       = realTimeDelta,
                simulationTimeDelta = simulationTimeDelta,
            });
            var now = SimulationManager.instance.m_currentGameTime;

            if (now.Day != lastTime.Day)
            {
                lastTime = now;
                dailyCallbacks.Call(new DailyCallbackParam {
                    time = lastTime,
                });
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Invoked when the game unlocks a tile.
 /// Thread: Simulation
 /// </summary>
 /// <param name="x">The x coordinate.</param>
 /// <param name="z">The z coordinate.</param>
 public void OnUnlockArea(int x, int z)
 {
     unlockAreaCallbacks.Call(new UnlockAreaCallbackParam {
         x = x, z = z
     });
 }