void C_Group(int group) { List <Transform> oriS = oriGroupList[group]; List <Transform> tarS = tarGroupList[group]; List <C_AssembleOBJ> casS = casGroupList[group]; for (int i = 0; i < oriS.Count; i++) { C_AssembleOBJ tempCas = casS[i]; tempCas.state = W_AssembleState.拆ING; //Debug.Log("【组别】:"+ group + " 原始物体:"+ori[i].name + " 目标物体:"+tar[i].name +" 字典物体 "+cas[i].DicGroupTarTrans[group].name); oriS[i].DOLocalMove(tarS[i].localPosition, duration) .OnComplete(() => { tempCas.state = W_AssembleState.拆ED; if (null != Chai_Step_Complete) { Chai_Step_Complete.Invoke(tempCas.transform); } }); oriS[i].DOLocalRotate(tarS[i].localEulerAngles, duration); } }
void Z_Group(int group) { //这一组的原始物体,目标物体和他们的组件 List <Transform> oriS = oriGroupList[group]; List <Transform> tarS = tarGroupList[group]; List <C_AssembleOBJ> casS = casGroupList[group]; for (int i = 0; i < oriS.Count; i++) { C_AssembleOBJ tempCas = casS[i]; tempCas.state = W_AssembleState.装ING; //当前组是当前物体groups的第几组 int asIndex = casS[i].groups.IndexOf(group); if (asIndex == 0) { //Debug.Log("【组别】:" + group+ " 当前物体的名字:" + oriS[i].name+ " 当先组别是当前物体的第几组" + asIndex+ " 目标物体是它本身,但它本身此刻早已改变位置:" + oriS[i].name); oriS[i].DOLocalMove(casS[i].oriPostion, duration) .OnComplete(() => { tempCas.state = W_AssembleState.装ED; if (null != Zhuang_Step_Complete) { Zhuang_Step_Complete.Invoke(tempCas.transform); } }); oriS[i].DOLocalRotate(casS[i].oriEuler, duration); } else { Transform tar = casS[i].DicGroupTarTrans[casS[i].groups[asIndex - 1]];; //Debug.Log("【组别】:" + group+ " 当前物体的名字:" + oriS[i].name+ " 当先组别是当前物体的第几组" + asIndex + " 目标物体:" + casS[i].DicGroupTarTrans[casS[i].groups[asIndex - 1]].name); oriS[i].DOLocalMove(tar.localPosition, duration).OnComplete(() => tempCas.state = W_AssembleState.装ED); oriS[i].DOLocalRotate(tar.localEulerAngles, duration); } } }