Пример #1
0
        private void Dots_Click(string category, int idx, Vector2 pos)
        {
            DoubleVector3 point = Data.GetPoint(category, idx);
            Dictionary <int, BillboardText> catgoryTexts;
            BillboardText b;

            if (mTexts.TryGetValue(category, out catgoryTexts) == false)
            {
                return;
            }
            if (catgoryTexts.TryGetValue(idx, out b) == false)
            {
                return;
            }
            foreach (BillboardText t in mActiveTexts)
            {
                if (t == null)
                {
                    continue;
                }
                if (t.UIText == null || t.UIText == b.UIText)
                {
                    continue;
                }
                foreach (ChartItemEffect effect in t.UIText.GetComponents <ChartItemEffect>())
                {
                    if (effect != null)
                    {
                        effect.TriggerOut(false);
                    }
                }
            }

            mActiveTexts.Clear();

            Text tx = b.UIText;

            if (tx != null)
            {
                ChartItemEvents e = tx.GetComponent <ChartItemEvents>();
                if (e != null)
                {
                    e.OnSelected.Invoke(e.gameObject);
                    mActiveTexts.Add(b);
                }

                /*   if (t != null)
                 * {
                 *  foreach (ChartItemEffect effect in t.GetComponents<ChartItemEffect>())
                 *      effect.TriggerIn(false);
                 * }*/
            }

            string xString = StringFromAxisFormat(point.x, mHorizontalAxis);
            string yString = StringFromAxisFormat(point.y, mVerticalAxis);

            OnItemSelected(new GraphEventArgs(idx, pos, point.ToDoubleVector2(), (float)point.z, category, xString, yString));
        }
Пример #2
0
        protected void SelectActiveText(BillboardText b)
        {
            TriggerActiveTextsOut();
            GameObject tx = b.UIText;

            if (tx != null)
            {
                ChartItemEvents e = tx.GetComponent <ChartItemEvents>();
                if (e != null)
                {
                    e.OnMouseHover.Invoke(e.gameObject);
                    AddActiveText(b);
                }
            }
        }