123456789101112131415161718192021222324252627 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using WebTools.Customizes.Behaviours;
- public class NpcTextureChanger : MonoBehaviour
- {
- [SerializeField]
- public SkinnedMeshRenderer mesh;
- [SerializeField]
- public Texture texture;
- [SerializeField]
- public string materialPropertyId= "_MainTex";
- [SerializeField]
- public List<string> materialColorIds;
- [SerializeField]
- public Color color;
- private void OnEnable()
- {
- mesh.material.SetTexture(materialPropertyId, texture);
- foreach(string colorId in materialColorIds)
- {
- mesh.material.SetColor(colorId, color);
- }
- }
- }
|