예제 #1
0
        public bool OnLoad(RSRenderCommand command, RSService service, byte[] data)
        {
            if (GetComponent <RawImage>() != null)
            {
                Texture2D t2d = null;

                if (GetComponent <RawImage>() == null || (newResolution && newWidth > 0 && newHeight > 0))
                {
                    newResolution = false;
                    t2d           = new Texture2D(newWidth, newHeight);
                    GetComponent <RawImage>().texture = t2d;
                }
                else
                {
                    t2d = GetComponent <RawImage>().texture as Texture2D;
                }

                if (t2d != null && data != null)
                {
                    t2d.LoadImage(data);
                }
            }

            return(true);
        }
예제 #2
0
        public static void Main()
        {
            Config.ACCESS_KEY = "<Please apply your access key>";
            Config.SECRET_KEY = "<Dont send your secret key to anyone>";

            bucketName  = "yourbucket";
            DEMO_DOMAIN = bucketName + ".qiniudn.com";
            key         = "gogopher.jpg";
            localFile   = "Resource/gogopher.jpg";
            bigkey      = key;
            bigFile     = localFile;

            conn = new DigestAuthClient();
            rs   = new RSService(conn, bucketName);

            MkBucket();
            RSClientPutFile();
            RSClientPutFileWithCRC32();
            Get(key);
            ResumablePutFile();
            Stat(bigkey);
            Delete(key);
            Drop();

            MkBucket();
            ImageOps();

            MakeDownloadToken();

            Console.ReadLine();
        }
예제 #3
0
        public bool OnLoad(RSRenderCommand command, RSService service, byte[] data)
        {
            // Updating the texture has to be done in the game loop and not from a different thread.
            lock (DataLock)
            {
                CurrentData = data;
                HasNewData  = true;
            }

            return(true);
        }
예제 #4
0
        protected void InitValues()
        {
            ReceivedFirstRender = false;

            string rand = RSUtils.RandomString();

            if (RenderLoopName == null || RenderLoopName.Length == 0)
            {
                RenderLoopName = "loop_" + rand;
            }

            KeepAliveService = new RSService(Scene.Host, Scene.Port);
        }