12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- 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);
- }
- }
- }
|