using System.Collections; using System.Collections.Generic; using UnityEngine; namespace DisComputer { /* * @func 渲染零件容器 * @author lz * @date 2020/07/09 */ public class RendererSpareContainer : MonoBehaviour { //模型配置 public SpareModelConfig config; [HideInInspector] //当前渲染模型 public GameObject curRendererGo; [HideInInspector] public SpareInfo curSpareInfo; // Start is called before the first frame update void Start() { } /// /// 设置当前渲染零件 /// /// public void SelectSpareRenderGo(SpareInfo info) { if (curRendererGo != null) curRendererGo.SetActive(false); for (int i = 0; i < config.spareModels.Count; i++) { //Debug.LogFormat("config.spareModels[i].name {0} info.name {1}", config.spareModels[i].name, info.name); if(config.spareModels[i].name == info.name) { curRendererGo = config.spareModels[i].modelGo; curSpareInfo = info; curRendererGo.SetActive(true); break; } } } } }