Skip to content

Instantly share code, notes, and snippets.

test
@enpel
enpel / SkipCurrentAnimation.cs
Created March 10, 2014 12:50
Unityで再生しているアニメーションをスキップする方法 ref: http://qiita.com/enpel/items/5b1b5e001371573098a4
void SkipCurrentAnimation()
{
// 現在再生中のアニメーションクリップ名を取得
// もっとよい方法があれば...
var clipName = "";
foreach(AnimationState state in this.animation) {
if (this.animation.IsPlaying(state.name)) {
clipName = state.name;
break;
}
@enpel
enpel / SampleHogePopupList
Created February 18, 2015 01:39
NGUIのUIPopupList のイベントで取得する時の文字列に入ってる改行とかをなくすためのStringの拡張
using UnityEngine;
using System.Collections;
public class SampleHogePopupList : MonoBehaviour
{
string keyword = "hogege";
public void PopupListOnChange () {
string key = UIPopupList.current.value.DeleteInvisibleCharacter();
@enpel
enpel / GameObjectExtensions
Last active August 29, 2015 14:15
GameObjectの拡張どっこいしょ
using UnityEngine;
using System.Collections;
public static class GameObjectExtensions
{
// GameObjectの子にいるGameObjectを名前で取得する
public static GameObject FindChild (this GameObject parent, string name)
{
Transform child =parent.transform.Find(name);
1,新規端末でゲームを開始
2,データを引き継ぐには登録が必要だよ!
3,もう登録したつもりでログイン
4,作ったばかりのアカウントが登録される
5,本垢登録してない
6,本垢を登録しようとログイン
7,新規データで上書きされる。
8,GG
問題:
@enpel
enpel / CSVDataHolder.cs
Last active August 29, 2015 14:16
CSVとかマスターなデータとか読み込む用。
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class CSVDataHolder<T> where T: ICSVData, new()
{
Dictionary<string, List<T>> masterData = new Dictionary<string, List<T>>();
public void Load(string filePath)
{
@enpel
enpel / UIPanelDepthEditor.cs
Created April 3, 2015 02:22
NGUIのUIPanel以下のDepthをまとめて操作
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class UIPanelDepthEditor: EditorWindow {
[MenuItem("Window/UIPanelDepthEditor")]
@enpel
enpel / UIButtonLongTapComponent
Created April 3, 2015 11:50
NGUI UIButton をロングタップ対応
using UnityEngine;
using System.Collections;
using System;
[RequireComponent(typeof(UIButton))]
public class UIButtonLongTapComponent : MonoBehaviour
{
[SerializeField]
@enpel
enpel / file0.cs
Last active August 29, 2015 14:21
ボタンのロングタップ対応UniRx版 v0.3 [パフォーマンスに難有り] ref: http://qiita.com/enpel/items/1897a9d02d42c6089e80
using UnityEngine;
using System.Collections;
using System;
using UniRx;
using System.Collections.Generic;
[RequireComponent(typeof(UIButton))]
public class UIButtonLongTapComponent : ObservableMonoBehaviour
{
@enpel
enpel / file0.cs
Last active August 29, 2015 14:21
親の親の親の...親からGetComponentしたい!!そんな拡張 ref: http://qiita.com/enpel/items/7d9eb414a92f15ea694a
using UnityEngine;
using System.Collections;
public static class GameObjectExtensions
{
public static T GetComponentInParents<T>(this Transform obj) where T : MonoBehaviour, new()
{
Transform parent = obj.transform.parent;