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) { 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) { } } }