using System.Collections; using System.Collections.Generic; using UnityEngine; using System; namespace DisComputer { /* * @func DIY零件组装皮肤置换 * @author lz * @date 2020/07/13 */ public class SpareSkinner : MonoBehaviour { public List configs; private GameObject curSkinGo; private SpareAnimationBase animationBase; // Start is called before the first frame update void Start() { animationBase = this.gameObject.GetComponent(); } /// /// 设置当前皮肤 /// /// public void SetCurSkin(string name) { for (int i = 0; i < configs.Count; i++) { if(configs[i].name == name) { animationBase.mainGo = configs[i].skinGo; animationBase.SetUnloadState(); break; } } } } [Serializable] public class SkinConfig { public string name; public GameObject skinGo; } }