Example #1
0
 private void Preload()
 {
     string[] array = this.preloadEvents;
     for (int i = 0; i < array.Length; i++)
     {
         string text = array[i];
         UnityUtil.Log(string.Format("Preloading {0}...", text));
         bool             flag = false;
         EventDescription eventDescription;
         if (UnityUtil.ERRCHECK(FMOD_StudioSystem.instance.System.getEvent(text, out eventDescription)))
         {
             flag = UnityUtil.ERRCHECK(eventDescription.loadSampleData());
         }
         if (flag)
         {
             UnityUtil.Log(string.Format("Preloading {0} succeeded.", text));
         }
         else
         {
             UnityUtil.LogWarning(string.Format("Preloading {0} failed!", text));
         }
     }
     foreach (KeyValuePair <string, int> current in FMOD_Listener.sPreloadRequests)
     {
         if (current.Value > 0)
         {
             FMOD_StudioSystem.PreloadEvent(current.Key, current.Value);
         }
     }
     FMOD_Listener.sPreloadRequests.Clear();
     FMOD_Listener.sPreloadComplete = true;
 }
Example #2
0
 public override void TryPreload()
 {
     if (!this.preloadComplete)
     {
         this.preloadComplete = FMOD_StudioSystem.PreloadEvent(this.OpenEvent);
     }
 }
Example #3
0
 private void Start()
 {
     FMOD_StudioSystem.PreloadEvent(this.rockOnTree);
     FMOD_StudioSystem.PreloadEvent(this.rockBush);
     FMOD_StudioSystem.PreloadEvent(this.rockWater);
     FMOD_StudioSystem.PreloadEvent(this.rockOnGround);
 }
Example #4
0
 private void Start()
 {
     this.doStart();
     if (!CoopPeerStarter.DedicatedHost)
     {
         FMOD_StudioSystem.PreloadEvent(this.walkFootstepEvent);
         FMOD_StudioSystem.PreloadEvent(this.runFootstepEvent);
     }
 }
Example #5
0
 private void Start()
 {
     if (!CoopPeerStarter.DedicatedHost)
     {
         FMOD_StudioSystem.PreloadEvent(this.rockOnTree);
         FMOD_StudioSystem.PreloadEvent(this.rockBush);
         FMOD_StudioSystem.PreloadEvent(this.rockWater);
         FMOD_StudioSystem.PreloadEvent(this.rockOnGround);
     }
 }
Example #6
0
 private void Start()
 {
     string[] array = this.AllEventPaths();
     for (int i = 0; i < array.Length; i++)
     {
         string path = array[i];
         FMOD_StudioSystem.PreloadEvent(path);
     }
     if (this.Remote)
     {
         return;
     }
     this.prevPosition = base.GetComponent <Rigidbody>().position;
 }
Example #7
0
 public static void Preload(string path)
 {
     if (FMOD_Listener.sPreloadComplete)
     {
         FMOD_StudioSystem.PreloadEvent(path);
     }
     else if (FMOD_Listener.sPreloadRequests.ContainsKey(path))
     {
         Dictionary <string, int> dictionary;
         Dictionary <string, int> expr_2B = dictionary = FMOD_Listener.sPreloadRequests;
         int num = dictionary[path];
         expr_2B[path] = num + 1;
     }
     else
     {
         FMOD_Listener.sPreloadRequests[path] = 1;
     }
 }
Example #8
0
 private void Start()
 {
     if (!CoopPeerStarter.DedicatedHost)
     {
         foreach (string path in this.AllEventPaths())
         {
             FMOD_StudioSystem.PreloadEvent(path);
         }
         if (!this.Remote)
         {
             this.ZiplineLoopInstance = FMOD_StudioSystem.instance.GetEvent(this.ZiplineLoopEvent);
             if (this.ZiplineLoopInstance != null)
             {
                 this.ZiplineLoopInstance.getParameter("speed", out this.ZiplineLoopSpeedParameter);
             }
             this.GliderLoopInstance = FMOD_StudioSystem.instance.GetEvent(this.GliderLoopEvent);
             if (this.GliderLoopInstance != null)
             {
                 this.GliderLoopInstance.getParameter("speed", out this.GliderLoopSpeedParameter);
             }
             this.CraneLoopInstance           = FMOD_StudioSystem.instance.GetEvent(this.CraneLoopEvent);
             this.TurtleShellSledLoopInstance = FMOD_StudioSystem.instance.GetEvent(this.TurtleShellSledLoopEvent);
             if (this.TurtleShellSledLoopInstance != null)
             {
                 this.TurtleShellSledLoopInstance.getParameter("speed", out this.TurtleShellSledLoopSpeedParameter);
                 this.TurtleShellSledLoopInstance.getParameter("air", out this.TurtleShellSledLoopAirParameter);
                 this.TurtleShellSledLoopInstance.getParameter("snow", out this.TurtleShellSledLoopSnowParameter);
             }
         }
     }
     else
     {
         base.enabled = false;
     }
     if (this.Remote)
     {
         base.enabled = false;
         return;
     }
     this.prevPosition = base.GetComponent <Rigidbody>().position;
 }
Example #9
0
 private void Start()
 {
     this.hashIdle            = Animator.StringToHash("idling");
     this.previousPosition    = base.transform.position;
     this.eventsByItemIdCache = new Dictionary <int, ItemGroupEvent>();
     if (FMOD_StudioSystem.instance)
     {
         this.sledEvent = FMOD_StudioSystem.instance.GetEvent(this.pushSledEvent);
         if (this.sledEvent != null)
         {
             this.sledEvent.getParameter("speed", out this.sledSpeedParameter);
         }
         if (this.Remote)
         {
             return;
         }
         ItemGroupEvent[] array = this.AllItemGroupEvents();
         for (int i = 0; i < array.Length; i++)
         {
             ItemGroupEvent itemGroupEvent = array[i];
             int[]          itemIds        = itemGroupEvent._itemIds;
             for (int j = 0; j < itemIds.Length; j++)
             {
                 int key = itemIds[j];
                 this.eventsByItemIdCache[key] = itemGroupEvent;
                 FMOD_StudioSystem.PreloadEvent(itemGroupEvent.eventPath);
             }
         }
         FMOD_StudioSystem.PreloadEvent(this.breatheInEvent);
         FMOD_StudioSystem.PreloadEvent(this.breatheOutEvent);
         FMOD_StudioSystem.PreloadEvent(this.fallEvent);
     }
     else
     {
         UnityEngine.Debug.LogError("FMOD_StudioSystem.instance is null, could not initialize animEventManager audio");
     }
 }
Example #10
0
 private void Start()
 {
     this.doStart();
     FMOD_StudioSystem.PreloadEvent(this.walkFootstepEvent);
     FMOD_StudioSystem.PreloadEvent(this.runFootstepEvent);
 }
Example #11
0
 public static bool PreloadEvent(string path)
 {
     return(FMOD_StudioSystem.PreloadEvent(path, 1));
 }