You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.2 KiB
61 lines
1.2 KiB
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<SkinConfig> configs;
|
|
|
|
private GameObject curSkinGo;
|
|
|
|
|
|
private SpareAnimationBase animationBase;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
animationBase = this.gameObject.GetComponent<SpareAnimationBase>();
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 设置当前皮肤
|
|
/// </summary>
|
|
/// <param name="name"></param>
|
|
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;
|
|
|
|
}
|
|
|
|
}
|