Skip to content

Commit

Permalink
Merge pull request #58 from ExtendRealityLtd/refactor/enum-setter
Browse files Browse the repository at this point in the history
refactor(Facade): use extension method to set enum value
  • Loading branch information
extendreality committed Jul 11, 2020
2 parents 5750b37 + f68fcfb commit c2fe95d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Runtime/SharedResources/Scripts/PointerFacade.cs
Expand Up @@ -9,6 +9,7 @@
using Zinnia.Action;
using Zinnia.Cast;
using Zinnia.Data.Attribute;
using Zinnia.Extension;
using Zinnia.Pointer;
using Zinnia.Rule;

Expand Down Expand Up @@ -119,7 +120,7 @@ public enum SelectionType
/// <param name="selectionMethodIndex">The index of the <see cref="SelectionType"/>.</param>
public virtual void SetSelectionMethod(int selectionMethodIndex)
{
SelectionMethod = (SelectionType)Mathf.Clamp(selectionMethodIndex, 0, System.Enum.GetValues(typeof(SelectionType)).Length);
SelectionMethod = EnumExtensions.GetByIndex<SelectionType>(selectionMethodIndex);
}

/// <summary>
Expand Down

0 comments on commit c2fe95d

Please sign in to comment.