Skip to content

Instantly share code, notes, and snippets.

View HassakuTb's full-sized avatar
💭
🍊

Hassaku HassakuTb

💭
🍊
View GitHub Profile
@HassakuTb
HassakuTb / BaseActivity.java
Created November 4, 2016 09:26
Checking if the Android application was in foreground.
package jp.tangerinebox.check_is_foreground;
import android.app.Activity;
public abstract class BaseActivity extends Activity{
@Override
protected void onStart(){
super.onStart();
@HassakuTb
HassakuTb / CanavsGroupEditor.cs
Created July 20, 2016 12:46
CanavsGroupにAlphaのスライダーを付加するInspector拡張
/**
NYSL Version 0.9982 (en) (Unofficial)
----------------------------------------
A. This software is "Everyone'sWare". It means:
Anybody who has this software can use it as if he/she is
the author.
A-1. Freeware. No fee is required.
A-2. You can freely redistribute this software.
A-3. You can freely modify this software. And the source
may be used in any software with no limitation.
@HassakuTb
HassakuTb / DirectionalBoxcaster.cs
Created July 18, 2016 23:34
Boxcast to axis aligned direction.
/**
NYSL Version 0.9982 (en) (Unofficial)
----------------------------------------
A. This software is "Everyone'sWare". It means:
Anybody who has this software can use it as if he/she is
the author.
A-1. Freeware. No fee is required.
A-2. You can freely redistribute this software.
A-3. You can freely modify this software. And the source
may be used in any software with no limitation.
@HassakuTb
HassakuTb / ControllerInputModule.cs
Created July 18, 2016 23:26
Standalone Input Module for ignoring mouse input.
/*
The MIT License(MIT)
Copyright(c) 2014-2015, Unity Technologies
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@HassakuTb
HassakuTb / Pausable.cs
Last active July 7, 2016 02:35
Pause all children object
/**
NYSL Version 0.9982 (en) (Unofficial)
----------------------------------------
A. This software is "Everyone'sWare". It means:
Anybody who has this software can use it as if he/she is
the author.
A-1. Freeware. No fee is required.
A-2. You can freely redistribute this software.
A-3. You can freely modify this software. And the source
may be used in any software with no limitation.
@HassakuTb
HassakuTb / Blinker.cs
Last active July 20, 2016 18:11
Blink children objects
/**
NYSL Version 0.9982 (en) (Unofficial)
----------------------------------------
A. This software is "Everyone'sWare". It means:
Anybody who has this software can use it as if he/she is
the author.
A-1. Freeware. No fee is required.
A-2. You can freely redistribute this software.
A-3. You can freely modify this software. And the source
may be used in any software with no limitation.
@HassakuTb
HassakuTb / SingletonScriptableObject.cs
Created June 29, 2016 03:27
SingletonなScriptableObject基底クラス
/**
NYSL Version 0.9982 (en) (Unofficial)
----------------------------------------
A. This software is "Everyone'sWare". It means:
Anybody who has this software can use it as if he/she is
the author.
A-1. Freeware. No fee is required.
A-2. You can freely redistribute this software.
A-3. You can freely modify this software. And the source
@HassakuTb
HassakuTb / JudgeGround.cs
Last active June 28, 2016 02:38
BoxCollider2Dを用いて接地判定を行うスクリプトです。
/**
JudgeGround.cs
Copyright (c) 2016 Hassaku
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
*/
using UnityEngine;
@HassakuTb
HassakuTb / Shuffle.cs
Last active October 12, 2020 01:27
Fisher-Yatesシャッフル
using System.Collections.Generic;
using System.Linq;
public static partial class IListExtensions {
/// <summary>
/// Fisher-Yatesシャッフル の実装
/// </summary>
public static IList<T> Shuffle<T>(this IList<T> list, RandomGenerator rgen) {
IList<T> target = list.ToList();
using System;
using UnityEngine;
public class EnumLabelSample : MonoBehaviour{
[EnumLabel(typeof(Fruit))]
public string[] names = new string[Enum.GetValues(typeof(Fruit)).Length];
private enum Fruit {
Orange,