/// <summary>
 /// Create a Highlighter from type using generics
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="t"></param>
 /// <returns></returns>
 public static T CreateHighlighter <T>(HighlighterType t) where T : SelectionHighlighter
 {
     if (!Instence.InstantiatedHighlighters[(int)t])
     {
         Instence.InstantiatedHighlighters[(int)t] = Instantiate((T)Instence.Highlighters[(int)t]);
     }
     return((T)Instence.InstantiatedHighlighters[(int)t]);
 }
Exemple #2
0
        public SelectionType(string displayText, Vector2 textLocation, Color textColor, TextAlignment textAlignment, string highlighterAsset, string selectorAsset)
        {
            text      = displayText;
            position  = textLocation;
            color     = textColor;
            alignment = textAlignment;

            highlighter = new HighlighterType(highlighterAsset, textLocation);
            selector    = new HighlighterType(selectorAsset, textLocation);
            origin      = new Vector2();
            rotation    = 0f;
            scale       = 1f;
        }
Exemple #3
0
        public PreviewType(string textureAsset, Vector2 texturePosition, Color tint, string highlighterAsset, string selectorAsset, Vector2 highlighterVector)
        {
            asset    = textureAsset;
            position = texturePosition;
            color    = tint;

            highlighter = new HighlighterType(highlighterAsset, highlighterVector);
            selector    = new HighlighterType(selectorAsset, highlighterVector);

            origin   = new Vector2();
            rotation = 0;
            scale    = 1;
        }
        public OptionType(string optionText, Vector2 vector, Color textColor, Rectangle optionHitBox, OptionAction optionAction, string highlighterAsset, Vector2 highlighterLocation)
        {
            text     = optionText;
            position = vector;
            color    = textColor;
            action   = optionAction;
            hitBox   = optionHitBox;

            highlighter    = new HighlighterType(highlighterAsset, highlighterLocation);
            origin         = new Vector2();
            activateIntro  = true;
            activateSelect = true;
            scale          = 1f;
            rotation       = 0f;
        }
        public OptionType(string optionText, Vector2 vector, Color textColor, OptionAction optionAction, bool intro, bool select, string highlighterAsset, Vector2 highlighterLocation)
        {
            text           = optionText;
            position       = vector;
            color          = textColor;
            action         = optionAction;
            link           = "";
            activateIntro  = intro;
            activateSelect = select;

            highlighter = new HighlighterType(highlighterAsset, highlighterLocation);
            origin      = new Vector2();
            scale       = 1f;
            rotation    = 0f;
        }
        public OptionType(OptionType option)
        {
            text     = option.text;
            position = option.position;
            color    = option.color;
            action   = option.action;
            hitBox   = option.hitBox;
            link     = option.link;

            highlighter    = new HighlighterType(option.highlighter);
            origin         = option.origin;
            activateIntro  = option.activateIntro;
            activateSelect = option.activateSelect;
            scale          = option.scale;
            rotation       = option.rotation;
        }
 /// <inheritdoc />
 public HighlightFieldDescriptor <T> Type(HighlighterType type) => Assign(type, (a, v) => a.Type = v);
Exemple #8
0
 /// <summary>
 /// Get Instance of indicated highlighter type
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static HollowHighlightDriver GetInstance(HighlighterType type)
 {
     return(GetInstance(type.ToString()));
 }
Exemple #9
0
 public static void DrawHighlighter(Matrix4x4 matrix, HighlighterType type = HighlighterType.DEFAULT)
 {
     Graphics.DrawMesh(instance.defaultMesh, matrix, instance.defaultMaterial, SortingLayer.NameToID("Default"));
 }
Exemple #10
0
 public HighlightFieldDescriptor <T> Type(HighlighterType type) => Assign(a => a.Type = type);
 /// <summary>
 /// Creates a highlighter from type.
 /// </summary>
 /// <param name="t"></param>
 /// <returns></returns>
 public static SelectionHighlighter CreateHighlighter(HighlighterType t)
 {
     return(Instantiate(Instence.Highlighters[(int)t]));
 }
 /// <summary>
 /// Get Instance of indicated highlighter type
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static HighlightAction GetInstance(HighlighterType type)
 {
     return(GetInstance(type.ToString()));
 }
 public HighlightFieldDescriptor <T> Type(HighlighterType type)
 {
     Self.Type = type.GetStringValue();
     return(this);
 }
        /// <summary>
        /// Set type of highlighter to use. Supported types
        /// are "highlighter"(plain)  and "fast-vector-highlighter"(fvh).
        /// </summary>
        public THighlight Type(HighlighterType highlighterType)
        {
            RegisterJsonPart("'type': {0}", highlighterType.AsString().Quotate());

            return((THighlight)this);
        }