This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Text; | |
namespace Kogane | |
{ | |
/// <summary> | |
/// 配列の拡張メソッド | |
/// </summary> | |
public static class ArrayExtensionMethods | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
namespace Kogane | |
{ | |
/// <summary> | |
/// 配列の拡張メソッド | |
/// </summary> | |
public static class ArrayExtensionMethods | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
[ExecuteAlways] | |
public class Example : MonoBehaviour | |
{ | |
[SerializeField] private SpriteRenderer m_spriteRenderer; | |
[SerializeField] private LineRenderer[] m_lineRenderers; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ReSharper disable PossibleLossOfFraction | |
using JetBrains.Annotations; | |
using UnityEngine; | |
namespace Kogane | |
{ | |
/// <summary> | |
/// スプライトをグリッド上に分割して返すクラス | |
/// </summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Unity.Collections; | |
using UnityEngine; | |
[ExecuteAlways] | |
public class Example : MonoBehaviour | |
{ | |
[SerializeField] private LineRenderer m_lineRenderer; | |
[SerializeField] private PolygonCollider2D m_collider2D; | |
private void Update() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
def remove(folder_path): | |
# 指定したフォルダ内のファイルをリストアップ | |
files = os.listdir(folder_path) | |
# 正規表現パターン | |
pattern = re.compile(r'Hoge', re.IGNORECASE) # 大文字小文字を区別しないで検索 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
namespace Kogane | |
{ | |
public static class ComponentExtensionMethods | |
{ | |
public static GameObject FindByNameContains<T> | |
( | |
this T self, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Unity.Collections; | |
using UnityEngine; | |
public class Example : MonoBehaviour | |
{ | |
[SerializeField] private GameObject[] m_gameObjects; | |
private void Start() | |
{ | |
var instanceIDs = new NativeArray<int> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
public static class Vector2ExtensionMethods | |
{ | |
public static Vector2 FindNearest | |
( | |
this IReadOnlyCollection<Vector2> self, | |
in Vector2 target | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class Example : MonoBehaviour | |
{ | |
private Vector3 m_prevLocalPosition; | |
private enum DirectionType | |
{ | |
NONE, | |
UP, |