Example #1
0
    public IEnumerator C_One()
    {
        //这个地方可能重复了,否则有时候按超多次的时候,会出现数组越界,出现次数很少,但是有时会有,尚未知道原因。强制去越界。
        if (groupIndex >= groupCount)
        {
            groupIndex = groupCount; state = General_State.拆完;
        }

        switch (state)
        {
        case General_State.拆完: chai_One = false; chaiFlag_One = false; yield break;

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

        case General_State.单装到一半: groupIndex += 1; break;

        case General_State.一键分步拆ing: chai_OneKeyAll = false; chaiFlag_OneKeyAll = false; break;

        case General_State.一键分步装ing: zhuang_OneKeyAll = false; zhuangFlag_OneKeyAll = false; break;
        }
        state = General_State.单拆ing;
        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);
            }
            allow       = Allow.无限制;
            groupIndex += 1;
            SetNowTrans_Aft();
        }
        if (groupIndex == groupCount)
        {
            state = General_State.拆完;
        }
        else
        {
            state = General_State.单拆到一半;
        }
        chai_One = false; chaiFlag_One = false;
        //xg
        OriGroupEffect(groupIndex);
    }
Example #2
0
    public IEnumerator Z_Order()
    {
        if (groupIndex <= -1)
        {
            groupIndex = -1; state = General_State.装完;
        }

        switch (state)
        {
        case General_State.拆完: groupIndex = groupCount - 1; break;

        case General_State.装完: zhuang_OneKeyAll = false; zhuangFlag_OneKeyAll = false; yield break;

        case General_State.单拆到一半: groupIndex -= 1; break;

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

        for (int i = groupIndex; i > -1; i--)
        {
            if (allow == Allow.只能一键装)
            {
                Z_Group(groupIndex);
                SetNowTrans_Pre(groupIndex);
            }
            yield return(new WaitForSeconds(duration * fellowRate));

            if (allow == Allow.只能一键装)
            {
                if (null != Zhuang_Group_Complete)
                {
                    Zhuang_Group_Complete.Invoke(groupIndex);
                }
                groupIndex -= 1;
                SetNowTrans_Aft();
            }
        }
        //被这个无限制弄的不行
        if (allow == Allow.只能一键装)
        {
            state            = General_State.装完; allow = Allow.无限制;
            zhuang_OneKeyAll = false; zhuangFlag_OneKeyAll = false;
        }
    }
Example #3
0
    public IEnumerator Z_One()
    {
        if (groupIndex <= -1)
        {
            groupIndex = -1; state = General_State.装完;
        }
        switch (state)
        {
        case General_State.拆完: groupIndex = groupCount - 1; break;

        case General_State.装完: zhuang_One = false; zhuangFlag_One = false; yield break;

        case General_State.单拆到一半: groupIndex -= 1; break;

        case General_State.一键分步拆ing: chai_OneKeyAll = false; chaiFlag_OneKeyAll = false; break;

        case General_State.一键分步装ing: zhuang_OneKeyAll = false; zhuangFlag_OneKeyAll = false; break;
        }
        state = General_State.单装ing; allow = Allow.只能单装;

        Z_Group(groupIndex);
        SetNowTrans_Pre(groupIndex);
        yield return(new WaitForSeconds(duration * fellowRate));

        if (allow == Allow.只能单装)
        {
            if (null != Zhuang_Group_Complete)
            {
                Zhuang_Group_Complete.Invoke(groupIndex);
            }
            allow       = Allow.无限制;
            groupIndex -= 1;
            SetNowTrans_Aft();
        }
        if (groupIndex == -1)
        {
            state = General_State.装完;
        }
        else
        {
            state = General_State.单装到一半;
        }
        zhuang_One = false; zhuangFlag_One = false;
    }
Example #4
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;
        }
    }
Example #5
0
    public IEnumerator Z_All()
    {
        state = General_State.一步装ing;
        allow = Allow.只能一步到位装;

        foreach (C_AssembleOBJ assemble in assembles_Obj)
        {
            assemble.state = W_AssembleState.装ING;
            assemble.transform.DOLocalMove
                (assemble.oriPostion, duration)
            .OnComplete(() => { assemble.state = W_AssembleState.装ED; groupIndex = -1; state = General_State.装完; });
            assemble.transform.DOLocalRotate(assemble.oriEuler, duration);
        }
        chai_One   = false; chaiFlag_One = false; chai_OneKeyAll = false; chaiFlag_OneKeyAll = false;
        zhuang_One = false; zhuangFlag_One = false; zhuang_OneKeyAll = false; zhuangFlag_OneKeyAll = false;
        yield return(new WaitForSeconds(duration));

        SetNowTrans_Aft();
        zhuang_OneStepAll     = false;
        zhuangFlag_OneStepAll = false;
        allow = Allow.无限制;
    }
Example #6
0
    public IEnumerator C_All()
    {
        state = General_State.一步拆ing;
        allow = Allow.只能一步到位拆;

        foreach (C_AssembleOBJ assemble in assembles_Obj)
        {
            assemble.state = W_AssembleState.装ING;
            assemble.transform.DOLocalMove
                (assemble.DicGroupTarTrans[assemble.groups[assemble.groups.Count - 1]].localPosition, duration)
            .OnComplete(() => { assemble.state = W_AssembleState.拆ED; groupIndex = groupCount; state = General_State.拆完; });
            assemble.transform.DOLocalRotate
                (assemble.DicGroupTarTrans[assemble.groups[assemble.groups.Count - 1]].localEulerAngles, duration);
        }
        chai_One   = false; chaiFlag_One = false; chai_OneKeyAll = false; chaiFlag_OneKeyAll = false;
        zhuang_One = false; zhuangFlag_One = false; zhuang_OneKeyAll = false; zhuangFlag_OneKeyAll = false;
        yield return(new WaitForSeconds(duration));

        SetNowTrans_Aft();
        chai_OneStepAll     = false;
        chaiFlag_OneStepAll = false;
        allow = Allow.无限制;
    }