Example #1
0
    // --------
    static UpgradeSettingsManager GetInstance()
    {
        if (s_Instance == null)
        {
            s_Instance = ScriptableObject.CreateInstance <UpgradeSettingsManager>();
            s_Instance.Init("_Settings/_UpgradesSettings");
            ScriptableObject.DontDestroyOnLoad(s_Instance);
        }

        return(s_Instance);
    }
Example #2
0
    // =======================================================================
    /// Private part ...
    static TextDatabase GetInstance()
    {
        if (s_Instance == null)
        {
            s_Instance = ScriptableObject.CreateInstance <TextDatabase>();
            if (s_Instance == null)
            {
                Debug.LogError("Can't create TextDatabase");
                return(null);
            }

            ScriptableObject.DontDestroyOnLoad(s_Instance);

            // TODO reload default language. This nead to be changed...
            s_Instance.Reload();
        }

        return(s_Instance);
    }
Example #3
0
    // INTERNAL METHODS

    internal static void Initialize()
    {
        //System.DateTime time = System.DateTime.UtcNow;

#if DEADZONE_DEDICATEDSERVER
        return;
#else // DEADZONE_DEDICATEDSERVER
        if (m_Instance == null)
        {
            m_Instance = ScriptableObject.CreateInstance <InputManager>();
            if (m_Instance == null)
            {
                Debug.LogError("Can't create InputManager");
            }
            else
            {
                m_Instance.CreateDrivers();
                ScriptableObject.DontDestroyOnLoad(m_Instance);
            }
        }
#endif // DEADZONE_DEDICATEDSERVER

        //Debug.Log(GetInstance().GetType().Name + " initialized in " + System.DateTime.UtcNow.Subtract(time).TotalMilliseconds + " miliseconds.");
    }