Пример #1
0
    public void SetupMBDO <T>(ref T mbdo) where T : MBDataObject
    {
        if (caller != null && caller.gameObject.scene != new Scene())
        {
            if (isSetup == false)
            {
                Debug.LogWarning("MBDOInitializationHelper: " + mbdo + "is not set up in::: " + caller);
            }
            else if (CardinalObj != null && mbDatabaseObjectReferences != null)
            {
                if (mbdo == null && CardinalObj.scene != new Scene())
                {
                    //Debug.Log("SetupMBDO caller: " + caller + " scene: " + caller.gameObject.scene.name);
                    //Debug.Log("SetupMBDO system: " + CardinalObj + " scene: " + CardinalObj.scene.name);
                    if (isCardinal == true)
                    {
                        mbDatabaseObjectReferences.TryPopulate(out mbdo);
                    }
                    else if (CardinalObj.scene == caller.gameObject.scene)
                    {
                        mbDatabaseObjectReferences.TryPopulate(out mbdo);
                    }

#if UNITY_EDITOR
                    UnityEditor.EditorUtility.SetDirty(caller);
#endif
                }
            }
        }
    }
Пример #2
0
 public void SetupMBDO <T>(ref T mbdo) where T : MBDataObject
 {
     if (isSetup == false)
     {
         //Debug.LogWarning("MBDOInitializationHelper: " + mbdo + "is not set up in::: " + caller);
     }
     else if (cardinalSubsystem != null && mbDatabaseObjectReferences != null)
     {
         if (mbdo == null && cardinalSubsystem.scene == caller.gameObject.scene && cardinalSubsystem.scene != new UnityEngine.SceneManagement.Scene())
         {
             mbDatabaseObjectReferences.TryPopulate(out mbdo);
         }
     }
 }