public Context(object view, bool autoStartup)
        {
            //If firstContext was unloaded, the contextView will be null. Assign the new context as firstContext.
            if (_firstContext == null || _firstContext.GetContextView() == null)
            {
                _firstContext = this;

#if UNITY_EDITOR
                DebuggingOptions = Resources.Load <ContextDebuggingOptions>("ContextDebuggingOptions");

                if (DebuggingOptions == null)
                {
                    // If not found, create
                    DebuggingOptions = ScriptableObject.CreateInstance <ContextDebuggingOptions>();
                    AssetDatabase.CreateAsset(DebuggingOptions, "Assets/Resources/ContextDebuggingOptions.asset");
                    AssetDatabase.SaveAssets();
                }
#endif
            }
            else
            {
                _firstContext.AddContext(this);
            }
            this.autoStartup = autoStartup;
            SetContextView(view);
            addCoreComponents();
        }
Exemplo n.º 2
0
 public Context(object view, bool autoStartup)
 {
     if (firstContext == null)
     {
         firstContext = this;
     }
     else
     {
         firstContext.AddContext(this);
     }
     this.autoStartup = autoStartup;
     SetContextView(view);
     addCoreComponents();
 }
Exemplo n.º 3
0
 public Context(object view, bool autoStartup)
 {
     //If firstContext was unloaded, the contextView will be null. Assign the new context as firstContext.
     if (firstContext == null || firstContext.GetContextView() == null)
     {
         firstContext = this;
     }
     else
     {
         firstContext.AddContext(this);
     }
     this.autoStartup = autoStartup;
     SetContextView(view);
     addCoreComponents();
 }
Exemplo n.º 4
0
 public Context(object view, ContextStartupFlags flags)
 {
     //If firstContext was unloaded, the contextView will be null. Assign the new context as firstContext.
     if (firstContext == null || firstContext.GetContextView() == null)
     {
         firstContext = this;
     }
     else
     {
         firstContext.AddContext(this);
     }
     SetContextView(view);
     addCoreComponents();
     this.autoStartup = (flags & ContextStartupFlags.MANUAL_LAUNCH) != ContextStartupFlags.MANUAL_LAUNCH;
     if ((flags & ContextStartupFlags.MANUAL_MAPPING) != ContextStartupFlags.MANUAL_MAPPING)
     {
         Start();
     }
 }
Exemplo n.º 5
0
 public Context(object view, ContextStartupFlags flags)
 {
     // If firstContext was unloaded, the contextView will be null. Assign the new context as firstContext.
     // The additional Equals(null) check is in the case the contextView GameObject is marked for destruction without
     // actually being destroyed yet. All three conditions, in this order, are valid reasons to set firstContext.
     // https://answers.unity.com/questions/586144/destroyed-monobehaviour-not-comparing-to-null.html
     if (firstContext == null || firstContext.GetContextView() == null || firstContext.GetContextView().Equals(null))
     {
         firstContext = this;
     }
     else
     {
         firstContext.AddContext(this);
     }
     SetContextView(view);
     addCoreComponents();
     this.autoStartup = (flags & ContextStartupFlags.MANUAL_LAUNCH) != ContextStartupFlags.MANUAL_LAUNCH;
     if ((flags & ContextStartupFlags.MANUAL_MAPPING) != ContextStartupFlags.MANUAL_MAPPING)
     {
         Start();
     }
 }