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