public void CanvasListWillReturn(CanvasController.CanvasUIScreen fromScreen, HashSet <CanvasListCell <SoundMarker> > currentSelectedCells)
        {
            if (fromScreen == CanvasController.CanvasUIScreen.SoundMarkerList &&
                soundMarkerList.listMode == CanvasSoundMarkerList.Mode.SyncronisedMarkers)
            {
                SoundMarker selMarker = objectSelection.selectedMarker;
                if (selMarker == null)
                {
                    return;
                }

                // Save associated cells
                HashSet <string> markerIDs = new HashSet <string>();

                markerIDs.Add(selMarker.hotspot.id);
                foreach (CanvasListCell <SoundMarker> cell in currentSelectedCells)
                {
                    markerIDs.Add(cell.datum.hotspot.id);
                }

                // Synchronise trigger states and playback
                foreach (SoundMarker marker in MainController.soundMarkers)
                {
                    if (markerIDs.Contains(marker.hotspot.id))
                    {
                        marker.hotspot.SetTriggerPlayback(true);
                        marker.PlayAudioFromBeginning();
                    }
                }

                // Save all the synchronised markers
                Layout curLayout = GetCurrentLayout();
                curLayout.setSynchronisedMarkerIDs(markerIDs);
            }
        }
Beispiel #2
0
 /// <summary>
 /// handles switching some of the GameObject states after a canvas change
 /// </summary>
 /// <param name="canvas"></param>
 /// <param name="oldCanvas"></param>
 public void CanvasBecameActive(CanvasController.CanvasUIScreen canvas, CanvasController.CanvasUIScreen oldCanvas)
 {
     if (canvas == CanvasController.CanvasUIScreen.AddSounds)
     {
         soundPlacement.SetCursorModelHidden(false);
         SetSoundMarkerRadiusUIParentToCursor();
         objectSelection.SetSelectionMinRadiusVisible(false);
         objectSelection.SetSelectionMaxRadiusVisible(true);
         objectSelection.SetSelectionRadiusColor(Color.white);
     }
     else if (canvas == CanvasController.CanvasUIScreen.EditSound)
     {
         soundPlacement.SetCursorModelHidden(true);
     }
     else if (canvas == CanvasController.CanvasUIScreen.Main)
     {
         soundPlacement.SetCursorModelHidden(true);
         objectSelection.SetSelectionMinRadiusVisible(false);
         objectSelection.SetSelectionMaxRadiusVisible(false);
     }
 }
 /// <summary>
 /// handles switching some of the GameObject states after a canvas change
 /// </summary>
 /// <param name="canvas"></param>
 /// <param name="oldCanvas"></param>
 public void CanvasBecameActive(CanvasController.CanvasUIScreen canvas, CanvasController.CanvasUIScreen oldCanvas) {
     if (canvas == CanvasController.CanvasUIScreen.AddSounds) {
         soundPlacement.SetCursorModelHidden(false);
         SetSoundMarkerRadiusUIParentToCursor();
         objectSelection.setShape(SoundShape.Sphere);
         objectSelection.SetSelectionMinRadiusVisible(false);
         objectSelection.SetSelectionMaxRadiusVisible(true);
         objectSelection.SetSelectionRadiusColor(Color.white);
     } else if (canvas == CanvasController.CanvasUIScreen.EditSound) {
         soundPlacement.SetCursorModelHidden(true);
     } else if (canvas == CanvasController.CanvasUIScreen.Main) {
         soundPlacement.SetCursorModelHidden(true);
         objectSelection.SetSelectionMinRadiusVisible(false);
         objectSelection.SetSelectionMaxRadiusVisible(false);
         
         canvasControl.mainScreen.UpdateMarkerCountLabel(
             MainController.soundMarkers.Count, 
             layoutManager.loadedAudioClipCount, 
             layoutManager.soundDictionary.Count - 1);
     }
 }
        public void CanvasListWillReturn(CanvasController.CanvasUIScreen fromScreen, HashSet <CanvasListCell <SoundMarker> > currentSelectedCells)
        {
            if (fromScreen == CanvasController.CanvasUIScreen.SoundMarkerList &&
                soundMarkerList.listMode == CanvasSoundMarkerList.Mode.SyncronisedMarkers)
            {
                SoundMarker selMarker = objectSelection.selectedMarker;
                if (selMarker == null)
                {
                    return;
                }

                // Save associated cells
                HashSet <string> markerIDs = new HashSet <string>();

                markerIDs.Add(selMarker.hotspot.id);
                foreach (CanvasListCell <SoundMarker> cell in currentSelectedCells)
                {
                    markerIDs.Add(cell.datum.hotspot.id);
                }

                Layout curLayout = GetCurrentLayout();
                curLayout.setSynchronisedMarkerIDs(markerIDs);
            }
        }
 public void CanvasListWillReturn(CanvasController.CanvasUIScreen fromScreen, HashSet <CanvasListCell <SoundFile> > currentSelectedCells)
 {
 }