forked from droric/TrackingLights
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from tjakubo2/master
Bugfix, smooth tracking, manual direction adjust playing nice
- Loading branch information
Showing
8 changed files
with
247 additions
and
272 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace LightTracker | ||
{ | ||
public static class Extensions | ||
{ | ||
public static T Next<T>(this T value) where T : struct | ||
{ | ||
if (!typeof(T).IsEnum) | ||
throw new ArgumentException($"Argument {typeof(T).FullName} is not an Enum"); | ||
|
||
var enumValues = value.GetType().GetEnumValues(); | ||
|
||
var nextIndex = Array.IndexOf(enumValues, value) + 1; | ||
if (nextIndex >= enumValues.Length) | ||
nextIndex = 0; | ||
|
||
return (T) enumValues.GetValue(nextIndex); | ||
} | ||
} | ||
} | ||
|
||
namespace LightTracker.Attributes | ||
{ | ||
// Attrib for props that require an update to underlying Unity light | ||
class LightPropertyAttribute : Attribute | ||
{ | ||
public LightPropertyAttribute() { } | ||
} | ||
} |
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
Oops, something went wrong.