This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Array { | |
mutating func removeObject<E: Equatable>(object: E) -> Array { | |
for var i = 0; i < self.count; i++ { | |
if self[i] as E == object { | |
self.removeAtIndex(i) | |
break | |
} | |
} | |
return self | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
using System; | |
using BarCallback = System.Action<Bar>; | |
public class Bar : MonoBehaviour { | |
/// <summary> | |
/// 値を表現するスライダー |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class SymbolReplacer : UnityEditor.AssetModificationProcessor { | |
public static void OnWillCreateAsset (string path) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************* | |
2015-05-31 TiledMapデータ | |
(.xmlの要素に従って配置) | |
*********************************/ | |
using System.Collections.Generic; | |
using System.Xml.Serialization; | |
using UniLinq; | |
[XmlRoot("map")] | |
public class TiledMap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************* | |
#CREATED# | |
*********************************/ | |
using UnityEngine; | |
namespace #NAMESPACE# | |
{ | |
public class #SCRIPTNAME# : MonoBehaviour | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 通知する情報そのもの | |
public class Notification | |
{ | |
// 通知のタイプ(どんどん拡張させていく) | |
public enum Keys { | |
GameOver, | |
StageClear | |
} | |
private Keys key; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace App.Data { | |
// データクラス基底 | |
abstract public class AbstractData | |
{ | |
public void Setup(Dictionary<string, object>data) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ListSearchBar: UISearchBar, UISearchBarDelegate, UITableViewDataSource, UITableViewDelegate { | |
var myDelegate: UISearchBarDelegate? = nil | |
lazy var tableView: UITableView = self.setupTableView() | |
private var items = [String]() | |
private var isShowList = false | |
private var listHeight: CGFloat = 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Hoge : MonoBehaviour { | |
void MoveA () | |
{ | |
Action callback = () => { | |
// 何か処理 | |
}; | |
iTween.MoveBy (gameObject, iTween.Hash("y",1f,"time",0.5f, "oncomplete", "Fin", "oncompleteparams", callback)); | |
} | |
void MoveB () | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
using UnityEngine.EventSystems; | |
public class ScrollController : MonoBehaviour, IInitializePotentialDragHandler, IEndDragHandler | |
{ | |
public enum ScrollState { | |
Wait, | |
BeginDrag, | |
EndDrag |