示例#1
0
    public void Init()
    {
        if (hasInit)
        {
            return;
        }
        hasInit = true;

        changeObjs.Add(numberRingsC);
        changeObjs.Add(textureC);
        changeObjs.Add(degreesC);
        changeObjs.Add(aRingValC);
        changeObjs.Add(ringColorC);
        changeObjs.Add(bandColorC);
        changeObjs.Add(radiusC);
        changeObjs.Add(labelsC);
        changeObjs.Add(hideRingsC);

        textureChanger = defaultTextureChanger;
        colorChanger   = defaultColorChanger;

        extraRingSprite = WMG_Util.createSprite(getTexture(extraRing));
        ringTexSize     = extraRingSprite.texture.width;
        extraRingColors = new Color[ringTexSize * ringTexSize];
        setTexture(extraRing, extraRingSprite);
        rings          = new List <WMG_Ring>();
        origGraphWidth = ((1 - innerRadiusPercentage) * outerRadius);

        bandColors.SetList(_bandColors);
        bandColors.Changed += bandColorsChanged;

        values.SetList(_values);
        values.Changed += valuesChanged;

        labels.SetList(_labels);
        labels.Changed += labelsChanged;

        hideRings.SetList(_hideRings);
        hideRings.Changed += hideRingsChanged;

        ringIDs.SetList(_ringIDs);
        ringIDs.Changed += ringIDsChanged;

        numberRingsC.OnChange += NumberRingsChanged;
        bandColorC.OnChange   += BandColorChanged;
        ringColorC.OnChange   += RingColorChanged;
        labelsC.OnChange      += LabelsChanged;
        degreesC.OnChange     += DegreesChanged;
        aRingValC.OnChange    += DegreesChangedAring;
        radiusC.OnChange      += RadiusChanged;
        textureC.OnChange     += TextureChanged;
        hideRingsC.OnChange   += HideRingsChanged;

        PauseCallbacks();
    }
示例#2
0
 /// <summary>
 /// スライスを追加し、グラフに反映します
 /// </summary>
 /// <param name="sliceVal">Slice value.</param>
 public void AddSlice(float val, Color color, System.String label = null)
 {
     _sliceValues.Add(val);
     sliceValues.SetList(_sliceValues);
     _sliceColors.Add(color);
     sliceColors.SetList(_sliceColors);
     if (label != null)
     {
         _sliceLabels.Add(label);
         sliceLabels.SetList(_sliceLabels);
     }
     graphC.Changed();
     interactivityC.Changed();
 }
示例#3
0
    /// <summary>
    /// Initializes the graph, and should always be done before anything else, called automatically in Start(), but it never hurts to call this manually after instantiating a graph prefab.
    /// </summary>
    public void Init()
    {
        if (hasInit)
        {
            return;
        }
        hasInit = true;

        changeObjs.Add(allC);
        changeObjs.Add(cubicBezierC);
        changeObjs.Add(labelsC);
        changeObjs.Add(colorsC);
        changeObjs.Add(fontC);

        bands = new List <WMG_Bezier_Band>();

        values.SetList(_values);
        values.Changed += valuesChanged;

        fillColors.SetList(_fillColors);
        fillColors.Changed += fillColorsChanged;

        labels.SetList(_labels);
        labels.Changed += labelsChanged;

        allC.OnChange         += AllChanged;
        cubicBezierC.OnChange += CubicBezierChanged;
        labelsC.OnChange      += UpdateLabels;
        colorsC.OnChange      += UpdateColors;
        fontC.OnChange        += UpdateFontSize;

        allC.Changed();
    }
示例#4
0
    /// <summary>
    /// Initializes the graph, and should always be done before anything else, called automatically in Start(), but it
    /// never hurts to call this manually after instantiating a graph prefab.
    /// </summary>
    public new void Init()
    {
        if (hasInit2)
        {
            return;
        }
        hasInit2 = true;

        changeObjs.Add(radarGraphC);
        changeObjs.Add(gridsC);
        changeObjs.Add(labelsC);
        changeObjs.Add(dataSeriesC);

        dataSeriesColors.SetList(_dataSeriesColors);
        dataSeriesColors.Changed += dataSeriesColorsChanged;

        labelStrings.SetList(_labelStrings);
        labelStrings.Changed += labelStringsChanged;

        radarGraphC.OnChange += GraphChanged;
        gridsC.OnChange      += GridsChanged;
        labelsC.OnChange     += LabelsChanged;
        dataSeriesC.OnChange += DataSeriesChanged;

        PauseCallbacks();
    }
示例#5
0
    public void Init()
    {
        if (hasInit)
        {
            return;
        }
        hasInit = true;

        legend.Init();

        changeObjs.Add(graphC);
        changeObjs.Add(resizeC);
        changeObjs.Add(doughnutC);
        changeObjs.Add(interactivityC);

        if (animationDuration > 0)
        {
            UpdateVisuals(true);
        }

        if (useDoughnut)
        {
            initDoughnut();
        }
        cachedContainerWidth  = getSpriteWidth(this.gameObject);
        cachedContainerHeight = getSpriteHeight(this.gameObject);

        sliceValues.SetList(_sliceValues);
        sliceValues.Changed += sliceValuesChanged;

        sliceLabels.SetList(_sliceLabels);
        sliceLabels.Changed += sliceLabelsChanged;

        sliceColors.SetList(_sliceColors);
        sliceColors.Changed += sliceColorsChanged;

        graphC.OnChange         += GraphChanged;
        resizeC.OnChange        += ResizeChanged;
        doughnutC.OnChange      += DoughtnutChanged;
        interactivityC.OnChange += InteractivityChanged;

//		setOriginalPropertyValues();
        PauseCallbacks();
    }