コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     info   = GetComponentInParent <HandDebugInfo>();
     parent = transform.parent;
     transform.SetParent(null);
     rigidbody = GetComponent <Rigidbody>();
 }
コード例 #2
0
 // Update is called once per frame
 void Update()
 {
     if (!info)
     {
         info = GetComponent <HandDebugInfo>();
     }
     if (materialProperty == null)
     {
         materialProperty = new MaterialPropertyBlock();
     }
     materialProperty.SetColor("_BaseColor", forceGradient.Evaluate(info.force));
     for (int i = 0; i < rs.Length; i++)
     {
         rs[i].SetPropertyBlock(materialProperty);
     }
 }