예제 #1
0
    static int BindSpeechResult(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 2);
            NativeManager obj = (NativeManager)ToLua.CheckObject(L, 1, typeof(NativeManager));
            System.Action <string, byte[], int> arg0 = null;
            LuaTypes funcType2 = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (System.Action <string, byte[], int>)ToLua.CheckObject(L, 2, typeof(System.Action <string, byte[], int>));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(System.Action <string, byte[], int>), func) as System.Action <string, byte[], int>;
            }

            obj.BindSpeechResult(arg0);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
 public void Setup()
 {
     n      = new NativeManager();
     array1 = new NativeArray <int>();
     array2 = new NativeArray <int>();
     jobComponentSystem2 = new JobComponentSystem2();
 }
예제 #3
0
        protected virtual void SendNotification()
        {
            this.builder ??= new NotificationCompat.Builder(this.Context.AppContext)
            .SetChannelId(NotificationChannelId)
            .SetSmallIcon(this.AndroidNotifications !.GetSmallIconResource(null))
            .SetOngoing(true);

            this.builder
            .SetProgress(
                this.Service !.Total,
                this.Service.Progress,
                this.Service.IsIndeterministic
                )
            .SetContentTitle(this.Service.Title ?? "Shiny Service")
            .SetTicker("..")
            .SetContentText(this.Service.Message ?? "Shiny service is continuing to process data in the background");

            if (this.notificationId == null)
            {
                this.notificationId = ++idCount;
                this.StartForeground(this.notificationId.Value, this.builder.Build());
            }
            else
            {
                this.AndroidNotifications !.NativeManager.Notify(this.notificationId.Value, this.builder.Build());
            }
        }
예제 #4
0
        protected override void OnStartRunning()
        {
            int length = componentGroup.CalculateLength();

            for (int i = 0; i < IterationCount; i++)
            {
                hashMaps[i] = NativeManager.AllocateAndAutoDisposeNativeMultiHashMap <Entity, float2>(length * 12, Allocator.Persistent);
            }
        }
예제 #5
0
 public void FireButtonDown(PointerEventData eventData)
 {
     if (this.onButtonDown != null)
     {
         if (!NativeManager.GetInstance().shouldForbideTouch())
         {
             this.onButtonDown(this.gameObject, eventData.pointerId);
         }
     }
 }
예제 #6
0
 /// <summary>
 /// 加入对话组 不带发送操作
 /// </summary>
 /// <param name="groupId"></param>
 public void ApplyJoinGroup(string groupId)
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         NativeManager.OnFuncCall("ApplyJoinGroup", groupId);
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         NativeManager.ApplyJoinGroup(groupId);
     }
 }
예제 #7
0
 /// <summary>
 /// 登出
 /// </summary>
 public void LoginOut()
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         NativeManager.OnFuncCall("KeFuLoginOut");
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         NativeManager.KeFuLoginOut();
     }
 }
예제 #8
0
    void Awake()
    {
        instance = this;
#if UNITY_IPHONE
        UnityEngine.iOS.NotificationServices.RegisterForNotifications(
            UnityEngine.iOS.NotificationType.Alert |
            UnityEngine.iOS.NotificationType.Badge |
            UnityEngine.iOS.NotificationType.Sound);
#endif
        CancelAllNotifications();
    }
예제 #9
0
 /// <summary>
 /// 离开对话组
 /// </summary>
 public void ClearConversation()
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         NativeManager.OnFuncCall("IMLeaveConversation");
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         NativeManager.ClearConversation();
     }
 }
예제 #10
0
 /// <summary>
 /// 设置对话组
 /// </summary>
 /// <param name="groupId"></param>
 public void SetConversation(string groupId)
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         NativeManager.OnFuncCall("IMSetConversation", groupId);
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         NativeManager.SetConversation(groupId);
     }
 }
예제 #11
0
 /// <summary>
 /// 设置播放音量  同步牌局音量
 /// </summary>
 /// <param name="volume"></param>
 public void SetVolume(float volume)
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         NativeManager.OnFuncCall("setVolume", volume);
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         NativeManager.SetVolume(volume);
     }
 }
예제 #12
0
 /// <summary>
 /// 发送文本信息
 /// </summary>
 /// <param name="str"></param>
 public void SendMessage(string str)
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         NativeManager.OnFuncCall("IMSendMessage", str);
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         NativeManager.IMSendMessage(str);
     }
 }
예제 #13
0
 /// <summary>
 /// 停止播放录音音效
 /// </summary>
 public void StopVoice()
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         NativeManager.OnFuncCall("StopVoice");
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         NativeManager.StopVoice();
     }
 }
예제 #14
0
 /// <summary>
 /// 播放录音音效
 /// </summary>
 public void PlayVoice(string path)
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         NativeManager.OnFuncCall("PlayVoice", path);
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         NativeManager.PlayVoice(path);
     }
 }
예제 #15
0
 /// <summary>
 /// 返回IM当前状态 -1未实例化 0-未登录 , 1-登录中, 2已登录
 /// </summary>
 /// <returns></returns>
 public int GetImState()
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         return(NativeManager.OnFuncCall <int>("GetImState"));
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(NativeManager.GetImState());
     }
     return(0);
 }
예제 #16
0
 /// <summary>
 /// 停止播放录音音效
 /// </summary>
 public bool IsPlayingVoice()
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         return(NativeManager.OnFuncCall <bool>("IsPlayingVoice"));
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(NativeManager.IsPlayingVoice());
     }
     return(false);
 }
예제 #17
0
 /// <summary>
 /// 停止录音
 /// </summary>
 /// <param name="isSend">是否发送到聊天组</param>
 /// <returns>音频的毫秒数,如果返回0, 表示录制失败, 或者时间不够</returns>
 public long StopRecord(bool isSend)
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         return(NativeManager.OnFuncCall <long>("StopRecord", isSend));
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(NativeManager.StopRecord(isSend));
     }
     return(0);
 }
예제 #18
0
 /// <summary>
 /// 开始录音
 /// </summary>
 public bool StartRecord()
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         return(NativeManager.OnFuncCall <bool>("StartRecord"));
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         return(NativeManager.StartRecord());
     }
     return(false);
 }
예제 #19
0
 /// <summary>
 /// 调用原生登录退出
 /// </summary>
 public void LoginOut()
 {
     if (Application.platform == RuntimePlatform.Android)
     {
         NativeManager.OnFuncCall("IMLoginOut");
     }
     else if (Application.platform == RuntimePlatform.IPhonePlayer)
     {
         NativeManager.IMLoginOut();
     }
     isKeepAlive = false;
 }
예제 #20
0
        public Tile CreateTile(string nativeName, int x, int y, int?height)
        {
            if (Tiles[x][y] != null)
            {
                return(null);
            }

            Tile tile = new Tile(this, x, y, NativeManager.GetTileNative(nativeName), height);

            Tiles[x][y] = tile;
            return(tile);
        }
예제 #21
0
    // Use this for initialization
    void Start()
    {
        YSFramework.Utils.Utils.SetDataPicker(picker);

        submitBtn.onClick.AddListener(() =>
        {
            bool succ = StorageManager.DeleteCoustomer(picker.SelectedDate.Date);

            print("Delete :" + succ);
            NativeManager.ShowToast("Delete :" + (succ?"成功":"失敗"));
        });
    }
예제 #22
0
    private void Awake()
    {
        Instance = this;

#if UNITY_ANDROID
        if (Application.platform == RuntimePlatform.Android)
        {
            using (AndroidJavaClass sdkserver = new AndroidJavaClass(SDK_JAVA_CLASS)) {
                sdkserver.CallStatic("Init");
            }
        }
#endif
    }
    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            DontDestroyOnLoad(gameObject);
//			getUUID_fromDevice();
            instance = this;
        }
        else
        {
            DestroyImmediate(this.gameObject);
        }
    }
예제 #24
0
 static int CancelAllNotifications(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         NativeManager obj = (NativeManager)ToLua.CheckObject(L, 1, typeof(NativeManager));
         obj.CancelAllNotifications();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #25
0
 static int OnSpeechEnd(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         NativeManager obj = (NativeManager)ToLua.CheckObject(L, 1, typeof(NativeManager));
         obj.OnSpeechEnd();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #26
0
 static int GetInstance(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 0);
         NativeManager o = NativeManager.GetInstance();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    private void OnClickChangeAvatar(GameObject targetObject)
    {
        NativeManager nativeCode = NativeManager.Instance;

        nativeCode.PromptPictureFromAlbum(
            delegate(Texture2D texture)
        {
            avatar.mainTexture = texture;
            GameManager.Instance.mInfo.SetTexture(texture);
            _ChangeAvatar(texture);
            GameObject.Destroy(nativeCode.gameObject);
        }
            );
    }
예제 #28
0
 static int shouldForbideTouch(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         NativeManager obj = (NativeManager)ToLua.CheckObject(L, 1, typeof(NativeManager));
         bool          o   = obj.shouldForbideTouch();
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #29
0
        /// <summary>
        /// 登录
        /// </summary>
        public void Login(string userId, string uersName)
        {
            string uname  = $"{uersName}({userId})";
            int    status = 0;

            if (Application.platform == RuntimePlatform.Android)
            {
                status = NativeManager.OnFuncCall <int>("KeFuLogin", userId, uname);
            }
            else if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                status = NativeManager.KeFuLogin(userId, uname);
            }
            Log.Debug($"KeFuLogin status = {status}");
        }
예제 #30
0
        /// <summary>
        /// 初始化SDK
        /// </summary>
        void Init()
        {
            String siteid = "kf_10535";
            String sdkkey = "c5403fda-4a16-4fbe-85e7-cf7041928e12";//

            if (Application.platform == RuntimePlatform.Android)
            {
                Log.Debug($"siteid = {siteid} , sdkkey = {sdkkey}");
                NativeManager.OnFuncCall("KeFuInit", siteid, sdkkey);
            }
            else if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                NativeManager.KeFuInit(siteid, sdkkey);
            }
        }