Ejemplo n.º 1
0
    public List <int> Maopao_New(List <int> oris, W_SortMode mode = W_SortMode.升序)
    {
        List <int> tars = U_List.CopyList(oris);

        if (mode == W_SortMode.升序)
        {
            for (int i = 0; i < tars.Count - 1; i++)
            {
                for (int j = 0; j < tars.Count - 1 - i; j++)
                {
                    if (tars[j] > tars[j + 1])
                    {
                        U_Exchange.ExchangeFromList(ref tars, j);
                    }
                }
            }
        }
        else
        {
            for (int i = 0; i < tars.Count - 1; i++)
            {
                for (int j = 0; j < tars.Count - 1 - i; j++)
                {
                    if (tars[j] < tars[j + 1])
                    {
                        U_Exchange.ExchangeFromList(ref tars, j);
                    }
                }
            }
        }
        return(tars);
    }
Ejemplo n.º 2
0
    public void Init()
    {
        casSS  = U_List.NewListOfList <C_CascadeMenu>(9);
        casAll = transform.GetComponentsInChildren <C_CascadeMenu>(true);
        foreach (C_CascadeMenu cas in casAll)
        {
            switch (cas.level)
            {
            case 1: casSS[0].Add(cas); break;

            case 2: casSS[1].Add(cas); break;

            case 3: casSS[2].Add(cas); break;

            case 4: casSS[3].Add(cas); break;

            case 5: casSS[4].Add(cas); break;

            case 6: casSS[5].Add(cas); break;

            case 7: casSS[6].Add(cas); break;

            case 8: casSS[6].Add(cas); break;

            case 9: casSS[6].Add(cas); break;
            }
        }
    }
Ejemplo n.º 3
0
 void SetNowTrans_Aft()
 {
     if (null == movingTrans)
     {
         movingTrans = new List <Transform>();
     }
     U_List.ClearList(movingTrans);
 }
Ejemplo n.º 4
0
 public void DataReset()
 {
     U_List.ClearList <Transform>(children, moveTrans);
     U_List.ClearList <string>(childrenNames, moveNames);
     U_List.ClearList <Vector3>(oriPosList, tarPosList);
     U_List.ClearList <int>(orderList);
     U_List.ClearList <FellowInstall>(elements, toMoveList);
 }
Ejemplo n.º 5
0
    /// <summary>
    /// 将一个字符串数组根据i分类,按类别分组
    /// </summary>
    /// <param name="length"></param>
    /// <param name="ori"></param>
    /// <returns></returns>
    public static List <List <string> > StrSTo_Type_List(int length, string[] ori)
    {
        List <List <string> > strSList = U_List.NewListOfList <string>(length);

        for (int i = 0; i < ori.Length; i++)
        {
            int yushu = i % length;
            strSList[yushu].Add(ori[i]);
        }
        return(strSList);
    }
Ejemplo n.º 6
0
    public void RemoveData()
    {
        this.groupCount   = 0;
        this.allStepCount = 0;
        U_List.ClearList(brother, oriTrans_Obj, oriTrans_AllStep, tarTrans_AllStep);
        U_List.ClearList(assembles_Obj);
        U_List.ClearList(eachGroupCount);
        U_List.ClearList(oriGroupList, tarGroupList);
        U_List.ClearList(casGroupList);

        U_Component.RemoveChildrenComponents <C_AssembleOBJ>(transform, true, true);
    }
Ejemplo n.º 7
0
 void SetNowTrans_Pre(int groupIndex)
 {
     if (null == movingTrans)
     {
         movingTrans = new List <Transform>();
     }
     if (state == General_State.一步拆ing || state == General_State.一步装ing)
     {
         U_List.ClearList(movingTrans);
     }
     else
     {
         movingTrans = U_List.CopyList(oriGroupList[groupIndex]);
     }
 }
Ejemplo n.º 8
0
    /// <summary>
    /// 将一个字符串数组根据i分类,按物体分组
    /// </summary>
    /// <param name="length"></param>
    /// <param name="ori"></param>
    /// <returns></returns>
    public static List <List <string> > StrSTo_Group_List(int length, string[] ori)
    {
        int strlenth = ori.Length / length;
        List <List <string> > strSList = U_List.NewListOfList <string>(strlenth);
        int bigIndex = -1;

        for (int i = 0; i < ori.Length; i++)
        {
            if (i % length == 0)
            {
                bigIndex += 1;
            }
            strSList[bigIndex].Add(ori[i]);
        }
        return(strSList);
    }
Ejemplo n.º 9
0
    void GetMoveTransAndNameList(string mark)
    {
        U_List.ClearList(children, moveTrans);
        U_List.ClearList(childrenNames, moveNames);
        GetChildren();
        GetChildrenName();

        foreach (Transform trans in children)
        {
            if (U_String.JudeLastContain(trans.name, mark, 5))
            {
                moveTrans.Add(trans);
                moveNames.Add(trans.name);
            }
        }
    }
Ejemplo n.º 10
0
    public IEnumerator C_Order()
    {
        if (groupIndex >= groupCount)
        {
            groupIndex = groupCount; state = General_State.拆完;
        }

        switch (state)
        {
        case General_State.拆完: chai_OneKeyAll = false; chaiFlag_OneKeyAll = false; U_List.ClearList(movingTrans); yield break;

        case General_State.装完: groupIndex = 0; break;

        case General_State.单装到一半: groupIndex += 1; break;
        }
        state = General_State.一键分步拆ing;
        allow = Allow.只能一键拆;

        for (int i = groupIndex; i < groupCount; i++)
        {
            if (allow == Allow.只能一键拆)
            {
                C_Group(groupIndex);
                SetNowTrans_Pre(groupIndex);
            }
            yield return(new WaitForSeconds(duration * fellowRate));

            if (allow == Allow.只能一键拆)
            {
                if (null != Chai_Group_Complete)
                {
                    Chai_Group_Complete.Invoke(groupIndex);
                }
                groupIndex += 1;
                SetNowTrans_Aft();
            }
        }
        if (allow == Allow.只能一键拆)
        {
            state          = General_State.拆完; allow = Allow.无限制;
            chai_OneKeyAll = false; chaiFlag_OneKeyAll = false;
        }
    }