Skip to content

Instantly share code, notes, and snippets.

@kazukitanaka0611
kazukitanaka0611 / Create sphere in Grid change size
Created February 19, 2022 22:23
Shpereの大きさを変えながら縦横にならべるコード
using System.Collections.Generic;
using UnityEngine;
public class Generate : MonoBehaviour
{
[SerializeField]
private GameObject _spherePrefab = default;
[SerializeField]
private int _unitKazu = 16;
@kazukitanaka0611
kazukitanaka0611 / KochLine
Created December 3, 2021 01:07
3角形から8角形までのフラクタルをLineRenderで描くコード(AnimationCurveのtime,valueを利用)
using UnityEngine;
[RequireComponent(typeof(LineRenderer))]
public class KochLine : MonoBehaviour
{
[SerializeField]
[Range(0, 5)]
private int _index = 0;
[SerializeField]
private AnimationCurve _curve = null;
@kazukitanaka0611
kazukitanaka0611 / CreateLine
Created December 2, 2021 01:34
3角形から8角形までを生成する最低限のコード
[RequireComponent(typeof(LineRenderer))]
public class Test : MonoBehaviour
{
[SerializeField]
[Range(0, 5)]
private int _index = 0;
private static readonly int[] PointsNumbers = { 3, 4, 5, 6, 7, 8 };
private LineRenderer _lineRenderer = null;
@kazukitanaka0611
kazukitanaka0611 / VContainer SceneLoader
Created December 24, 2020 00:59
This is SceneLoader with Param by VContainer and UniTask
using System.Threading;
using Cysharp.Threading.Tasks;
using UnityEngine.SceneManagement;
using VContainer.Unity;
public class SceneLoader
{
public static async UniTask LoadSceneAsync<T, U>(string secneName, U param, LoadSceneMode mode = LoadSceneMode.Single)
where T : LifetimeScope
{
@kazukitanaka0611
kazukitanaka0611 / OpenCvSharp HoughCircles
Created June 28, 2020 09:34
リアルタイムで円を検出
using OpenCvSharp;
using OpenCvSharp.Demo;
using UnityEngine;
public class RealTimeFilter : WebCamera
{
private Mat dstMat = new Mat ();
protected override void Awake ()
{
@kazukitanaka0611
kazukitanaka0611 / OpenCV For Unit GaussianBlur
Created July 15, 2019 04:55
OpenCV For Unit GaussianBlurの最小コード
using OpenCVForUnity.CoreModule;
using OpenCVForUnity.ImgprocModule;
using OpenCVForUnity.UnityUtils;
using OpenCVForUnity.UnityUtils.Helper;
using OpenCVForUnityExample;
using UnityEngine;
[RequireComponent(typeof(WebCamTextureToMatHelper), typeof(FpsMonitor))]
public class MyFilterSample : MonoBehaviour
{
@kazukitanaka0611
kazukitanaka0611 / OpenCV For Unity Filter
Last active July 14, 2019 06:55
OpenCV For Unityno
using OpenCVForUnity.CoreModule;
using OpenCVForUnity.ImgprocModule;
using OpenCVForUnity.UnityUtils;
using OpenCVForUnity.UnityUtils.Helper;
using OpenCVForUnityExample;
using UnityEngine;
[RequireComponent(typeof(WebCamTextureToMatHelper), typeof(FpsMonitor))]
public class MyFilterSample : MonoBehaviour
{
#if !(PLATFORM_LUMIN && !UNITY_EDITOR)
using OpenCVForUnity.CoreModule;
using OpenCVForUnity.ImgprocModule;
using OpenCVForUnity.UnityUtils;
using OpenCVForUnity.UnityUtils.Helper;
using OpenCVForUnityExample;
using UnityEngine;
[RequireComponent(typeof(WebCamTextureToMatHelper), typeof(FpsMonitor))]
@kazukitanaka0611
kazukitanaka0611 / OpenCV For Unity thresholdMat
Last active July 14, 2019 02:31
OpenCV For Unity 二値化の最小コード
using OpenCVForUnity.CoreModule;
using OpenCVForUnity.ImgprocModule;
using OpenCVForUnity.UnityUtils;
using OpenCVForUnity.UnityUtils.Helper;
using OpenCVForUnityExample;
using UnityEngine;
[RequireComponent(typeof(WebCamTextureToMatHelper), typeof(FpsMonitor))]
public class MyFilterSample : MonoBehaviour
{
@kazukitanaka0611
kazukitanaka0611 / OpenCV For Unity gray
Last active July 14, 2019 02:27
OpenCV For Unityグレースケール変換最小のコード
using OpenCVForUnity.CoreModule;
using OpenCVForUnity.ImgprocModule;
using OpenCVForUnity.UnityUtils;
using OpenCVForUnity.UnityUtils.Helper;
using OpenCVForUnityExample;
using UnityEngine;
[RequireComponent(typeof(WebCamTextureToMatHelper), typeof(FpsMonitor))]
public class MyFilterSample : MonoBehaviour
{