Skip to content

Instantly share code, notes, and snippets.

@yuw-unknown
yuw-unknown / BehaviourUtility.cs
Last active Aug 14, 2017
Behaviourの共通機能 主にPosition周り
View BehaviourUtility.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/**
* Behaviourの共通機能
* FIXME: 毎回BehaviourUtilityを記載するのも冗長なので何か手を打ちたい
* - BUにリネーム?
* - 他もっと便利にアクセス出来る方法があれば
*/
@yuw-unknown
yuw-unknown / BaseMonoBehaviour.cs
Created Aug 14, 2017
MonoBehaviourの親クラスSample
View BaseMonoBehaviour.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BaseMonoBehaviour : MonoBehaviour {
// -----------------------------------------
// Instance
// -----------------------------------------
//初期化したかどうかのフラグ(一度しか初期化が走らないようにするため)
@yuw-unknown
yuw-unknown / ArborCatStateStageIn.cs
Created Aug 14, 2017
Arbor2の他のオブジェクトの状態を監視するSample
View ArborCatStateStageIn.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Arbor
{
/**
* 猫が茂みに居るStatusになった際に、次のStateを呼び出します
*/
[AddComponentMenu("")]
@yuw-unknown
yuw-unknown / ArborButtonInteractable.cs
Created Aug 14, 2017
Arborを用いたボタンの活性/非活性
View ArborButtonInteractable.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Arbor {
/**
* ボタンを活性/非活性にします
*/
@yuw-unknown
yuw-unknown / ArborOpenDoorTransition.cs
Created Aug 15, 2017
Arbor2Sample 条件を見て、State先を切り替える
View ArborOpenDoorTransition.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Arbor {
/**
* 戸棚があいていればTransitionします
*/
[AddComponentMenu("")]
@yuw-unknown
yuw-unknown / ArborChangeSpriteColor.cs
Created Aug 16, 2017
Arbor2でSpriteRendererの色を変更します
View ArborChangeSpriteColor.cs
using UnityEngine;
using System.Collections;
using Arbor;
/**
* Spriteの色を変更します
*/
// MenuのComponentにメニューを追加する
[AddComponentMenu("Arbor/Sprite色変更")]
@yuw-unknown
yuw-unknown / ArborTransitionOnClick.cs
Created Aug 21, 2017
Arbor2とUniRxとを組み合わせ指定回数クリックされたら次のStateに遷移する。
View ArborTransitionOnClick.cs
using UnityEngine;
using System.Collections;
using System.Linq;
using Arbor;
using UniRx;
using UniRx.Triggers;
/**
* 指定回数Mouseクリック / Tapがされると次のStateへ遷移するScriptです。
@yuw-unknown
yuw-unknown / TwitterKitForUnitySample.cs
Last active Aug 26, 2017
Twitter Kit for UnityのSample
View TwitterKitForUnitySample.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TwitterKit.Unity;
public class TwitterKitForUnitySample : MonoBehaviour {
private string _AccessToken;
private string _Secret;
@yuw-unknown
yuw-unknown / FirebaseTwitterAuthenticationSample.cs
Last active Sep 2, 2017
Firebase AuthenticationのTwitter認証Sample.
View FirebaseTwitterAuthenticationSample.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
using TwitterKit.Unity;
using Firebase;
using Firebase.Database;
using Firebase.Unity.Editor;
public class PUFirebaseTwitterLogin : MonoBehaviour {
@yuw-unknown
yuw-unknown / Notification.cs
Created Dec 10, 2017
Notification-EventBus sample on Unity.
View Notification.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Notification {
static Notification _Instance;
public static Notification Instance {
get {
if (_Instance == null) {