using UnityEngine; using YooAsset; namespace GFGGame { public class DressUpRemoveOperation : DressUpOperationBase { private int itemID; private GameObject sceneObj; private GameObject parentObj; public DressUpRemoveOperation(int itemID, GameObject sceneObj, GameObject parentObj) { this.itemID = itemID; this.sceneObj = sceneObj; this.parentObj = parentObj; Debug.Log($"remove {itemID}"); } internal override void Release() { this.sceneObj = null; this.parentObj = null; } internal override void Start() { Status = EOperationStatus.Succeed; } internal override void Update() { } internal override void Cancel() { Status = EOperationStatus.Failed; Error = "User cancel."; } internal override bool CheckRepeated(DressUpOperationBase t) { var operation = t as DressUpRemoveOperation; return (operation != null && operation.itemID == this.itemID && operation.sceneObj == this.sceneObj); } internal override void UpdateView() { if(sceneObj == null) { this.Release(); return; } Debug.Log($"UpdateView remove {itemID}"); DressUpUtil.RemoveItem(this.itemID, this.sceneObj, this.parentObj); } } }