Guest User

Untitled

a guest
May 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class CCDIKMasterSlider : MonoBehaviour {
  6.  
  7. [Range(0f,1f)]
  8. public float weight = 0;
  9.  
  10. [SerializeField]
  11. List<RootMotion.FinalIK.CCDIK> list = new List<RootMotion.FinalIK.CCDIK>();
  12.  
  13. void OnValidate() {
  14. updateAll();
  15. }
  16.  
  17. void Update() {
  18. updateAll();
  19. }
  20.  
  21. void updateAll() {
  22. foreach(RootMotion.FinalIK.CCDIK ik in list) {
  23. if(ik != null) ik.GetIKSolver().IKPositionWeight = weight;
  24. }
  25. }
  26. }
Add Comment
Please, Sign In to add comment