#define Graph_And_Chart_PRO using UnityEngine; using System.Collections; using ChartAndGraph; public class BarAnimation : MonoBehaviour { public AnimationCurve Curve = AnimationCurve.Linear(0f, 0f, 1f, 1f); public bool AnimateOnStart = true; // public bool AnimateOnEnable = true; public float AnimationTime = 3f; BarChart barChart; // Use this for initialization void Start () { barChart = GetComponent(); if (AnimateOnStart) Animate(); } /* public void OnEnable() { barChart = GetComponent(); if (AnimateOnEnable) Animate(); }*/ public void Animate() { if(barChart != null) { double max = barChart.DataSource.GetMaxValue(); double min = barChart.DataSource.GetMinValue(); barChart.DataSource.StartBatch(); barChart.DataSource.AutomaticMaxValue = false; barChart.DataSource.AutomaticMinValue = false; barChart.DataSource.MaxValue = max; barChart.DataSource.MinValue = min; for (int i=0; i