This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
public class BaseGameEvent : ScriptableObject | |
{ | |
#if UNITY_EDITOR | |
[TextArea] public string developerDescription = ""; | |
#endif | |
public event Action Raised; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/inca/0b3d194b755e2efd9d7d8e3665e6cfbb | |
// math from https://www.redblobgames.com/grids/hexagons/ | |
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
public static class HexVectorExtensions { | |
public static Vector2 WorldToPlanar(this Vector3 world) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class GameEffect : PooledObjectBase | |
{ | |
public Transform EffectTarget; | |
public float EffectDuration; | |
[SerializeField] private float timer; | |
public override void BeforeEnable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public abstract class BaseGameEvent : ScriptableObject | |
{ | |
#if UNITY_EDITOR | |
[TextArea] public string developerDescription = ""; | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[SerializeField] private AnimationCurve curveHeight; | |
[SerializeField] private float curveMaxHeight; | |
public Vector3 Move(Projectile projectile) | |
{ | |
// move towards the target in an arc, taking a constant amount of time | |
var linearT = projectile.CurrentTime / Duration; | |
// we have to move XZ and Y separately so they dont fight each other | |
var movePosition = Vector3.Lerp(projectile.StartPosition.PositionXZ(), projectile.TargetPosition.PositionXZ(), linearT); | |
// in case the start and end Y values are different (which they should be since the turret is higher) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# function adapted from https://stackoverflow.com/posts/42995301/revisions | |
Function Execute-Command ($commandTitle, $commandPath, $commandArguments) | |
{ | |
Try { | |
$pinfo = New-Object System.Diagnostics.ProcessStartInfo | |
$pinfo.FileName = $commandPath | |
$pinfo.RedirectStandardOutput = $true | |
$pinfo.UseShellExecute = $false | |
$pinfo.Arguments = $commandArguments | |
$p = New-Object System.Diagnostics.Process |