Skip to content

Instantly share code, notes, and snippets.

View seibe's full-sized avatar

Seibe TAKAHASHI seibe

  • Kanagawa, Japan
View GitHub Profile
@seibe
seibe / Boot.cs
Last active January 19, 2020 07:08
GameCanvasでマルチシーンのサンプルコード
using GameCanvas;
/// <summary>
/// ブート画面
/// </summary>
public sealed class Boot : IScene
{
private float mEnterTime;
public Boot()
@seibe
seibe / Debug.cs
Created December 9, 2018 12:48
ログごとにスタックトレースの有無を切り替えられる Debug.cs
public static class Debug
{
public static void LogError(object message, UnityEngine.StackTraceLogType stackTraceType = UnityEngine.StackTraceLogType.ScriptOnly)
{
LogInternal(UnityEngine.LogType.Error, message, stackTraceType);
}
public static void LogWarning(object message, UnityEngine.StackTraceLogType stackTraceType = UnityEngine.StackTraceLogType.ScriptOnly)
{
LogInternal(UnityEngine.LogType.Warning, message, stackTraceType);
@seibe
seibe / Main-new.cs
Created April 7, 2018 06:01
GameCanvas のコルーチン対応
using Sequence = System.Collections.IEnumerator;
/// <summary>
/// ゲームクラス。
/// 学生が編集すべきソースコードです。
/// </summary>
public sealed class Game : GameBase
{
/// <summary>
@seibe
seibe / EditorTextureUtil.cs
Created August 7, 2017 08:26
UnityEditor.TextureUtil アクセサ
using System.Reflection;
using UnityEngine;
using UnityEngine.Assertions;
/// <summary>
/// <see cref="UnityEditor.TextureUtil"/> Accessor
/// </summary>
/// <author>Seibe TAKAHASHI</author>
/// <remarks>
/// <summary>TypeCheckerTest</summary>
/// <author>Seibe TAKAHASHI</author>
/// <remarks>
/// (c) 2017 Seibe TAKAHASHI.
/// This software is released under the MIT License.
/// http://opensource.org/licenses/mit-license.php
/// </remarks>
public class TypeCheckerTest
{
[UnityEditor.MenuItem("TypeChecker/SpriteRenderer")]
@seibe
seibe / Main.cs
Last active August 29, 2015 14:20
「uGUI/Texture2Dで描画するリアルタイム流体計算」 最終的なソースコード (http://tasogare-games.hatenablog.jp/entry/20150428/1430203599)
using UnityEngine;
using UnityEngine.UI;
public class Main : MonoBehaviour
{
public RawImage raw;
public int N = 64;
public float diff = 0.0f;
public float visc = 0.0f;
public float force = 5.0f;
@seibe
seibe / FluidMath.cs
Created April 27, 2015 06:44
Stable Fluid for C# ()
/**
* Jos Stam's Stable Fluids (for C#)
**/
public static class FluidMath
{
public static void VelStep(int N, ref float[] u, ref float[] v, ref float[] u0, ref float[] v0, float visc, float dt)
{
AddSource(N, ref u, ref u0, dt);
AddSource(N, ref v, ref v0, dt);
@seibe
seibe / Main.cs
Created April 21, 2015 15:22
「ゲームオブジェクトひとつだけで作るアナログ時計」 (http://tasogare-games.hatenablog.jp/entry/20150422/1429632127)
using UnityEngine;
using System;
using System.Collections;
public class Main : MonoBehaviour
{
private Transform hours, minutes, seconds;
private const float
hoursToDeg = -360f / 12f,
minutesToDeg = -360f / 60f,