Ejemplo n.º 1
0
    //建立圖格鍊(僅回傳一個Enum List)
    //[param] isCover = 是否覆蓋儲存至共用圖格鍊
    //public List<ElementImageType> BuildElementList(bool isCover)
    //{
    //    List<ElementImageType> _sourceList = new List<ElementImageType>(); //來源列表(抽取用)
    //    List<ElementImageType> _outputList = new List<ElementImageType>(); //輸出列表

    //    for (int i = 0; i < elementAttribute.m_data.Count; i++) //遍歷所有種類圖格
    //    {
    //        for (int j = 0; j < elementAttribute.m_data[i].amount; j++) //照各種類之設定數量重複執行
    //        {
    //            _sourceList.Add(elementAttribute.m_data[i].imgType);
    //        }
    //    }

    //    RandomExtract(_sourceList, ref _outputList); //打亂排序

    //    //TestMessageScript<ElementImageType>.PrintListElements("[BuildElementList]", _outputList);

    //    if (isCover) defaultElementChain = _outputList; //覆蓋儲存至共用圖格鍊
    //    return _outputList;
    //}

    //圖格動畫撥放
    //[param] animationType = 動畫類型 , targetPosList = 指定撥放動畫的座標圖格 , onOff = 開關
    public void PlayElementAnimation(ElementAnimationType animationType, List <Vector2> targetPosList, bool onOff)
    {
        ElementAnimationEventArgs e = new ElementAnimationEventArgs(animationType, targetPosList, onOff);

        if (ElementAnimationPlayed != null)
        {
            ElementAnimationPlayed.Invoke(this, e);
        }
    }
Ejemplo n.º 2
0
    //中獎動畫控制
    public void PlayAnimation(ElementAnimationType animType, bool b)
    {
        if (anim == null)
        {
            anim = this.GetComponent <Animator>();
        }

        switch (animType)
        {
        case ElementAnimationType.全部動畫停止:
            anim.SetBool("isMatch", false);
            break;

        case ElementAnimationType.中獎:
            anim.SetBool("isMatch", b);
            break;
        }
    }
Ejemplo n.º 3
0
 //建構子(多載2/2) 不指定開關時, 預設為開(true)
 public ElementAnimationEventArgs(ElementAnimationType type, List <Vector2> posList)
 {
     animationType = type;
     targetPosList = posList;
     onOff         = true;
 }