static AndroidNotifications()
 {
     if (notifHandlerClass == null)
     {
         Debug.LogError("Class com.area730.localnotif.NotificationHandler not found");
     }
     else
     {
         Debug.Log("Android notifications plugin loaded. Version: " + getVersion());
         _dataHolder = (DataHolder)Resources.Load("NotificationData");
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        static AndroidNotifications()
        {
#if UNITY_ANDROID && !UNITY_EDITOR
            // Find the java class that handles notifications
            notifHandlerClass = new AndroidJavaClass("com.area730.localnotif.NotificationHandler");
            if (notifHandlerClass == null)
            {
                Debug.LogError("Class com.area730.localnotif.NotificationHandler not found");
                return;
            }

            Debug.Log("Android notifications plugin loaded. Version: " + getVersion());
#else
            Debug.LogWarning("Android notifications can work only on android devices");
#endif

            _dataHolder = (DataHolder)Resources.Load("NotificationData");
        }
Exemplo n.º 3
0
        void OnEnable()
        {
            if (!Directory.Exists(EditorConstants.RESOURCES_PATH))
            {
                Directory.CreateDirectory(EditorConstants.RESOURCES_PATH);
            }

            _dataHolder = AssetDatabase.LoadAssetAtPath(EditorConstants.SAVE_PATH, typeof(DataHolder)) as DataHolder;

            if (_dataHolder == null)
            {
                _dataHolder = CreateInstance <DataHolder>();
                AssetDatabase.CreateAsset(_dataHolder, EditorConstants.SAVE_PATH);
                AssetDatabase.SaveAssets();
                AssetDatabase.Refresh();
            }

            _customSkin = EditorGUIUtility.Load(EditorConstants.EDITOR_SKIN_FILENAME) as GUISkin;
        }