subscribeToEvents() public method

public subscribeToEvents ( bool val ) : void
val bool
return void
Esempio n. 1
0
    public void Init()
    {
        if (hasInit) return;
        hasInit = true;

        changeObjs.Add(orientationC);
        changeObjs.Add(graphTypeC);
        changeObjs.Add(graphC);
        changeObjs.Add(resizeC);
        changeObjs.Add(seriesCountC);
        changeObjs.Add(seriesNoCountC);
        changeObjs.Add(tooltipEnabledC);
        changeObjs.Add(autoAnimEnabledC);

        legend.Init ();
        xAxis.Init (yAxis, false);
        yAxis.Init (xAxis, true);

        for (int j = 0; j < lineSeries.Count; j++) {
            if (!activeInHierarchy(lineSeries[j])) continue;
            WMG_Series theSeries = lineSeries[j].GetComponent<WMG_Series>();
            theSeries.Init(j);
        }

        theTooltip = this.gameObject.AddComponent<WMG_Graph_Tooltip>(); // Add tooltip script
        theTooltip.hideFlags = HideFlags.HideInInspector; // Don't show tooltip script
        theTooltip.theGraph = this; // Set tooltip graph
        if (tooltipEnabled) theTooltip.subscribeToEvents(true);
        autoAnim = this.gameObject.AddComponent<WMG_Graph_Auto_Anim>(); // Add automatic animations script
        autoAnim.hideFlags = HideFlags.HideInInspector; // Don't show automatic animations script
        autoAnim.theGraph = this; // Set automatic animations graph
        if (autoAnimationsEnabled) autoAnim.subscribeToEvents(true);

        groups.SetList (_groups);
        groups.Changed += groupsChanged;

        graphTypeC.OnChange += GraphTypeChanged;
        tooltipEnabledC.OnChange += TooltipEnabledChanged;
        autoAnimEnabledC.OnChange += AutoAnimationsEnabledChanged;
        orientationC.OnChange += OrientationChanged;
        resizeC.OnChange += ResizeChanged;
        graphC.OnChange += GraphChanged;
        seriesCountC.OnChange += SeriesCountChanged;
        seriesNoCountC.OnChange += SeriesNoCountChanged;

        setOriginalPropertyValues();
        PauseCallbacks();
    }