void RightSildeSwap() { launcherController.Log(TAG, "RightSildeSwap"); LauncherModel launcherModel = launcherController.launcherModel; List <App> appList = launcherController.appList; List <GameObject> iconList = launcherController.pageChildList; int firstIndexOnDropPage = swapInfo.dropPage * launcherModel.pageItemNum; IconController iconController = iconList [firstIndexOnDropPage].GetComponent <IconController> (); if (iconController.regressLocation != null) { //regress if (appList [swapInfo.dropIndex].isPlaceholder) { swapInfo.dropIndex = swapInfo.firstEmptyIconIndexOnDropPage - 1; swapInfo.dropModel = appList [swapInfo.dropIndex]; swapInfo.dropIcon = iconList [swapInfo.dropIndex]; swapInfo.dropLocation = swapInfo.dropIcon.GetComponent <IconController> ().originLocation; } //drag page icon 往前挪 launcherController.IconAdvance(swapInfo.dragIndex, swapInfo.dragIndex + 1, swapInfo.dropIndex, true); appList.RemoveAt(swapInfo.dragIndex); iconList.RemoveAt(swapInfo.dragIndex); appList.Insert(swapInfo.dropIndex, swapInfo.dragModel); iconList.Insert(swapInfo.dropIndex, swapInfo.dragIcon); } else { //drag page icon 往前挪 launcherController.IconAdvance(swapInfo.dragIndex, swapInfo.dragIndex + 1, swapInfo.lastIndexOnDragPage, false); appList.RemoveAt(swapInfo.dragIndex); iconList.RemoveAt(swapInfo.dragIndex); //drag page 末尾插入一个占位icon launcherController.addPlaceholder(swapInfo.dragPage, swapInfo.lastIndexOnDragPage, swapInfo.lastLocationOnDragPage); if (appList [swapInfo.dropIndex].isPlaceholder) { // launcherController.Log (TAG, "RightSildeSwap DestoryFirstEmptyOnDropPageAndResetDropInfo"); DestoryFirstEmptyOnDropPageAndResetDropInfo(); } else { //drop page icon 往后挪 // launcherController.Log (TAG, "RightSildeSwap launcherController.IconBackward"); launcherController.IconBackward(swapInfo.dropIndex, iconList.Count - 1, true); appList.Insert(swapInfo.dropIndex, swapInfo.dragModel); iconList.Insert(swapInfo.dropIndex, swapInfo.dragIcon); } } // launcherController.Log (TAG, "RightSildeSwap SetOriLocation (swapInfo.dropLocation):"+swapInfo.dropLocation); swapInfo.dragIcon.GetComponent <IconController> ().SetOriLocation(swapInfo.dropLocation); iconMovingInfo.dragIndex = iconMovingInfo.dropIndex; }