public static void Load() { AssetBundle = bundle.AssetBundle; var allAssets = AssetBundle.LoadAllAssets(); if (allAssets.Length <= 0) { Debug.LogWarning("asset bundle is empty attempting manual reloading"); byte[] bytes = ModIO.ReadAllBytes("Resources/portal.unity3d"); AssetBundle.Unload(false); AssetBundle = new AssetBundle(); StatMaster.Instance.StartCoroutine(IELoad(AssetBundle.LoadFromMemoryAsync(bytes))); return; } RebuildForNewLevel(); }
public RocketsController() { rocketTargetDict = new Dictionary <BlockBehaviour, int>(); playerGroupedRockets = new Dictionary <int, Dictionary <KeyCode, HashSet <TimedRocket> > >(); InitRedSquareAndLayer(); void InitRedSquareAndLayer() { redSquareAim.LoadImage(ModIO.ReadAllBytes(@"Resources/Square-Red.png")); redCircleAim.LoadImage(ModIO.ReadAllBytes(@"Resources/Circle-Red.png")); SetRadarIgnoreCollosionLayer(); void SetRadarIgnoreCollosionLayer() { Physics.IgnoreLayerCollision(RadarScript.CollisionLayer, RadarScript.CollisionLayer, true); Physics.IgnoreLayerCollision(RadarScript.CollisionLayer, 29, true); } } }