Пример #1
0
 public void UpdateMaterialRotation(BeatmapObjectContainer obj)
 {
     if (obj is BeatmapObstacleContainer || obj is BeatmapNoteContainer)
     {
         Renderer[] renderers = obj.GetComponentsInChildren <Renderer>();
         foreach (Renderer renderer in renderers) //Welcome to Python.
         {
             foreach (Material mat in renderer.materials)
             {
                 if (mat.HasProperty("_Rotation"))
                 {
                     mat.SetFloat("_Rotation", hasTempRotation ? 0 : RotationValue);
                 }
             }
         }
     }
 }
Пример #2
0
 public void AttachContainer(BeatmapObjectContainer obj)
 {
     obj.transform.SetParent(ObjectParentTransform, false);
     obj.AssignTrack(this);
     if (obj is BeatmapObstacleContainer || obj is BeatmapNoteContainer)
     {
         Renderer[] renderers = obj.GetComponentsInChildren <Renderer>();
         foreach (Renderer renderer in renderers) //Welcome to Python.
         {
             foreach (Material mat in renderer.materials)
             {
                 if (mat.HasProperty("_Rotation"))
                 {
                     mat.SetFloat("_Rotation", RotationValue);
                 }
             }
         }
     }
 }