Ejemplo n.º 1
0
 public static void PreLoadTextureHook(On.RoomCamera.orig_PreLoadTexture orig, RoomCamera rCam, Room room, int camPos)
 {
     if (!ShouldScroll(room))
     {
         orig(rCam, room, camPos);
         return;
     }
     rCam.quenedTexture = WorldLoader.FindRoomFileDirectory(room.abstractRoom.name, true) + ".png";
     rCam.www           = new WWW(rCam.quenedTexture);
     orig(rCam, room, 0);
 }
Ejemplo n.º 2
0
        private static void RoomCamera_PreLoadTexture(On.RoomCamera.orig_PreLoadTexture orig, RoomCamera self, Room room, int camPos)
        {
            if (self.quenedTexture == string.Empty)
            {
                string requestedTexture = WorldLoader.FindRoomFileDirectory(room.abstractRoom.name, true) + "_" + camPos + 1 + ".png";
                string path             = requestedTexture;

                string delimitator = "file:///";
                int    index       = path.IndexOf(delimitator) + delimitator.Length;
                path = path.Substring(index);

                //CustomWorldMod.CustomWorldLog($"Custom regions: PreloadTexture path [{path}] Exists [{File.Exists(path)}]");
                if (!File.Exists(path))
                {
                    self.quenedTexture = FindCameraTexturePath(requestedTexture);
                    self.www           = new WWW(self.quenedTexture);
                }
            }

            orig(self, room, camPos);
        }