Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Attack Visualizer
- Awake:
- Creates singleton
- ***_Prefab:
- Some cached Resource.Loads
- Attack:
- Attack creates coroutine AttackIE
- AttackIE:
- Coroutine (runs async)
- Randomizes the start location slightly ->
- Creates a projectile ->
- Colors projectile according to preferences ->
- Sends point data to projectile ->
- Waits for projectile to hit ->
- Creates attack ping at endpoint ->
- Creates explosion at endpoint ->
- Cleans up created gameObjects
- Console
- Controls user input, hooks into [InputLog] and [Timer]
- InputLog
- Implements 'Timed' interface.
- On Awake:
- Creates singleton
- Finds UI.Text
- Begins UpdateTicker coroutine
- On Start:
- Registers ticker
- SetupReader:
- Coroutine (runs async)
- Loop ->
- Batches the next 100 attacks together ->
- Takes their IPs and puts them in a list ->
- Feeds list of IPs into Python ->
- Takes the Lat/Lon from Python and place back into corresponding attack ->
- Places all attacks into Dictionary<Time, List<Attack>>
- Stops when it has buffered a full minute ahead of current Time
- Tick:
- Tick creates coroutine TickIE
- TickIE:
- Coroutine (runs async)
- Takes in the current time
- Removes List<Attack> value according to Time key
- For each Attack in list:
- Displays Log data in one of two formats onto screen
- Calls AttackVisualizer to visualize the attack
- UpdateTicker:
- Coroutine (runs async)
- Makes sure Logger doesn't overflow.
- GetGeoLocation
- { ... }
- LatLong
- Mostly deprecated
- Functions are mostly library-like, so public static.
- Convert:
- Converts a Lat/Lon value into a scaled normalized XYZ
- GetPoints:
- Converts attack into a start/mid/end triplet
- DrawAttackLine:
- Used only for testing
- Projectile
- Creates a visual projectile
- Init:
- Inputs as arguments the path for projectile to take
- Sets up some internal values such as tint color, trail width
- Update:
- Ticks projectile along its path using a parabolic path predetermined by start/mid/end triplet
- Destroys object after hitting
- Timer
- The central time-keeper, it also informs all Timed interfaces about changes in time.
- Awake:
- Finds the UI.Text
- Play:
- Sets delta to 1
- Pause:
- Sets delta to 0
- SetSpeed:
- Sets delta to arg
- SetTime:
- Sets time
- Start:
- Coroutine (runs async)
- Loop ->
- Inform all Timed interfaces about current time.
- Update current time by 1 or -1, given by Mathf.sign(delta)
- Wait for 1 / delta seconds.
- Special case: won't allow divby0
- 1 / delta makes it tick every 0.5s if delta is 2, or 0.25s if delta is 4, etc
- TickAll:
- Informs all registered Timed interfaces of updates to time
Advertisement
Add Comment
Please, Sign In to add comment