void updateIndicator() { if (series1.getPoints().Count == 0) { return; } WMG_Node lastPoint = series1.getLastPoint().GetComponent <WMG_Node>(); graph.changeSpritePositionToY(indicatorGO, lastPoint.transform.localPosition.y); Vector2 nodeData = series1.getNodeValue(lastPoint); //indicatorLabelNumberFormatInfo.CurrencyDecimalDigits = indicatorNumDecimals; string textToSet = nodeData.y.ToString(); graph.changeLabelText(indicatorGO.transform.GetChild(0).GetChild(0).gameObject, textToSet); }
void blinkCurrentPointAnimation(bool fromOnCompleteAnimateAdd = false) { graph.Refresh(); // Ensures gamobject list of series points is up to date based on pointValues WMG_Node lastPoint = series1.getLastPoint().GetComponent <WMG_Node>(); string blinkingPointAnimId = series1.GetHashCode() + "blinkingPointAnim"; DOTween.Kill(blinkingPointAnimId); blinkingTween = lastPoint.objectToScale.transform.DOScale(new Vector3(blinkScale, blinkScale, blinkScale), blinkAnimDuration).SetEase(plotEaseType) .SetUpdate(false).SetId(blinkingPointAnimId).SetLoops(-1, LoopType.Yoyo); if (series1.pointValues.Count > 1) // ensure previous point scale reset { WMG_Node blinkingNode = series1.getPoints()[series1.getPoints().Count - 2].GetComponent <WMG_Node>(); if (fromOnCompleteAnimateAdd) // removing a pointValues index deletes the gameobject at the end, so need to set the timeline from the previous tween { blinkingTween.Goto(blinkAnimDuration * blinkingNode.objectToScale.transform.localScale.x / blinkScale, true); } blinkingNode.objectToScale.transform.localScale = Vector3.one; } }