Пример #1
0
        public static void sys_fm_png(StudioController game, string param = "")
        {
            // set frame png, param = png file name, CharaStudio only

            var pngName = param.Trim();

            if (pngName != "")
            {
                if (!pngName.ToLower().EndsWith(".png"))
                {
                    pngName += ".png";
                }
                // load png in game scene folder if existed
                var pngInScene = Utils.combine_path(game.get_scene_dir(), game.sceneDir, pngName);
                if (File.Exists(pngInScene))
                {
                    var pngRevPath = Utils.combine_path("..", "studio", "scene", game.sceneDir, pngName);
                    game.scene_set_framefile(pngRevPath);
                    return;
                }
                // load png in game default background folder if existed
                var pngInDefault = Path.GetFullPath(Utils.combine_path(Application.dataPath, "..", "UserData", "frame", pngName));
                if (File.Exists(pngInDefault))
                {
                    game.scene_set_framefile(pngName);
                    return;
                }
            }
            // remove if param == "" or file not existed
            game.scene_set_framefile("");
        }