using System.Collections; using System.Collections.Generic; using UnityEngine; using XRTool.Util; namespace ShadowStudio.Model { /// /// 物体的组件 /// public class GoodsComponen : MonoBehaviour, ArtComponent { private ArtContainerHandler container; public ArtContainerHandler Container { get => container; } /// /// 删除资源 /// public virtual void DestroyArt() { if (Container) { if(Container.gameObject.activeSelf) { Container.gameObject.SetActive(false); HttpsSendLog.Instance.SendLog("ClickOnDelete", " DestroyArt" + Container.gameObject.name); Destroy(Container.gameObject); } } //Destroy(gameObject); } /// /// 引用实例 /// /// public virtual GameObject GetInstace() { return gameObject; } /// /// 发送同步数据 /// /// /// public virtual void SendTransfer(int state, int status) { if (Container != null) { Container.SendTransfer(state, status); } } /// /// 设置容器 /// /// /// /// public virtual void SetContainer(ArtContainerHandler container, Object art, ArtInfo info) { this.container = container; //if (art is GameObject) //{ // GameObject obj = art as GameObject; // UnityUtil.SetParent(transform, obj.transform); //} } /// /// 同步数据 /// /// /// public virtual void TransferSyn(GoodsInfo goods, bool smooth = true) { } } }