コード例 #1
0
ファイル: Highlight.cs プロジェクト: Keraunic-Tonic/GJ2021
 /**
  * Pulses the highlight effect on, and then off, in a continuous cycle.
  */
 public void Pulse()
 {
     highlightState = HighlightState.Pulse;
     //highlight = minHighlight;
     direction    = 1;
     currentTimer = 0f;
 }
コード例 #2
0
 public void UnhighlightAllNodes(HighlightState removeFlags)
 {
     // Kludge cast to avoid a "Collection was modified" exception.
     var keys = _nodeHighlights.Keys.ToArray();
     foreach (SkillNode node in keys)
         UnhighlightNode(node, removeFlags);
 }
コード例 #3
0
        public void HighlightOnInstant()
        {
            highlightState = HighlightState.On;
            highlight      = maxHighlight;

            UpdateMaterials();
        }
コード例 #4
0
ファイル: Highlight.cs プロジェクト: sirmortimus/team9
        /**
         * Turns the highlight effect on. The effect will occur over time.
         */
        public void HighlightOn()
        {
            if (highlightState == HighlightState.On ||
                (highlightState == HighlightState.Normal && direction == 1))
            {
                return;
            }

            highlightState = HighlightState.Normal;
            direction      = 1;
            fadeStartTime  = Time.time;

            if (highlight > minHighlight)
            {
                fadeStartTime -= (highlight - minHighlight) / (maxHighlight - minHighlight) * fadeTime;
            }
            else
            {
                highlight = minHighlight;
            }

            if (callEvents && onHighlightOn != null)
            {
                onHighlightOn.Invoke();
            }
        }
コード例 #5
0
        public void DeHighlightOtherTeamTilePieces(List <PieceEV> alteredPieces, PlayerColor pieceTeam, IEntitiesDB entitiesDB)
        {
            HighlightState highlightStateToRemove = HighlightService.CalcClickHighlightState(pieceTeam);

            // TODO Remove team highlights based on Team Color, not piece ref id
            List <TileEV> tiles = tileService.FindAllTileEVs(entitiesDB)
                                  .Where(tile => tile.Highlight.IsHighlighted &&
                                         tile.Highlight.CurrentColorStates.Contains(highlightStateToRemove)
                                         ).ToList();

            foreach (TileEV tile in tiles)
            {
                entitiesDB.ExecuteOnEntity(
                    tile.ID,
                    (ref TileEV tileToChange) =>
                {
                    tileToChange.Highlight.CurrentColorStates.Remove(highlightStateToRemove);
                    tileToChange.Tile.PieceRefEntityId = null;

                    if (!tileToChange.Highlight.CurrentColorStates.Any())
                    {
                        tileToChange.Highlight.IsHighlighted = false;
                    }
                });

                tile.ChangeColorTrigger.PlayChangeColor = true;
            }
        }
コード例 #6
0
ファイル: MazeArrow.cs プロジェクト: vgwb/Antura_arabic
        public void Unhighlight()
        {
            highlightFX.SetActive(false);
            arrowOrDotMesh.material.color = normalColor;

            highlightState = HighlightState.None;
        }
コード例 #7
0
 public void HighlightNodes(IEnumerable <PassiveNodeViewModel> nodes, HighlightState newFlags)
 {
     foreach (PassiveNodeViewModel node in nodes)
     {
         HighlightNode(node, newFlags);
     }
 }
コード例 #8
0
        private void ChangeTileColor(List <TileEV> tilesToChange, ref PressStepState token)
        {
            bool           isClicked                   = token.PiecePressState == PiecePressState.CLICKED;
            PieceEV        piece                       = pieceFindService.FindPieceEV(token.PieceEntityId, entitiesDB);
            int            pieceIdtoken                = token.PieceEntityId;
            HighlightState newHighlightState           = HighlightService.CalcClickHighlightState(piece.PlayerOwner.PlayerColor);
            TurnEV         currentTurn                 = turnService.GetCurrentTurnEV(entitiesDB);
            bool           doesPieceBelongToTurnPlayer = currentTurn.TurnPlayer.PlayerColor == piece.PlayerOwner.PlayerColor;

            foreach (TileEV tileEV in tilesToChange)
            {
                entitiesDB.ExecuteOnEntity(
                    tileEV.ID,
                    (ref TileEV tileToChange) =>
                {
                    tileToChange.Highlight.IsHighlighted = isClicked;

                    if (doesPieceBelongToTurnPlayer)
                    {
                        tileToChange.Tile.PieceRefEntityId = isClicked ? (int?)pieceIdtoken : null;
                    }

                    if (isClicked)
                    {
                        tileToChange.Highlight.CurrentColorStates.Add(newHighlightState);
                    }
                    else
                    {
                        tileToChange.Highlight.CurrentColorStates.Remove(newHighlightState);
                    }
                });

                tileEV.ChangeColorTrigger.PlayChangeColor = true;
            }
        }
コード例 #9
0
    private HighlightState FindHightlightObject()
    {
        IEnumerator enumerator = base.transform.GetEnumerator();

        try
        {
            while (enumerator.MoveNext())
            {
                Transform      current   = (Transform)enumerator.Current;
                HighlightState component = current.gameObject.GetComponent <HighlightState>();
                if (component != null)
                {
                    return(component);
                }
            }
        }
        finally
        {
            IDisposable disposable = enumerator as IDisposable;
            if (disposable == null)
            {
            }
            disposable.Dispose();
        }
        return(null);
    }
コード例 #10
0
ファイル: Highlight.cs プロジェクト: sirmortimus/team9
 /**
  * Pulses the highlight effect on, and then off, in a continuous cycle.
  */
 public void Pulse()
 {
     highlightState = HighlightState.Pulse;
     highlight      = minHighlight;
     direction      = 1;
     fadeStartTime  = Time.time;
 }
コード例 #11
0
        async Task <HighlightState> GetStateAsync(IDocumentLine line, CancellationToken cancellationToken = default)
        {
            var pl = line?.PreviousLine;

            if (pl == null)
            {
                return(HighlightState.CreateNewState(this));
            }
            if (stateCache.Count == 0)
            {
                stateCache.Add(HighlightState.CreateNewState(this));
            }
            var ln = line.LineNumber;

            if (ln <= stateCache.Count)
            {
                return(stateCache [ln - 1].Clone());
            }
            var lastState = stateCache [stateCache.Count - 1];
            var cur       = Document.GetLine(stateCache.Count);

            if (cur != null && cur.Offset < line.Offset)
            {
                do
                {
                    var high = new Highlighter(this, lastState.Clone());
                    await high.GetColoredSegments(Document, cur.Offset, cur.LengthIncludingDelimiter, cancellationToken);

                    stateCache.Add(lastState = high.State);
                    cur = cur.NextLine;
                } while (cur != null && cur.Offset < line.Offset);
            }

            return(lastState.Clone());
        }
コード例 #12
0
 public void HighlightNode(SkillNode node, HighlightState newFlags)
 {
     if (newFlags == 0) return;
     if (nodeHighlights.ContainsKey(node))
         nodeHighlights[node] |= newFlags;
     else nodeHighlights.Add(node, newFlags);
 }
コード例 #13
0
ファイル: Highlight.cs プロジェクト: Keraunic-Tonic/GJ2021
        /**
         * Turns the highlight effect on. The effect will occur over time.
         */
        public void HighlightOn()
        {
            if (highlightState == HighlightState.On ||
                (highlightState == HighlightState.Normal && direction == 1))
            {
                return;
            }

            if (direction == -1 && currentTimer > 0f)
            {
                currentTimer = fadeTime - currentTimer;
            }
            else if (direction != 1)
            {
                //highlight = minHighlight;
                currentTimer = 0f;
            }

            highlightState = HighlightState.Normal;
            direction      = 1;

            if (callEvents && onHighlightOn != null)
            {
                onHighlightOn.Invoke();
            }
        }
コード例 #14
0
 protected override void Awake()
 {
     base.Awake();
     SoundManager.Get().Load("play_button_mouseover");
     this.m_playButtonHighlightState = base.gameObject.GetComponentInChildren <HighlightState>();
     base.SetOriginalLocalPosition();
 }
コード例 #15
0
        HighlightState GetState(IDocumentLine line)
        {
            var pl = line.PreviousLine;

            if (pl == null)
            {
                return(HighlightState.CreateNewState(this));
            }
            if (stateCache.Count == 0)
            {
                stateCache.Add(HighlightState.CreateNewState(this));
            }
            var ln = line.LineNumber;

            if (ln <= stateCache.Count)
            {
                return(stateCache [ln - 1].Clone());
            }
            var lastState = stateCache [stateCache.Count - 1];
            var cur       = Document.GetLine(stateCache.Count);

            if (cur != null && cur.Offset < line.Offset)
            {
                do
                {
                    var high = new Highlighter(this, lastState.Clone());
                    high.GetColoredSegments(Document, cur.Offset, cur.LengthIncludingDelimiter).Wait();
                    stateCache.Add(lastState = high.State);
                    cur = cur.NextLine;
                } while (cur != null && cur.Offset < line.Offset);
            }

            return(lastState.Clone());
        }
コード例 #16
0
        public void ApplyHighlight(HighlightState highlight)
        {
            if (activeHighlight != null)
            {
                Destroy(activeHighlight);
            }
            switch (highlight)
            {
            case HighlightState.NoHighlight:
                break;

            case HighlightState.Simple:
                activeHighlight = Instantiate(highlights[0], transform.position, Quaternion.identity, transform) as GameObject;
                break;

            case HighlightState.Specific:
                activeHighlight = Instantiate(highlights[1], transform.position, Quaternion.identity, transform) as GameObject;
                break;

            case HighlightState.Uninteractable:
                activeHighlight = Instantiate(highlights[2], transform.position, Quaternion.identity, transform) as GameObject;
                break;

            default:
                break;
            }
        }
コード例 #17
0
 /// <summary>
 /// Highlights the element.
 /// Default value is from configuration: <see cref="IBrowserProfile.IsElementHighlightEnabled"/>
 /// </summary>
 public void HighlightElement(HighlightState highlightState = HighlightState.Default)
 {
     if (browserProfile.IsElementHighlightEnabled || highlightState.Equals(HighlightState.Highlight))
     {
         ExecuteScript(JavaScript.BorderElement);
     }
 }
コード例 #18
0
        public void HighlightItem(int _id, HighlightType _type)
        {
            highlightItem = GetItem(_id);
            if (highlightItem == null)
            {
                return;
            }

            if (_type == HighlightType.Enable)
            {
                highlightState = HighlightState.Normal;
                pulseDirection = 1;
            }
            else if (_type == HighlightType.Disable)
            {
                highlightState = HighlightState.Normal;
                pulseDirection = -1;
            }
            else if (_type == HighlightType.PulseOnce)
            {
                highlightState = HighlightState.Flash;
                pulse          = 0f;
                pulseDirection = 1;
            }
            else if (_type == HighlightType.PulseContinually)
            {
                highlightState = HighlightState.Pulse;
                pulse          = 0f;
                pulseDirection = 1;
            }
        }
コード例 #19
0
 public void HighlightNodes(IEnumerable <SkillNode> nodes, HighlightState newFlags)
 {
     foreach (SkillNode node in nodes)
     {
         HighlightNode(node, newFlags);
     }
 }
コード例 #20
0
 /// <summary>
 /// Returns flags without HighlightState.Tags if the node is an ascendancy node.
 /// Returns flags unchanged if it is not.
 /// </summary>
 private static HighlightState CleanFlags(PassiveNodeViewModel node, HighlightState flags)
 {
     if (!node.IsAscendancyNode)
     {
         return(flags);
     }
     return(flags & ~HighlightState.Tags);
 }
コード例 #21
0
 /// <summary>
 /// Returns flags without HighlightState.Tags if the node is an ascendancy node.
 /// Returns flags unchanged if it is not.
 /// </summary>
 private static HighlightState CleanFlags(SkillNode node, HighlightState flags)
 {
     if (node.ascendancyName == null)
     {
         return(flags);
     }
     return(flags & ~HighlightState.Tags);
 }
コード例 #22
0
 public bool NodeHasHighlights(PassiveNodeViewModel node, HighlightState flags)
 {
     if (_nodeHighlights.ContainsKey(node))
     {
         return(_nodeHighlights[node].HasFlag(flags));
     }
     return(false);
 }
コード例 #23
0
 public bool NodeHasHighlights(SkillNode node, HighlightState flags)
 {
     if (_nodeHighlights.ContainsKey(node))
     {
         return _nodeHighlights[node].HasFlag(flags);
     }
     return false;
 }
コード例 #24
0
 public void HighlightNode(SkillNode node, HighlightState newFlags)
 {
     var flags = CleanFlags(node, newFlags);
     if (flags == 0) return;
     if (_nodeHighlights.ContainsKey(node))
         _nodeHighlights[node] |= flags;
     else _nodeHighlights.Add(node, flags);
 }
コード例 #25
0
 public highlight(NoteWithDuration Note, int Ticks, Transform Trans, HighlightState State, float ZHigh)
 {
     note  = Note;
     ticks = Ticks;
     trans = Trans;
     state = State;
     zHigh = ZHigh;
 }
コード例 #26
0
        public void HighlightOffInstant()
        {
            minHighlight   = 1f;
            highlightState = HighlightState.None;
            highlight      = minHighlight;

            UpdateMaterials();
        }
コード例 #27
0
 public Highlight(HighlightState state, string gridBackground, string gridForeground, System.Drawing.FontStyle gridFontStyle, string panelBackground)
 {
     this.State           = state;
     this.GridBackground  = gridBackground;
     this.GridForeground  = gridForeground;
     this.GridFontStyle   = gridFontStyle;
     this.PanelBackground = panelBackground;
 }
コード例 #28
0
 public bool NodeHasHighlights(SkillNode node, HighlightState flags)
 {
     if (nodeHighlights.ContainsKey(node))
     {
         return(nodeHighlights[node].HasFlag(flags));
     }
     return(false);
 }
コード例 #29
0
 /// <summary>
 /// Returns flags without HighlightState.Tags if the node is an ascendancy node.
 /// Returns flags unchanged if it is not.
 /// </summary>
 private static HighlightState CleanFlags(SkillNode node, HighlightState flags)
 {
     if (!node.IsAscendancyNode)
     {
         return(flags);
     }
     return(flags & ~HighlightState.Tags);
 }
コード例 #30
0
        public string GetAttribute(string attr, HighlightState highlightState = HighlightState.Default)
        {
            LogElementAction("loc.el.getattr", attr);
            JsActions.HighlightElement(highlightState);
            var value = DoWithRetry(() => GetElement().GetAttribute(attr));

            LogElementAction("loc.el.attr.value", attr, value);
            return(value);
        }
コード例 #31
0
        public string GetCssValue(string propertyName, HighlightState highlightState = HighlightState.Default)
        {
            LogElementAction("loc.el.cssvalue", propertyName);
            JsActions.HighlightElement(highlightState);
            var value = DoWithRetry(() => GetElement().GetCssValue(propertyName));

            LogElementAction("loc.el.attr.value", propertyName, value);
            return(value);
        }
コード例 #32
0
 /// <summary>
 /// For all nodes that have at least one of the ifFlags:
 /// Removes flags not in ifFlags, adds newFlags.
 /// </summary>
 public void HighlightNodesIf(HighlightState newFlags, HighlightState ifFlags)
 {
     var pairs = nodeHighlights.Where(pair => (pair.Value & ifFlags) > 0).ToArray();
     foreach (var pair in pairs)
     {
         nodeHighlights[pair.Key] &= ifFlags;
         nodeHighlights[pair.Key] |= newFlags;
     }
 }
コード例 #33
0
        public string GetText(HighlightState highlightState = HighlightState.Default)
        {
            LogElementAction("loc.get.text");
            JsActions.HighlightElement(highlightState);
            var value = DoWithRetry(() => GetElement().Text);

            LogElementAction("loc.text.value", value);
            return(value);
        }
コード例 #34
0
ファイル: Highlight.cs プロジェクト: mcbodge/eidolon
 /**
  * Flashes the highlight effect on, and then off, once.
  */
 public void Flash()
 {
     if (highlightState != HighlightState.Flash && (highlightState == HighlightState.None || direction == -1))
     {
         highlightState = HighlightState.Flash;
         highlight = minHighlight;
         direction = 1;
         fadeStartTime = Time.time;
     }
 }
コード例 #35
0
        public void UnhighlightAllNodes(HighlightState removeFlags)
        {
            // Kludge cast to avoid a "Collection was modified" exception.
            var keys = nodeHighlights.Keys.ToArray();

            foreach (SkillNode node in keys)
            {
                UnhighlightNode(node, removeFlags);
            }
        }
コード例 #36
0
 public void ToggleHighlightNode(SkillNode node, HighlightState toggleFlags)
 {
     if (toggleFlags == 0) return;
     if (nodeHighlights.ContainsKey(node))
     {
         nodeHighlights[node] ^= toggleFlags;
         if (nodeHighlights[node] == 0) nodeHighlights.Remove(node);
     }
     else nodeHighlights.Add(node, toggleFlags);
 }
コード例 #37
0
        /// <summary>
        /// For all nodes that have at least one of the ifFlags:
        /// Removes flags not in ifFlags, adds newFlags.
        /// </summary>
        public void HighlightNodesIf(HighlightState newFlags, HighlightState ifFlags)
        {
            var pairs = nodeHighlights.Where(pair => (pair.Value & ifFlags) > 0).ToArray();

            foreach (var pair in pairs)
            {
                nodeHighlights[pair.Key] &= ifFlags;
                nodeHighlights[pair.Key] |= CleanFlags(pair.Key, newFlags);
            }
        }
コード例 #38
0
 public void UnhighlightNode(SkillNode node, HighlightState removeFlags)
 {
     if (_nodeHighlights.ContainsKey(node))
     {
         // Each flag only remains set if it's not one of the flags to be removed.
         HighlightState newState = _nodeHighlights[node] & ~removeFlags;
         if (newState == 0) _nodeHighlights.Remove(node);
         else _nodeHighlights[node] = newState;
     }
 }
コード例 #39
0
ファイル: GameGuiSlot.cs プロジェクト: rno81/java-test
    public void SetHighlighMode(HighlightState highlight)
    {
        CancelCurrentTransforms();
        if(highlight == HighlightState.Choosen)
            SoundManager.Instance.PlaySound("sfx_slot_aktyw_ID18");

        switch(highlight)
        {
        case HighlightState.None:
            SetAlpha(Glow, 0.0f);
            SetAlpha(Diagram, DiagramNormalAlpa);
            break;
        case HighlightState.Active:
            SetAlpha(Glow, 1.0f);
            SetAlpha(Diagram, DiagramNormalAlpa);
            break;
        case HighlightState.Choosen:
            SetAlpha(Glow, 1.0f);
            SetAlpha(Diagram, DiagramGlowAlpha);
            break;
        }
    }
コード例 #40
0
ファイル: GameGuiSlot.cs プロジェクト: rno81/java-test
    public void SetHighlighModeImmediately(HighlightState highlight)
    {
        CancelCurrentTransforms();

        switch(highlight)
        {
        case HighlightState.None:
            SetAlphaImmediately(Glow, 0.0f);
            SetAlphaImmediately(Diagram, DiagramNormalAlpa);
            break;
        case HighlightState.Active:
            SetAlphaImmediately(Glow, 1.0f);
            SetAlphaImmediately(Diagram, DiagramNormalAlpa);
            break;
        case HighlightState.Choosen:
            SetAlphaImmediately(Glow, 1.0f);
            SetAlphaImmediately(Diagram, DiagramGlowAlpha);
            break;
        }
    }
コード例 #41
0
ファイル: Controls.cs プロジェクト: daszat/zetbox
 public static object GetHighlightValue(HighlightState state, string explicitValue, string valueKind)
 {
     if (!string.IsNullOrEmpty(explicitValue))
     {
         return _brushConverter.ConvertFromString(explicitValue);
     }
     else
     {
         var resource = System.Windows.Application.Current.TryFindResource(string.Format("HighlightState_{0}_{1}", state.ToString(), valueKind));
         return resource ?? DependencyProperty.UnsetValue;
     }
 }
コード例 #42
0
		public void HighlightOffInstant ()
		{
			highlightState = HighlightState.None;
			highlight = 1f;

			UpdateMaterials ();
		}
コード例 #43
0
 public void HighlightNodes(IEnumerable<SkillNode> nodes, HighlightState newFlags)
 {
     foreach (SkillNode node in nodes)
         HighlightNode(node, newFlags);
 }
コード例 #44
0
ファイル: ViewModel.cs プロジェクト: jrgcubano/zetbox
 public Highlight(HighlightState state, string gridBackground, string gridForeground, System.Drawing.FontStyle gridFontStyle, string panelBackground)
 {
     this.State = state;
     this.GridBackground = gridBackground;
     this.GridForeground = gridForeground;
     this.GridFontStyle = gridFontStyle;
     this.PanelBackground = panelBackground;
 }
コード例 #45
0
 /// <summary>
 /// Returns flags without HighlightState.Tags if the node is an ascendancy node.
 /// Returns flags unchanged if it is not.
 /// </summary>
 private static HighlightState CleanFlags(SkillNode node, HighlightState flags)
 {
     if (node.ascendancyName == null) return flags;
     return flags & ~HighlightState.Tags;
 }
コード例 #46
0
		public void HighlightOn ()
		{
			highlightState = HighlightState.Normal;
			direction = 1;
			fadeStartTime = Time.time;
			
			if (highlight > 1f)
			{
				fadeStartTime -= (highlight - 1f) / (maxHighlight - 1f) * fadeTime;
			}
			else
			{
				highlight = 1f;
			}
		}
コード例 #47
0
		public void HighlightOnInstant ()
		{
			highlightState = HighlightState.None;
			highlight = maxHighlight;
			
			UpdateMaterials ();
		}
コード例 #48
0
 public void ReplaceHighlights(List<SkillNode> newNodes, HighlightState replaceFlags)
 {
     UnhighlightAllNodes(replaceFlags);
     HighlightNodes(newNodes, replaceFlags);
 }
コード例 #49
0
 /// <summary>
 /// Removes <paramref name="replaceFlags"/> from all nodes and then adds them to all nodes
 /// in <paramref name="newNodes"/>.
 /// </summary>
 public void ResetHighlights(IEnumerable<SkillNode> newNodes, HighlightState replaceFlags)
 {
     UnhighlightAllNodes(replaceFlags);
     HighlightNodes(newNodes, replaceFlags);
 }
コード例 #50
0
ファイル: Highlight.cs プロジェクト: farreltr/OneLastSunset
        /**
         * Turns the highlight effect on. The effect will occur over time.
         */
        public void HighlightOn()
        {
            highlightState = HighlightState.Normal;
            direction = 1;
            fadeStartTime = Time.time;

            if (highlight > minHighlight)
            {
                fadeStartTime -= (highlight - minHighlight) / (maxHighlight - minHighlight) * fadeTime;
            }
            else
            {
                highlight = minHighlight;
            }
        }
コード例 #51
0
 /**
  * Removes all highlighting from the inventory item curently being highlighted.
  */
 public void HighlightItemOffInstant()
 {
     highlightItem = null;
     highlightState = HighlightState.None;
     pulse = 0f;
 }
コード例 #52
0
ファイル: ViewModel.cs プロジェクト: jrgcubano/zetbox
 public Highlight(HighlightState state)
     : this(state, null, null, System.Drawing.FontStyle.Regular, null)
 {
 }
コード例 #53
0
 /**
  * <summary>Fully highlights an inventory item instantly.</summary>
  * <param name = "_id">The ID number of the inventory item (see InvItem) to highlight</param>
  */
 public void HighlightItemOnInstant(int _id)
 {
     highlightItem = GetItem (_id);
     highlightState = HighlightState.None;
     pulse = 1f;
 }
コード例 #54
0
ファイル: Highlight.cs プロジェクト: mcbodge/eidolon
        /**
         * Instantly turns the highlight effect on, to its maximum intensity.
         */
        public void HighlightOnInstant()
        {
            highlightState = HighlightState.On;
            highlight = maxHighlight;

            UpdateMaterials ();

            if (callEvents && onHighlightOn != null)
            {
                onHighlightOn.Invoke();
            }
        }
コード例 #55
0
ファイル: Highlight.cs プロジェクト: mcbodge/eidolon
        /**
         * Turns the highlight effect on. The effect will occur over time.
         */
        public void HighlightOn()
        {
            highlightState = HighlightState.Normal;
            direction = 1;
            fadeStartTime = Time.time;

            if (highlight > minHighlight)
            {
                fadeStartTime -= (highlight - minHighlight) / (maxHighlight - minHighlight) * fadeTime;
            }
            else
            {
                highlight = minHighlight;
            }

            if (callEvents && onHighlightOn != null)
            {
                onHighlightOn.Invoke();
            }
        }
コード例 #56
0
ファイル: Highlight.cs プロジェクト: mcbodge/eidolon
        /**
         * Instantly turns the highlight effect off.
         */
        public void HighlightOffInstant()
        {
            minHighlight = 1f;
            highlightState = HighlightState.None;
            highlight = minHighlight;

            UpdateMaterials ();

            if (callEvents && onHighlightOff != null)
            {
                onHighlightOff.Invoke();
            }
        }
コード例 #57
0
		public void HighlightOff ()
		{
			highlightState = HighlightState.Normal;
			direction = -1;
			fadeStartTime = Time.time;
			
			if (highlight < maxHighlight)
			{
				fadeStartTime -= (maxHighlight - highlight) / (maxHighlight - 1) * fadeTime;
			}
			else
			{
				highlight = maxHighlight;
			}
		}
コード例 #58
0
		private void FixedUpdate ()
		{
			if (highlightState != HighlightState.None)
			{	
				if (direction == 1)
				{
					// Add highlight
					highlight = Mathf.Lerp (1f, maxHighlight, AdvGame.Interpolate (fadeStartTime, fadeTime, MoveMethod.Linear, null));

					if (highlight >= maxHighlight)
					{
						highlight = maxHighlight;
						
						if (highlightState == HighlightState.Flash || highlightState == HighlightState.Pulse)
						{
							direction = -1;
							fadeStartTime = Time.time;
						}
						else
						{
							highlightState = HighlightState.None;
						}
					}
				}
				else
				{
					// Remove highlight
					highlight = Mathf.Lerp (maxHighlight, 1f, AdvGame.Interpolate (fadeStartTime, fadeTime, AC.MoveMethod.Linear, null));

					if (highlight <= 1f)
					{
						highlight = 1f;

						if (highlightState == HighlightState.Pulse)
						{
							direction = 1;
							fadeStartTime = Time.time;
						}
						else
						{
							highlightState = HighlightState.None;
						}
					}
				}

				if (brightenMaterials)
				{
					UpdateMaterials ();
				}
			}
		}
コード例 #59
0
 /// <summary>
 /// For all nodes that have at least one of the ifFlags:
 /// Removes flags not in ifFlags, adds newFlags.
 /// </summary>
 /// <returns>All affected nodes.</returns>
 public IEnumerable<SkillNode> HighlightNodesIf(HighlightState newFlags, HighlightState ifFlags)
 {
     var pairs = _nodeHighlights.Where(pair => (pair.Value & ifFlags) > 0).ToArray();
     foreach (var pair in pairs)
     {
         _nodeHighlights[pair.Key] &= ifFlags;
         _nodeHighlights[pair.Key] |= CleanFlags(pair.Key, newFlags);
     }
     return pairs.Select(p => p.Key);
 }
コード例 #60
0
		public void Pulse ()
		{
			highlightState = HighlightState.Pulse;
			highlight = 1f;
			direction = 1;
			fadeStartTime = Time.time;
		}