Ejemplo n.º 1
0
    void QuoteEnter(QuoteStyles styles, int ctrlIndex)
    {
        switch (styles.quoteStyle)
        {
        case QuoteStyle.OnlyOne:
            quoteCtrl[ctrlIndex].PlaceQuoteOnBone(styles);
            if (quoteCtrl[ctrlIndex].list.Count > 0)
            {
                while (quoteCtrl[ctrlIndex].list.Count != 0)
                {
                    QuoteExit(quoteCtrl[ctrlIndex].list[0], ctrlIndex);
                }
            }
            break;

        case QuoteStyle.Time:
            quoteCtrl[ctrlIndex].PlaceQuoteOnBone(styles);
            StartCoroutine(this.DelayMethod(3f, () => { QuoteExit(styles, ctrlIndex); }));
            break;

        case QuoteStyle.List:
            if (quoteCtrl[ctrlIndex].list.Count > styles.ListMax - 1)
            {
                QuoteExit(quoteCtrl[ctrlIndex].list[0], ctrlIndex);
            }
            quoteCtrl[ctrlIndex].UpdateList(styles);
            break;

        default:
            break;
        }
        switch (styles.alphaStyle)
        {
        case AlphaStyle.AlphaAlpha:
        case AlphaStyle.AlpahDefault:
            AlphaController alpha = styles.panel.gameObject.AddComponent <AlphaController>();
            alpha.Init(styles.alphaTime, 0, false);
            break;
        }
        if (styles.moveDirection != Vector3.zero)
        {
            RectPositionMover rect = styles.panel.gameObject.AddComponent <RectPositionMover>();
            rect.Init(-styles.moveDirection, Vector3.zero, 0, styles.moveTime);
        }
        quoteCtrl[ctrlIndex].list.Add(styles);
    }
Ejemplo n.º 2
0
    void QuoteExit(QuoteStyles styles, int ctrlIndex)
    {
        quoteCtrl[ctrlIndex].list.Remove(styles);
        switch (styles.alphaStyle)
        {
        case AlphaStyle.AlphaAlpha:
        case AlphaStyle.DefaultAlpha:
            AlphaController alpha = styles.panel.gameObject.AddComponent <AlphaController>();
            alpha.Init(styles.alphaTime, 0, true);
            styles.panel.gameObject.AddComponent <AlphaDestroy>();
            break;

        default:
            Debug.Log("Delete");
            Destroy(styles.panel.gameObject, styles.alphaTime >= styles.moveTime ? styles.alphaTime : styles.moveTime);
            break;
        }
        if (styles.moveDirection != Vector3.zero)
        {
            RectPositionMover rect = styles.panel.gameObject.AddComponent <RectPositionMover>();
            rect.Init(Vector3.zero, styles.moveDirection, 0, styles.moveTime);
        }
    }