public void Create(GameObject _gameObject, UNIQUEID _uniqueId, ScriptableObject _scriptable = null) { this.go_ = _gameObject; this.trans_ = go_.transform; this.uniqueId = _uniqueId; this.go_.SetActive(false); OnCreate(_gameObject, _scriptable, _uniqueId); }
public bool Equals(UNIQUEID p) { if ((object)p == null) { return(false); } return(this.uniqueId == p.uniqueId); }
public GameObject Create(string _name, UNIQUEID _uniqueId, ScriptableObject _scriptable = null) { this.go_ = new GameObject(_name); this.trans_ = go_.transform; this.uniqueId = _uniqueId; this.go_.SetActive(false); OnCreate(_name, _scriptable, _uniqueId); return(go_); }
public override bool Equals(System.Object obj) { if (obj == null) { return(false); } UNIQUEID p = (UNIQUEID)obj; return(this.uniqueId == p.uniqueId); }
// unique ユニークID // obj 対象オブジェクト public bool GetObject(UNIQUEID unique, out T obj) { // 関係のないユニークID if (this.category != unique.category) { obj = null; return(false); } obj = this.objList[unique.type][unique.index]; if (!obj.Alive) { return(false); } // フラッシュID が更新されていれば別人 return(obj.uniqueId == unique); }
// type オブジェクトの種類</param> private T GenerateObject(int type) { int index = this.objParams[type].genCount; ScriptableObject scriptable = this.objParams[type].scriptable; Transform root = this.objParams[type].root; GameObject go = new GameObject(); go.transform.parent = root; #if UNITY_EDITOR go.name = string.Format(this.objParams[type].scriptable.name + "{0:D2}", this.objParams[type].genCount); #endif T obj = new T(); // ユニークID を割り振り obj.Create(go, scriptable, UNIQUEID.Create(UNIQUEID.CATEGORYBIT(this.category) | UNIQUEID.TYPEBIT(type) | UNIQUEID.INDEXBIT(index))); this.objList[type][index] = obj; ++this.objParams[type].genCount; return(obj); }
protected abstract void OnCreate(string _name, ScriptableObject _scriptable, UNIQUEID _uniqueId);
protected abstract void OnCreate(GameObject _go, ScriptableObject _scriptable, UNIQUEID _uniqueId);
protected override void OnCreate(string _name, ScriptableObject _scriptable, UNIQUEID _uniqueId) { this.mScriptable = _scriptable as EnemyScriptableObject; }
protected override void OnCreate(GameObject _go, ScriptableObject _scriptable, UNIQUEID _uniqueId) { this.mScriptable = _scriptable as EnemyScriptableObject; this.sr_ = go_.AddComponent <SpriteRenderer>(); this.sr_.sprite = mScriptable.sprite; }