示例#1
0
 // Token: 0x06000683 RID: 1667 RVA: 0x0006BCEC File Offset: 0x00069EEC
 private void SpawnEels()
 {
     if (BTDebugCamInputManager.GetConfigHolder().hackConfig != null && BTDebugCamInputManager.GetConfigHolder().hackConfig.eelRoast_spawnAllEels)
     {
         foreach (EelRoastMarkerInfo markerInfo in this._EelRoastInfos)
         {
             string randomEelPath = this.GetRandomEelPath(markerInfo);
             if (!string.IsNullOrEmpty(randomEelPath))
             {
                 string[] array = randomEelPath.Split(new char[]
                 {
                     '/'
                 });
                 RsResourceManager.LoadAssetFromBundle(array[0] + "/" + array[1], array[2], new RsResourceEventHandler(this.ResourceEventHandler), typeof(GameObject), false, markerInfo);
             }
             else
             {
                 UtDebug.Log("Eel Asset path is empty ");
             }
         }
     }
     else
     {
         if (this._EelRoastInfos == null || this._EelRoastInfos.Length < 1 || this._NoOfEelsToSpawn.Min < 1f || this._NoOfEelsToSpawn.Min > this._NoOfEelsToSpawn.Max)
         {
             return;
         }
         List <EelRoastMarkerInfo> list = new List <EelRoastMarkerInfo>(this._EelRoastInfos);
         int num = Mathf.Clamp(this._NoOfEelsToSpawn.GetRandomInt(), 1, this._EelRoastInfos.Length);
         for (int i = 0; i < num; i++)
         {
             int    index         = UnityEngine.Random.Range(0, list.Count);
             string randomEelPath = this.GetRandomEelPath(list[index]);
             if (!string.IsNullOrEmpty(randomEelPath))
             {
                 string[] array = randomEelPath.Split(new char[]
                 {
                     '/'
                 });
                 RsResourceManager.LoadAssetFromBundle(array[0] + "/" + array[1], array[2], new RsResourceEventHandler(this.ResourceEventHandler), typeof(GameObject), false, list[index]);
             }
             else
             {
                 UtDebug.Log("Eel Asset path is empty ");
             }
             list.RemoveAt(index);
         }
     }
 }
示例#2
0
    /* ConfigManagement
     * ============================================================================*/

    /*============================================================================
     * Cutscene Control */

    private static void LoadCutscene(BTCutsceneConfigEntry targetCutscene)
    {
        DeleteCurrentCutsceneObject();

        if (targetCutscene == null)
        {
            return;
        }

        if (targetCutscene.isLocalFile)
        {
            AssetBundle assetBundle = AssetBundle.LoadFromFile(targetCutscene.resourcePath);
            try{
                if (assetBundle == null)
                {
                    configHolder.LogMessage(LogType.Log, "Unable to load cutsceneBundle from path: " + targetCutscene.resourcePath);
                    return;
                }
                GameObject uninstantiatedCutsceneObject = assetBundle.LoadAsset <GameObject>(targetCutscene.assetName);
                if (uninstantiatedCutsceneObject == null)
                {
                    configHolder.LogMessage(LogType.Log, "Unable to find GameObject (" + targetCutscene.assetName + ") in loaded assetBundle");
                    return;
                }
                CutsceneLoadDone(uninstantiatedCutsceneObject);
            }finally{
                if (assetBundle != null)
                {
                    assetBundle.Unload(false);
                }
            }
        }
        else
        {
            RsResourceManager.LoadAssetFromBundle(
                targetCutscene.resourcePath,
                targetCutscene.assetName,
                new RsResourceEventHandler(CutsceneLoadEvent),
                typeof(GameObject),
                false,
                false
                );
        }
    }