示例#1
0
        public GameBuffer ReadFile(string filename)
        {
            var path_filename = System.IO.Path.Combine(external_path, filename);

            universalApp.LogInfo(string.Format("UFS->ReadFile:{0}", path_filename));

            GameBuffer buffer = null;

            if (universalApp.GetCache().Exists(path_filename))
            {
                File file = universalApp.GetCache().GetFile(path_filename, true);
                universalApp.LogInfo(string.Format("UFS->ReadFile()->file_size:{0}", file.GetSize()));
                int        f_size = (int)file.GetSize();
                UCharArray uch    = new UCharArray(f_size);
                buffer = new GameBuffer(f_size);

                file.ReadBinary(uch);
                file.Close();
                buffer.bytes = uch.ToArray();

                universalApp.LogInfo(string.Format("UFS->ReadFile()->buffer_length:{0}", buffer.bytes.Length));
            }
            else
            {
                universalApp.LogError(string.Format("filename does not exists:{0}", universalApp));
            }
            return(buffer);
        }
示例#2
0
        public UniversalFileSystem(Platforms platform, EditorApplication universalApp)
        {
            this.platform = platform;
            //this.app = app;
            this.universalApp = universalApp;

#if UNITY_STANDALONE || UNITY_EDITOR
            external_path = "./Builds/";
#endif
#if UNITY_ANDROID && !UNITY_EDITOR
            global_path = GetAndroidInternalFilesDir("/games/Sector5661/");
#endif
            if (platform.currentPlatform != Platforms.Android && platform.currentPlatform != Platforms.iOS)
            {
                external_path = "h:/develop/salamandr.dev/Unity/2019/MapEditorSector/Builds/";
            }
            universalApp.LogInfo("global_path:" + external_path);
        }
示例#3
0
        public void Render()
        {
            IntRect rect          = new IntRect(0, 0, image.Width, image.Height);
            var     nodeList      = Node.GetChildren();
            var     interfaceType = typeof(SUI_Element);

            foreach (Node n in nodeList)
            {
                var comps = n.GetComponents();
                foreach (Component c in comps)
                {
                    if (interfaceType.IsInstanceOfType(c))
                    {
                        var element = (ISUI_Element)c;
                        if (element != null)
                        {
                            app.LogInfo(element.GetSpriteName());
                            element.Render(image, rect, null);
                        }
                    }
                }
            }
        }