123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using XRTool.Util;
- namespace ShadowStudio.Model
- {
- /// <summary>
- /// 物体的组件
- /// </summary>
- public class GoodsComponen : MonoBehaviour, ArtComponent
- {
- private ArtContainerHandler container;
- public ArtContainerHandler Container { get => container; }
- /// <summary>
- /// 删除资源
- /// </summary>
- 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);
- }
- /// <summary>
- /// 引用实例
- /// </summary>
- /// <returns></returns>
- public virtual GameObject GetInstace()
- {
- return gameObject;
- }
- /// <summary>
- /// 发送同步数据
- /// </summary>
- /// <param name="state"></param>
- /// <param name="status"></param>
- public virtual void SendTransfer(int state, int status)
- {
- if (Container != null)
- {
- Container.SendTransfer(state, status);
- }
- }
- /// <summary>
- /// 设置容器
- /// </summary>
- /// <param name="container"></param>
- /// <param name="art"></param>
- /// <param name="info"></param>
- 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);
- //}
- }
- /// <summary>
- /// 同步数据
- /// </summary>
- /// <param name="goods"></param>
- /// <param name="smooth"></param>
- public virtual void TransferSyn(GoodsInfo goods, bool smooth = true)
- {
- }
- }
- }
|