public override void OnEnter()
        {
            string check = ErrorCheck();

            if (check != null)
            {
                Debug.LogError(check);
                return;
            }
            GameObject     chart = Fsm.GetOwnerDefaultTarget(ChartObject);
            var            graph = chart.GetComponent <GraphChart>();
            MaterialTiling m;

            if (TilingFactor.Value < 0f)
            {
                m = new MaterialTiling();
            }
            else
            {
                m = new MaterialTiling(true, TilingFactor.Value);
            }
            if (graph.DataSource.HasCategory(CategoryName.Value))
            {
                graph.DataSource.SetCategoryPoint(CategoryName.Value, PointMaterial.Value, PointSize.Value);
                graph.DataSource.SetCategoryLine(CategoryName.Value, LineMaterial.Value, LineThickness.Value, m);
                graph.DataSource.SetCategoryFill(CategoryName.Value, FillMaterial.Value, StrechFill.Value);
                graph.DataSource.Set2DCategoryPrefabs(CategoryName.Value, LineHoverPrefab.Value as ChartItemEffect, PointHoverPrefab.Value as ChartItemEffect);
            }
            else
            {
                graph.DataSource.AddCategory(CategoryName.Value, LineMaterial.Value, LineThickness.Value, m, FillMaterial.Value, StrechFill.Value, PointMaterial.Value, PointSize.Value);
                graph.DataSource.Set2DCategoryPrefabs(CategoryName.Value, LineHoverPrefab.Value as ChartItemEffect, PointHoverPrefab.Value as ChartItemEffect);
            }
            Finish();
        }
Example #2
0
        float GetTiling(MaterialTiling tiling)
        {
            if (tiling.EnableTiling == false || tiling.TileFactor <= 0f)
            {
                return(1f);
            }
            ChartDivisionInfo inf = mAxis.MainDivisions;

            if (mIsSubDivisions)
            {
                inf = mAxis.SubDivisions;
            }
            float length = ChartCommon.GetAutoLength(mParent, mOrientation, inf);

            return(length / tiling.TileFactor);
        }
        /// <summary>
        /// used internally to get the tiling for a chart axis division
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="orientation"></param>
        /// <param name="inf"></param>
        /// <returns></returns>
        float GetTiling(AnyChart parent, ChartOrientation orientation, ChartDivisionInfo inf)
        {
            MaterialTiling tiling = inf.MaterialTiling;

            if (tiling.EnableTiling == false || tiling.TileFactor <= 0f)
            {
                return(1f);
            }
            float length     = Math.Abs(ChartCommon.GetAutoLength(parent, orientation, inf));
            float backLength = ChartCommon.GetAutoLength(parent, orientation);
            float depth      = ChartCommon.GetAutoDepth(parent, orientation, inf);

            if (inf.MarkBackLength.Automatic == false)
            {
                backLength = inf.MarkBackLength.Value;
            }
            if (backLength != 0 && depth > 0)
            {
                length += Math.Abs(backLength) + Math.Abs(depth);
            }
            return(length / tiling.TileFactor);
        }