Example #1
0
        /// <summary>
        ///
        /// </summary>
        public void OnGUI()
        {
            int cnt = 0;

            if (textureViews != null)
            {
                cnt = textureViews.Length;
                EditorGUILayout.LabelField("Texture List(" + cnt + ")");
            }
            else
            {
                EditorGUILayout.HelpBox("Please Pull Request.", MessageType.Info);
            }

            if (cnt != 0)
            {
                using (new EditorGUI.IndentLevelScope()){
                    scrollPos = EditorGUILayout.BeginScrollView(scrollPos);
                    for (var i = 0; i < cnt; i++)
                    {
                        textureViews[i].OnGUI();
                    }
                    EditorGUILayout.EndScrollView();
                }
            }

            if (GUILayout.Button("Pull"))
            {
                var packet = new TexturePlayer.TextureKunPacket();
                packet.isResources = true;
                packet.isScene     = true;
                UnityChoseKunEditor.SendMessage <TexturePlayer.TextureKunPacket>(UnityChoseKun.MessageID.TexturePull, packet);
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="binaryReader"></param>
        public void OnMessageEvent(BinaryReader binaryReader)
        {
            var textureKunPacket = new TexturePlayer.TextureKunPacket();

            textureKunPacket.Deserialize(binaryReader);
            textureKuns  = textureKunPacket.textureKuns;
            textureViews = new TextureView[textureKuns.Length];
            textureNames = new string[textureKuns.Length];
            for (var i = 0; i < textureKuns.Length; i++)
            {
                textureViews[i] = new TextureView(textureKuns[i]);
                textureNames[i] = textureKuns[i].name;
            }
        }