public void AwakeImpl(bool fromLateExecQueue = false) { if (lateAwakeStart && !(fromLateExecQueue)) { // 今すぐ実行せず、待ち行列に入れる lateAwakeQueue.Enqueue(this); } else { if (!awakeCalled && GetDescStruct() != null) { if (!enabled) { return; } sprObject = Build(); if (sprObject != null) { // print(name + " : sprObject = " + sprObject.ToString()); sprBehaviourMap[sprObject] = this; // 逆引き辞書に登録 } awakeCalled = true; } } }
// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- // その他のメソッド // Springheadオブジェクトに対応するGameObjectを返す public static Type GetBehaviour <Type>(ObjectIf springheadObject) where Type : SprBehaviour { if (sprBehaviourMap.ContainsKey(springheadObject)) { return(sprBehaviourMap[springheadObject] as Type); } return(null); }
public virtual void Awake() { if (!awakeCalled && GetDescStruct() != null) { if (!enabled) { return; } sprObject = Build(); sprBehaviourMap[sprObject] = this; // 逆引き辞書に登録 awakeCalled = true; } }
// ----- ----- ----- ----- ----- // ObjectIf --> SprBehaviour public static Type GetBehaviour <Type>(this ObjectIf springheadObject) where Type : SprBehaviour { return(SprBehaviour.GetBehaviour <Type>(springheadObject)); }