protected virtual void Awake()
 {
     if (allowOnlyOneFactionManager && m_instance != null)
     {
         if (debug)
         {
             Debug.Log("Love/Hate: A Faction Manager already exists. Destroying this new one.");
         }
         Destroy(this.gameObject);
         return;
     }
     m_instance = this;
     Initialize();
 }
 public bool FindResources()
 {
     if (factionManager == null)
     {
         factionManager = FindObjectOfType <FactionManager>();
     }
     if (factionDatabase == null)
     {
         if (factionManager != null)
         {
             factionDatabase = factionManager.factionDatabase;
         }
         if (factionDatabase == null)
         {
             var databases = Resources.FindObjectsOfTypeAll <FactionDatabase>();
             if (databases.Length > 0)
             {
                 factionDatabase = databases[0];
             }
         }
     }
     return(factionManager != null && factionDatabase != null);
 }
Exemple #3
0
 public override void Awake()
 {
     base.Awake();
     m_manager = GetComponent <FactionManager>();
 }