private void SyncWeight(float weight) { if (director.playableGraph.IsValid()) { int rootPlayableCount = director.playableGraph.GetRootPlayableCount(); for (int i = 0; i < rootPlayableCount; i++) { Playable rootPlayable = director.playableGraph.GetRootPlayable(i); if (rootPlayable.IsValid() && rootPlayable.CanSetWeights()) { for (int j = 0; j < rootPlayable.GetInputCount(); j++) { rootPlayable.SetInputWeight(j, weight); } } } } }