if文などで分岐して処理を変更する部分をクラスで分けることで、比較的にアルゴリズムの追加が簡単になり、メンテナンスしやすい設計になる。
分岐する処理が少ないなら分けないほうがシンプル。
- 1 アルゴリズムをクラスに分割して、共通のインターフェイスを利用する。
| using System.Diagnostics; | |
| using UnityEditor; | |
| using UnityEngine; | |
| public class OpenVSCode | |
| { | |
| [MenuItem("Window/Open VS Code Git Repository")] | |
| static void OpenVSCodeGitRepository() | |
| { | |
| var repositoryPath = Execute("git", "rev-parse --show-toplevel"); |
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.IO; | |
| using UnityEngine; | |
| #if UNITY_EDITOR | |
| using UnityEditor; | |
| public class SearchGUID : EditorWindow |
| using System; | |
| using UnityEngine; | |
| using UnityEngine.Events; | |
| using UnityEngine.Timeline; | |
| using UnityEngine.UI; | |
| using DG.Tweening; | |
| class BaseTimeControl : MonoBehaviour, ITimeControl | |
| { | |
| Sequence sequence = default; |
| # -*- coding: utf-8 -*- | |
| from __future__ import annotations | |
| from typing import List | |
| from typing import Any | |
| import csv | |
| import json | |
| import os | |
| import pandas as pd | |
| """readme |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UniRx; | |
| // Model データクラス | |
| public class StatusModel | |
| { | |
| // リアクティブプロパティ Subscribe可能 | |
| public IntReactiveProperty RxHp = new IntReactiveProperty(); |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System; | |
| using YamlDotNet; | |
| using YamlDotNet.RepresentationModel; | |
| // 即席Yaml | |
| public class YamlInstant : IEnumerable<YamlInstant>, IDisposable | |
| { | |
| YamlNode obj; |
| {"lastUpload":"2017-08-03T09:58:50.979Z","extensionVersion":"v2.8.2"} |
# 特定の拡張子からワードを検索し、ファイル名を表示する
find . -name "*.html" | xargs grep -l "word"| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |