Example #1
0
        /// <summary>
        /// EditorからPlayerへの受信
        /// </summary>
        /// <param name="args"></param>
        void OnMessageEvent(MessageEventArgs args)
        {
            //UnityChoseKun.Log("UnityChoseKun::OnMessageEvent");
            if (args.data == null)
            {
                UnityChoseKun.LogError("args.data == null");
            }
            else
            {
                MemoryStream memory       = new MemoryStream(args.data);
                BinaryReader binaryReader = new BinaryReader(memory);

                try
                {
                    var messageID = (UnityChoseKun.MessageID)binaryReader.ReadInt32();
                    //UnityChoseKun.Log("message.id " + messageID);
                    var func = onMessageFuncDict[messageID];
                    func(binaryReader);
                }

                finally
                {
                    binaryReader.Close();
                    memory.Close();
                }
            }
        }
Example #2
0
        /// <summary>
        /// ComponentKunTypeからComponentKunのSystem.Typeを取得する
        /// </summary>
        /// <params name="componentKunType">チェックするComponentKunType</params>
        /// <returns>ComponentKunのSystem.Type</returns>
        public static System.Type GetComponetKunSyetemType(ComponentKunType componentKunType)
        {
            if (!componentPairDict.ContainsKey(componentKunType))
            {
                UnityChoseKun.LogError("NotContainKey");
            }

            return(componentPairDict[componentKunType].componenKunType);
        }