/** ブレンド率。取得。
  */
 public float GetBlendWeight(string a_state_name)
 {
                 #if (USE_DEF_FEE_SIMPLEANIMATION)
     {
         SimpleAnimation.State t_state = this.raw.GetState(a_state_name);
         return(t_state.weight);
     }
                 #else
     {
         Tool.Assert(false);
         return(0.0f);
     }
                 #endif
 }
 /** 再生中かどうか。取得。
  */
 public bool IsPlay(string a_state_name)
 {
                 #if (USE_DEF_FEE_SIMPLEANIMATION)
     {
         SimpleAnimation.State t_state = this.raw.GetState(a_state_name);
         return(t_state.enabled);
     }
                 #else
     {
         Tool.Assert(false);
         return(false);
     }
                 #endif
 }
 /** モーション。追加。
  */
 public void AddMotion(string a_state_name, UnityEngine.AnimationClip a_animetion_clip)
 {
     if (a_animetion_clip != null)
     {
                         #if (USE_DEF_FEE_SIMPLEANIMATION)
         this.raw.AddClip(a_animetion_clip, a_state_name);
                         #else
         Tool.Assert(false);
                         #endif
     }
     else
     {
         Tool.Assert(false);
     }
 }
Ejemplo n.º 4
0
        /** マスター。接続リクエスト。
         */
        public void RequestConnectMaster()
        {
            if (this.step == Step.None)
            {
                //接続。
                this.step = Step.ConnectMaster;

                this.status_master.mode = Status_Master.Mode.Request;
            }
            else
            {
                //処理中。
                Tool.Assert(false);
            }
        }
Ejemplo n.º 5
0
        /** ロビー。接続リクエスト。
         */
        public void RequestConnectLobby()
        {
            if (this.step == Step.None)
            {
                //接続。
                this.step = Step.ConnectLobby;

                this.status_lobby.mode = Pun_Status_Lobby.Mode.Request;
            }
            else
            {
                //処理中。
                Tool.Assert(false);
            }
        }
Ejemplo n.º 6
0
        /** [シングルトン]constructor
         */
        private PerformanceCounter()
        {
            //マテリアル。
            UnityEngine.Shader t_shader = UnityEngine.Shader.Find(Config.SHADER_NAME_PERFORMANCECOUNTER);
            if (t_shader != null)
            {
                this.material = new UnityEngine.Material(t_shader);
            }
            else
            {
                Tool.Assert(false);
            }

            //フレームデータ。
            this.framedata = new FrameData();

            //フレーム終了待ち。
            this.wait_for_endframe = new UnityEngine.WaitForEndOfFrame();

            //delete_request
            this.delete_request = false;

            //カメラ。
            {
                //最初。
                this.camera_first_gameobject = new UnityEngine.GameObject("camera_first");
                UnityEngine.GameObject.DontDestroyOnLoad(this.camera_first_gameobject);
                UnityEngine.Camera         t_camera_first_camera        = this.camera_first_gameobject.AddComponent <UnityEngine.Camera>();
                Camera_First_MonoBehaviour t_camera_first_monobehaviour = this.camera_first_gameobject.AddComponent <Camera_First_MonoBehaviour>();
                t_camera_first_camera.Reset();
                t_camera_first_camera.cullingMask = 0;
                t_camera_first_camera.clearFlags  = UnityEngine.CameraClearFlags.Nothing;
                t_camera_first_camera.depth       = Config.CAMERADEPTH_FIRST;

                //最後。
                this.camera_last_gameobject = new UnityEngine.GameObject("camera_last");
                UnityEngine.GameObject.DontDestroyOnLoad(this.camera_last_gameobject);
                UnityEngine.Camera t_camera_last_camera = this.camera_last_gameobject.AddComponent <UnityEngine.Camera>();
                this.camera_last_gameobject.AddComponent <Camera_Last_MonoBehaviour>();
                t_camera_last_camera.Reset();
                t_camera_last_camera.cullingMask = 0;
                t_camera_last_camera.clearFlags  = UnityEngine.CameraClearFlags.Nothing;
                t_camera_last_camera.depth       = Config.CAMERADEPTH_LAST;

                //StartCoroutine
                t_camera_first_monobehaviour.StartCoroutine(this.Unity_Start());
            }
        }
Ejemplo n.º 7
0
        /** CalcMD5
         */
        public static string CalcMD5(byte[] a_binary)
        {
            string t_hash_string = null;

            try{
                using (System.Security.Cryptography.MD5CryptoServiceProvider t_md5 = new System.Security.Cryptography.MD5CryptoServiceProvider()){
                    byte[] t_hash = t_md5.ComputeHash(a_binary);
                    t_hash_string = MD5.CreateHashString(t_hash);
                    Tool.Assert(t_hash_string != null);
                }
            }catch (System.Exception t_exception) {
                Tool.DebugReThrow(t_exception);
            }

            return(t_hash_string);
        }
Ejemplo n.º 8
0
        /** リクエスト。セーブ。バイナリファイル。
         */
        public Item RequestSaveBinaryFile(SaveRequestType a_request_type, Path a_relative_path, byte[] a_binary)
        {
            switch (a_request_type)
            {
            case SaveRequestType.SaveLocalBinaryFile:
            {
                WorkItem t_work_item = new WorkItem();
                t_work_item.RequestSaveLocalBinaryFile(a_relative_path, a_binary);
                this.add_list.Add(t_work_item);
                return(t_work_item.GetItem());
            } break;
            }

            Tool.Assert(false);
            return(null);
        }
Ejemplo n.º 9
0
        /** リクエスト。セーブ。テクスチャファイル。
         */
        public Item RequestSaveTextureFile(SaveRequestType a_request_type, Path a_relative_path, UnityEngine.Texture2D a_texture)
        {
            switch (a_request_type)
            {
            case SaveRequestType.SaveLocalTextureFile:
            {
                WorkItem t_work_item = new WorkItem();
                t_work_item.RequestSaveLocalTextureFile(a_relative_path, a_texture);
                this.add_list.Add(t_work_item);
                return(t_work_item.GetItem());
            } break;
            }

            Tool.Assert(false);
            return(null);
        }
Ejemplo n.º 10
0
 /** マスター。切断リクエスト。
  */
 public void RequestDisconnectMaster()
 {
     if (this.step == Step.None)
     {
         //切断。
         this.step = Step.DisconnectMaster;
         {
             this.status_master.mode = Status_Master.Mode.Request;
         }
     }
     else
     {
         //処理中。
         Tool.Assert(false);
     }
 }
Ejemplo n.º 11
0
 /** ロビー。切断リクエスト。
  */
 public void RequestDisconnectRoom()
 {
     if (this.step == Step.None)
     {
         //切断。
         this.step = Step.DisconnectRoom;
         {
             this.status_room.mode = Pun_Status_Room.Mode.Request;
         }
     }
     else
     {
         //処理中。
         Tool.Assert(false);
     }
 }
        /** 数値。取得。
         */
        public static bool GetTryCellNumeric(System.Object a_cell, out double a_result_value)
        {
            try{
                if (a_cell != null)
                {
                    System.Type t_type = a_cell.GetType();
                    if (t_type.IsValueType == true)
                    {
                        //数値へのキャスト。
                        a_result_value = (double)a_cell;
                        return(true);
                    }
                    else if (t_type == typeof(string))
                    {
                        string t_value_string = a_cell as string;
                        if (t_value_string != null)
                        {
                            if (double.TryParse(t_value_string, out double t_value_double) == true)
                            {
                                //数値へのパース。
                                a_result_value = t_value_double;
                                return(true);
                            }
                        }
                    }
                    else if (t_type == typeof(System.DBNull))
                    {
                        //データのないセル。
                    }
                    else
                    {
                        //不明。
                        Tool.Assert(false);
                    }
                }
                else
                {
                    //データのないセル。
                }
            }catch (System.Exception t_exception) {
                Tool.DebugReThrow(t_exception);
            }

            //失敗。
            a_result_value = 0.0;
            return(false);
        }
Ejemplo n.º 13
0
        /** CreateUiInputField
         */
        public static UnityEngine.GameObject CreateUiInputField(string a_name, UnityEngine.Transform a_parent_transform)
        {
            UnityEngine.UI.DefaultControls.Resources t_resources = new UnityEngine.UI.DefaultControls.Resources();
            {
                //テクスチャー読み込み。
                {
                    if (s_inputfield_sprite == null)
                    {
                        UnityEngine.Texture2D t_texture = UnityEngine.Resources.Load <UnityEngine.Texture2D>(Config.TEXTURE_NAME_INPUTFIELD);
                        UnityEngine.Rect      t_rect    = new UnityEngine.Rect(0.0f, 0.0f, t_texture.width, t_texture.height);
                        UnityEngine.Vector2   t_pivot   = new UnityEngine.Vector2(t_texture.width / 2, t_texture.height / 2);
                        float t_pixels_per_unit         = 100.0f;
                        uint  t_extrude = 1;
                        UnityEngine.SpriteMeshType t_mesh_type = UnityEngine.SpriteMeshType.FullRect;
                        UnityEngine.Vector4        t_border    = new UnityEngine.Vector4(4.0f, 4.0f, 4.0f, 4.0f);
                        bool t_generate_fallback_physicsshape  = true;

                        s_inputfield_sprite = UnityEngine.Sprite.Create(t_texture, t_rect, t_pivot, t_pixels_per_unit, t_extrude, t_mesh_type, t_border, t_generate_fallback_physicsshape);
                    }
                }

                t_resources.inputField = s_inputfield_sprite;
            }

            UnityEngine.GameObject t_gameobject = UnityEngine.UI.DefaultControls.CreateInputField(t_resources);
            if (t_gameobject != null)
            {
                //name
                t_gameobject.name = a_name;

                //parent
                t_gameobject.GetComponent <UnityEngine.Transform>().SetParent(a_parent_transform);

                //image
                UnityEngine.UI.Image t_image = t_gameobject.GetComponent <UnityEngine.UI.Image>();
                {
                    t_image.type = UnityEngine.UI.Image.Type.Sliced;
                }
            }
            else
            {
                Tool.Assert(false);
            }

            return(t_gameobject);
        }
Ejemplo n.º 14
0
        /** Alloc
         */
        public System.Collections.Generic.LinkedListNode <NODE> Alloc()
        {
            {
                System.Collections.Generic.LinkedListNode <NODE> t_node = this.list.Last;
                if (t_node != null)
                {
                    this.list.Remove(t_node);
                    return(t_node);
                }
            }

            {
                Tool.Assert(false);
                NODE t_raw = new NODE();
                return(new System.Collections.Generic.LinkedListNode <NODE>(t_raw));
            }
        }
Ejemplo n.º 15
0
 /** ロビー。接続リクエスト。
  */
 public void RequestConnectRoom(string a_room_key, string a_room_info)
 {
     if (this.step == Step.None)
     {
         //接続。
         this.step = Step.ConnectRoom;
         {
             this.status_room.mode      = Pun_Status_Room.Mode.Request;
             this.status_room.room_key  = a_room_key;
             this.status_room.room_info = a_room_info;
         }
     }
     else
     {
         //処理中。
         Tool.Assert(false);
     }
 }
Ejemplo n.º 16
0
 /** モーション。再生。
  */
 public void PlayMotion(string a_state_name, float a_cross_time, bool a_cross)
 {
                 #if (USE_DEF_FEE_SIMPLEANIMATION)
     if (a_cross == true)
     {
         this.raw.CrossFade(a_state_name, a_cross_time);
     }
     else
     {
         this.raw.Stop();
         this.raw.Play(a_state_name);
     }
                 #else
     {
         Tool.Assert(false);
     }
                 #endif
 }
Ejemplo n.º 17
0
        /** 作成。
         *
         *      指定したものを追加する。
         *
         */
        public static UnityEngine.GameObject Create(Fee.File.Path a_output_assets_path, ResourceItem[] a_resource_list)
        {
            UnityEngine.GameObject t_prefab = new UnityEngine.GameObject();
            t_prefab.name = "prefab_temp";
            {
                //追加。
                Add(t_prefab, a_resource_list);

                //新規作成。
                Fee.EditorTool.Utility.SavePrefab(t_prefab, a_output_assets_path);
            }
            UnityEngine.GameObject.DestroyImmediate(t_prefab);

            //ロード。
            UnityEngine.GameObject t_gameobject = Fee.EditorTool.Utility.LoadAsset <UnityEngine.GameObject>(a_output_assets_path);
            Tool.Assert(t_gameobject != null);
            return(t_gameobject);
        }
Ejemplo n.º 18
0
        /** ミラー。作成。
         */
        public MirrorObject_MonoBehaviour CreateMirror(Fee.Mirror.RenderTextureSizeType a_size_type, UnityEngine.GameObject a_mirror_object, UnityEngine.Camera a_look_camera, string a_name)
        {
            if (a_mirror_object != null)
            {
                MirrorCamera_MonoBehaviour t_mirror_camera = MirrorCamera_MonoBehaviour.Create(a_size_type, a_name);

                //ミラーマテリアル。設定。
                UnityEngine.Renderer t_renderer = a_mirror_object.GetComponent <UnityEngine.Renderer>();
                if (t_renderer != null)
                {
                    UnityEngine.Shader t_shader = UnityEngine.Shader.Find(Config.SHADER_NAME_MIRROR);
                    if (t_shader != null)
                    {
                        t_renderer.material = new UnityEngine.Material(t_shader);
                        t_renderer.material.SetTexture("texture_mirror", t_mirror_camera.GetRenderTexture());
                    }
                    else
                    {
                        Tool.Assert(false);
                    }
                }
                else
                {
                    Tool.Assert(false);
                }

                //ミラーオブジェクト。設定。
                MirrorObject_MonoBehaviour t_mirror_object = a_mirror_object.AddComponent <MirrorObject_MonoBehaviour>();
                {
                    t_mirror_object.mirror_camera  = t_mirror_camera;
                    t_mirror_object.look_camera    = a_look_camera;
                    t_mirror_object.look_transform = a_look_camera.GetComponent <UnityEngine.Transform>();
                    t_mirror_object.enabled        = false;
                }

                return(t_mirror_object);
            }
            else
            {
                Tool.Assert(false);
            }

            return(null);
        }
        /** Convert
         */
        public static JsonItem Convert(System.Object a_from_object, System.Type a_from_type, ConvertToJsonItemOption a_from_option, ObjectToJsonItem_WorkPool a_workpool, int a_nest)
        {
            try{
                //[]

                System.Array t_array_raw = (System.Array)a_from_object;

                JsonItem t_to_jsonitem = new JsonItem(new Value_IndexArray());

                //サイズ確保。
                t_to_jsonitem.ReSize(t_array_raw.Length);

                //値型。
                System.Type t_list_value_type = Fee.ReflectionTool.Utility.GetListValueType(a_from_type);

                if (t_list_value_type == typeof(System.Object))
                {
                    for (int ii = 0; ii < t_array_raw.Length; ii++)
                    {
                        //ワークに追加。
                        System.Object t_listitem_object = t_array_raw.GetValue(ii);
                        a_workpool.Add(ObjectToJsonItem_WorkPool.ModeSetIndexArray.Start, t_to_jsonitem, ii, t_listitem_object, t_listitem_object.GetType(), a_from_option, a_nest + 1);
                    }
                }
                else
                {
                    for (int ii = 0; ii < t_array_raw.Length; ii++)
                    {
                        //ワークに追加。
                        System.Object t_listitem_object = t_array_raw.GetValue(ii);
                        a_workpool.Add(ObjectToJsonItem_WorkPool.ModeSetIndexArray.Start, t_to_jsonitem, ii, t_listitem_object, t_list_value_type, a_from_option, a_nest + 1);
                    }
                }

                //成功。
                return(t_to_jsonitem);
            }catch (System.Exception t_exception) {
                Tool.DebugReThrow(t_exception);
            }

            //失敗。
            Tool.Assert(false);
            return(null);
        }
        /** Convert
         */
        public static void Convert(System.Int64 a_in_value, System.Text.StringBuilder a_out_stringbuilder, ConvertToJsonStringOption a_option)
        {
            try{
                string t_string = a_in_value.ToString(Config.CULTURE);
                a_out_stringbuilder.Append(t_string);

                if ((a_option & ConvertToJsonStringOption.NoSignedNumberSuffix) == 0)
                {
                    a_out_stringbuilder.Append("l");
                }
                return;
            }catch (System.Exception t_exception) {
                Tool.DebugReThrow(t_exception);
            }

            //不明。
            Tool.Assert(false);
            return;
        }
Ejemplo n.º 21
0
        /** リクエスト。セーブ。テクスチャファイル。
         */
        public Item RequestSaveTextureFile(SaveRequestType a_request_type, Path a_relative_path, UnityEngine.Texture2D a_texture)
        {
            switch (a_request_type)
            {
            case SaveRequestType.SaveLocalTextureFile:
            {
                System.Collections.Generic.LinkedListNode <WorkItem> t_work_node = this.work_pool.Alloc();
                t_work_node.Value.Reset();

                t_work_node.Value.RequestSaveLocalTextureFile(a_relative_path, a_texture);
                this.work_add.AddLast(t_work_node);

                return(t_work_node.Value.GetItem());
            } break;
            }

            Tool.Assert(false);
            return(null);
        }
        /** シート。取得。
         */
        public static System.Data.DataTable GetSheet(System.Data.DataSet a_workbook, int a_index)
        {
            System.Data.DataTable t_sheet = null;

            if (a_workbook != null)
            {
                try{
                    t_sheet = a_workbook.Tables[a_index];
                }catch (System.Exception t_exception) {
                    Tool.DebugReThrow(t_exception);
                }
            }
            else
            {
                Tool.Assert(false);
            }

            return(t_sheet);
        }
        /** シート数。取得。
         */
        public static int GetSheetCount(System.Data.DataSet a_workbook)
        {
            int t_count = 0;

            if (a_workbook != null)
            {
                try{
                    t_count = a_workbook.Tables.Count;
                }catch (System.Exception t_exception) {
                    Tool.DebugReThrow(t_exception);
                }
            }
            else
            {
                Tool.Assert(false);
            }

            return(t_count);
        }
        /** Create
         */
        public static void Convert(System.Double a_value, System.Text.StringBuilder a_out_stringbuilder, ConvertToJsonStringOption a_option)
        {
            try{
                string t_string = string.Format(Config.CULTURE, Config.FLOATING_TO_STRING_FORMAT, a_value);
                a_out_stringbuilder.Append(t_string);

                if ((a_option & ConvertToJsonStringOption.NoFloatingNumberSuffix) == 0)
                {
                    a_out_stringbuilder.Append("f");
                }
                return;
            }catch (System.Exception t_exception) {
                Tool.DebugReThrow(t_exception);
            }

            //不明。
            Tool.Assert(false);
            return;
        }
Ejemplo n.º 25
0
        /** RequestLoadUrl
         */
        public Item RequestLoadUrl(LoadRequestType a_request_type, Path a_path, System.Collections.Generic.List <UnityEngine.Networking.IMultipartFormSection> a_post_data = null, Fee.File.CustomCertificateHandler a_certificate_handler = null)
        {
            switch (a_request_type)
            {
            //ロードURL。

            case LoadRequestType.LoadUrlBinaryFile:
            {
                System.Collections.Generic.LinkedListNode <WorkItem> t_work_node = this.work_pool.Alloc();
                t_work_node.Value.Reset();

                t_work_node.Value.RequestLoadUrlBinaryFile(a_path, a_post_data, a_certificate_handler);
                this.work_add.AddLast(t_work_node);

                return(t_work_node.Value.GetItem());
            } break;

            case LoadRequestType.LoadUrlTextFile:
            {
                System.Collections.Generic.LinkedListNode <WorkItem> t_work_node = this.work_pool.Alloc();
                t_work_node.Value.Reset();

                t_work_node.Value.RequestLoadUrlTextFile(a_path, a_post_data, a_certificate_handler);
                this.work_add.AddLast(t_work_node);

                return(t_work_node.Value.GetItem());
            } break;

            case LoadRequestType.LoadUrlTextureFile:
            {
                System.Collections.Generic.LinkedListNode <WorkItem> t_work_node = this.work_pool.Alloc();
                t_work_node.Value.Reset();

                t_work_node.Value.RequestLoadUrlTextureFile(a_path, a_post_data, a_certificate_handler);
                this.work_add.AddLast(t_work_node);

                return(t_work_node.Value.GetItem());
            } break;
            }

            Tool.Assert(false);
            return(null);
        }
Ejemplo n.º 26
0
        /** 作成。
         *
         *      全部追加する。
         *
         */
        public static UnityEngine.GameObject Create(Fee.File.Path a_output_assets_path, ResourceItem_Directory[] a_resource_list)
        {
            UnityEngine.GameObject t_prefab = new UnityEngine.GameObject();
            t_prefab.name = "prefab_temp";
            try{
                //追加。
                Add(t_prefab, a_resource_list);

                //新規作成。
                Fee.EditorTool.Utility.SavePrefab(t_prefab, a_output_assets_path);
            }catch (System.Exception t_exception) {
                UnityEngine.Debug.LogError(t_exception.Message);
            }
            UnityEngine.GameObject.DestroyImmediate(t_prefab);

            //ロード。
            UnityEngine.GameObject t_gameobject = Fee.EditorTool.Utility.LoadAsset <UnityEngine.GameObject>(a_output_assets_path);
            Tool.Assert(t_gameobject != null);
            return(t_gameobject);
        }
Ejemplo n.º 27
0
        internal ToolExitCodes Run()
        {
            if (!_options.NoLogo)
            {
                ToolConsole.WriteHeader();
            }

            if (_options.GetToolMode() == ToolMode.DisplayHelp)
            {
                ToolConsole.WriteHelpText();
                return(ToolExitCodes.Success);
            }
            else
            {
                InputModule inputModule = InputModule.LoadInputs(_options);

                Tool.Assert(_options.GetToolMode().HasValue, System.SR.Format(System.SR.AmbiguousToolUseage));
                return(ExecuteToolMode(inputModule));
            }
        }
        /** Convert
         */
        public static void Convert(bool a_in_value, System.Text.StringBuilder a_out_stringbuilder, ConvertToJsonStringOption a_option)
        {
            try{
                if (a_in_value == true)
                {
                    a_out_stringbuilder.Append("true");
                }
                else
                {
                    a_out_stringbuilder.Append("false");
                }
                return;
            }catch (System.Exception t_exception) {
                Tool.DebugReThrow(t_exception);
            }

            //不明。
            Tool.Assert(false);
            return;
        }
Ejemplo n.º 29
0
        /** パラメータタイプリスト。作成。
         */
        private System.Collections.Generic.List <ParamListItem> CreateParamTypeList(int a_param_type_y, int a_param_name_y, int a_start_x, int a_end_x)
        {
            System.Collections.Generic.List <ParamListItem> t_list = new System.Collections.Generic.List <ParamListItem>();

            for (int xx = a_start_x; xx < a_end_x; xx++)
            {
                string t_param_type = this.GetTryCellString(xx, a_param_type_y);
                string t_param_name = this.GetTryCellString(xx, a_param_name_y);

                switch (t_param_type)
                {
                case Config.PARAMTYPE_STRING:
                {
                    t_list.Add(new ParamListItem(ParamType.StringType, t_param_name, xx));
                } break;

                case Config.PARAMTYPE_INT:
                {
                    t_list.Add(new ParamListItem(ParamType.IntType, t_param_name, xx));
                } break;

                case Config.PARAMTYPE_FLOAT:
                {
                    t_list.Add(new ParamListItem(ParamType.FloatType, t_param_name, xx));
                } break;

                case Config.PARAMTYPE_COMMENT:
                {
                    //スキップ。
                } break;

                default:
                {
                    //不明なパラメータタイプ。
                    Tool.Assert(false);
                } break;
                }
            }

            return(t_list);
        }
Ejemplo n.º 30
0
 /** GetCharLength
  */
 private static int GetCharLength(string a_string, int a_index)
 {
     if (a_string[a_index] == '\\')
     {
         if ((a_index + 1) < a_string.Length)
         {
             return(2);
         }
         else
         {
             //「\\」の後ろがない。
             Tool.Assert(false);
             return(1);
         }
     }
     else
     {
         //通常文字。
         return(1);
     }
 }