Esempio n. 1
0
        public void OnGUI()
        {
            int cnt = 0;

            if (m_spriteViews != null)
            {
                cnt = m_spriteViews.Length;
                EditorGUILayout.LabelField("Sprite List(" + cnt + ")");
            }
            else
            {
                EditorGUILayout.HelpBox("Please Push Pull Button.", MessageType.Info);
            }

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

            if (GUILayout.Button("Pull"))
            {
                var packet = new AssetPacket <SpriteKun>();
                packet.isResources = true;
                packet.isScene     = true;
                UnityChoseKunEditor.SendMessage <AssetPacket <SpriteKun> >(UnityChoseKun.MessageID.SpritePull, packet);
            }
        }
Esempio n. 2
0
        public void OnMessageEvent(BinaryReader binaryReader)
        {
            var packet = new AssetPacket <SpriteKun>();

            packet.Deserialize(binaryReader);
            m_spriteKuns  = packet.assetKuns;
            m_spriteViews = new SpriteView[m_spriteKuns.Length];
            m_spriteNames = new string[m_spriteKuns.Length];
            for (var i = 0; i < m_spriteKuns.Length; i++)
            {
                m_spriteViews[i] = new SpriteView(m_spriteKuns[i]);
                m_spriteNames[i] = m_spriteKuns[i].name;
            }
        }
Esempio n. 3
0
        public void OnMessageEventPull(BinaryReader binaryReader)
        {
            var assetPacket = new AssetPacket <B>();

            assetPacket.Deserialize(binaryReader);
            if (assetPacket.isResources)
            {
                GetAllAssetInResources();
            }

            var assetKuns = new B[assetDict.Count];
            var i         = 0;

            foreach (var asset in assetDict.Values)
            {
                // ジェネリック引数付きのコンストラクター
                assetKuns[i++] = Constructer <B, A>(asset);
            }
            assetPacket = new AssetPacket <B>(assetKuns);
            UnityChoseKunPlayer.SendMessage <AssetPacket <B> >(m_messageID, assetPacket);
        }