Beispiel #1
0
        public static void Initialize()
        {
            var initializerCreate = false;

            CriWareInitializer initializer = null;

            if (!CriWareInitializer.IsInitialized())
            {
                initializer = UnityUtility.FindObjectOfType <CriWareInitializer>();

                if (initializer == null)
                {
                    initializer           = UnityUtility.CreateGameObject <CriWareInitializer>(null, "CriWareInitializer");
                    initializer.hideFlags = HideFlags.DontSaveInBuild | HideFlags.DontSaveInEditor;
                    initializerCreate     = true;
                }

                initializer.Initialize();
            }

            if (initializer != null && initializerCreate)
            {
                UnityUtility.SafeDelete(initializer.gameObject);
            }
        }
Beispiel #2
0
 public static void Setup(bool useEmb = false)
 {
     if (MyCriManager.sInit)
     {
         return;
     }
     if (CriWareInitializer.IsInitialized())
     {
         DebugUtility.LogError("[MyCriManager] CriWareInitializer already initialized. if you added it or CriAtomSource in scene, remove it.");
     }
     else if (Object.op_Inequality(Object.FindObjectOfType(typeof(CriWareInitializer)), (Object)null))
     {
         DebugUtility.LogError("[MyCriManager] CriWareInitializer already exist. if you added it in scene, remove it.");
     }
     else if (Object.op_Inequality(Object.FindObjectOfType(typeof(CriAtom)), (Object)null))
     {
         DebugUtility.LogError("[MyCriManager] CriAtom already exist. if you added it in scene, remove it.");
     }
     else
     {
         GameObject gameObject = (GameObject)Object.Instantiate(Resources.Load("CriWareLibraryInitializer"), Vector3.get_zero(), Quaternion.get_identity());
         if (Object.op_Inequality((Object)gameObject, (Object)null))
         {
             CriWareInitializer component = (CriWareInitializer)gameObject.GetComponent <CriWareInitializer>();
             if (Object.op_Inequality((Object)component, (Object)null))
             {
                 if (useEmb)
                 {
                     MyCriManager.AcfFileName = Path.Combine(CriWare.get_streamingAssetsPath(), MyCriManager.AcfFileNameEmb);
                     ((CriWareDecrypterConfig)component.decrypterConfig).authenticationFile = (__Null)MyCriManager.DatFileNameEmb;
                 }
                 else
                 {
                     MyCriManager.AcfFileName = Path.Combine(CriWare.get_streamingAssetsPath(), MyCriManager.AcfFileNameAB);
                     ((CriWareDecrypterConfig)component.decrypterConfig).authenticationFile = (__Null)MyCriManager.DatFileNameAB;
                 }
                 ((CriAtomConfig)component.atomConfig).acfFileName = (__Null)string.Empty;
                 DebugUtility.LogWarning("[MyCriManager] Init with EMB:" + (object)useEmb + " acf:" + MyCriManager.AcfFileName + " dat:" + (object)((CriWareDecrypterConfig)component.decrypterConfig).authenticationFile);
                 MyCriManager.sCriWareInitializer = gameObject;
                 MyCriManager.UsingEmb            = useEmb;
                 AndroidJavaClass androidJavaClass = new AndroidJavaClass("android.os.Build");
                 string           str = androidJavaClass != null ? (string)((AndroidJavaObject)androidJavaClass).GetStatic <string>("MODEL") : (string)null;
                 if (!string.IsNullOrEmpty(str))
                 {
                     if (str.CompareTo("F-05D") == 0)
                     {
                         ((CriAtomConfig)component.atomConfig).androidBufferingTime      = (__Null)200;
                         ((CriAtomConfig)component.atomConfig).androidStartBufferingTime = (__Null)150;
                     }
                     if (str.CompareTo("T-01D") == 0)
                     {
                         ((CriAtomConfig)component.atomConfig).androidBufferingTime      = (__Null)200;
                         ((CriAtomConfig)component.atomConfig).androidStartBufferingTime = (__Null)150;
                     }
                     if (str.CompareTo("AT200") == 0)
                     {
                         ((CriAtomConfig)component.atomConfig).androidBufferingTime      = (__Null)220;
                         ((CriAtomConfig)component.atomConfig).androidStartBufferingTime = (__Null)220;
                     }
                     if (str.CompareTo("F-04E") == 0)
                     {
                         ((CriAtomConfig)component.atomConfig).androidBufferingTime      = (__Null)220;
                         ((CriAtomConfig)component.atomConfig).androidStartBufferingTime = (__Null)220;
                     }
                     if (str.CompareTo("F-11D") == 0)
                     {
                         ((CriAtomConfig)component.atomConfig).androidBufferingTime      = (__Null)400;
                         ((CriAtomConfig)component.atomConfig).androidStartBufferingTime = (__Null)400;
                     }
                     if (str.CompareTo("IS15SH") == 0)
                     {
                         ((CriAtomConfig)component.atomConfig).androidBufferingTime      = (__Null)400;
                         ((CriAtomConfig)component.atomConfig).androidStartBufferingTime = (__Null)400;
                     }
                     if (str.CompareTo("IS17SH") == 0)
                     {
                         ((CriAtomConfig)component.atomConfig).androidBufferingTime      = (__Null)400;
                         ((CriAtomConfig)component.atomConfig).androidStartBufferingTime = (__Null)400;
                     }
                     if (str.CompareTo("ISW13F") == 0)
                     {
                         ((CriAtomConfig)component.atomConfig).androidBufferingTime      = (__Null)220;
                         ((CriAtomConfig)component.atomConfig).androidStartBufferingTime = (__Null)220;
                     }
                     DebugUtility.Log("MODEL:" + str);
                 }
                 component.Initialize();
             }
         }
         MyCriManager.sInit = true;
     }
 }