ClothingAdjuster.cs 493 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class ClothingAdjuster : MonoBehaviour {
  5. [SerializeField]
  6. private int AdjustValue = 100;
  7. [SerializeField]
  8. private int AdjusIndex = 1;
  9. private void OnEnable()
  10. {
  11. SkinnedMeshRenderer currentItem = GetComponentInChildren<SkinnedMeshRenderer>();
  12. if(currentItem!=null)
  13. {
  14. currentItem.SetBlendShapeWeight(AdjusIndex, AdjustValue);
  15. }
  16. }
  17. }