Esempio n. 1
0
        public Applet(ArxFile[] files)
        {
            if (_instance != null)
            {
                throw new InvalidOperationException("Only one applet can be defined per app. Destroy the other applet.");
            }
            _instance = this;

            Tap        = new UnityEvent <string>();
            Connected  = new UnityEvent();
            this.files = new List <ArxFile>(files);

            Debug.LogWarning("The ArxOOP API is experimental. It might not feature everything available with the Arx class or have issues.");
            // Create a field for the callback
            Arx.logiArxCbContext contextCallback;
            // Set its content and callback funtion
            contextCallback.arxCallBack = SDKCallback;
            contextCallback.arxContext  = IntPtr.Zero;
            // Initialize the SDK
            bool retVal = Arx.Init(ref contextCallback);

            if (!retVal)
            {
                int retCode = Arx.GetLastError();
                Debug.LogError("Cannot initialize Arx SDK: " + retCode);
                return;
            }
            // Upload files if needed
            if (uploadOnConnection)
            {
                UploadFiles();
            }
        }
Esempio n. 2
0
        // Start is called before the first frame update
        void Start()
        {
            // Create a field for the callback
            Arx.logiArxCbContext contextCallback;
            // Set its content and callback funtion
            contextCallback.arxCallBack = SDKCallback;
            contextCallback.arxContext  = IntPtr.Zero;
            // Initialize the SDK
            bool retVal = Arx.LogiArxInit("com.unig.arx.shop", "Weapon Shop", ref contextCallback);

            if (!retVal)
            {
                int retCode = Arx.GetLastError();
                Debug.LogError("Cannot initialize Arx SDK: " + retCode);
            }

            namesRev = names.ToDictionary(x => x.Value, y => y.Key);

            StartCoroutine(GiveGold());
        }