当前位置: 首页>>代码示例>>C#>>正文


C# AndroidJavaObject.Dispose方法代码示例

本文整理汇总了C#中UnityEngine.AndroidJavaObject.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# AndroidJavaObject.Dispose方法的具体用法?C# AndroidJavaObject.Dispose怎么用?C# AndroidJavaObject.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.AndroidJavaObject的用法示例。


在下文中一共展示了AndroidJavaObject.Dispose方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PostMessage

    public static void PostMessage(ServiceType type, string text, string url)
    {
        string packageName = string.Empty;

        if(type.Equals(ServiceType.Twitter)){
            packageName = "com.twitter.android";
        }else if (type.Equals(ServiceType.Facebook)){
            packageName = "com.facebook.katana";
        }

        AndroidJavaObject intent = new AndroidJavaObject ( "android.content.Intent" );

        intent.Call<AndroidJavaObject> ( "setPackage", packageName );
        intent.Call<AndroidJavaObject> ( "setType", "text/plain" );
        intent.Call<AndroidJavaObject> ( "putExtra", "android.intent.extra.TEXT" , text + "\t" + url );
        activity.Call ("startActivity", intent.CallStatic<AndroidJavaObject>( "createChooser", intent, "Sorry" ));
        intent.Dispose ();
    }
开发者ID:unwest,项目名称:social-connector,代码行数:18,代码来源:SocialConector.cs

示例2: OnRealTimeMessageReceived

 private void OnRealTimeMessageReceived(AndroidJavaObject message) {
     Logger.d("AndroidClient.OnRealTimeMessageReceived.");
     
     if (!CheckRtmpActive("OnRealTimeMessageReceived")) {
         return;
     }
     
     RealTimeMultiplayerListener listener = mRtmpListener;
     if (listener != null) {
         byte[] messageData;
         using (AndroidJavaObject messageBytes = message.Call<AndroidJavaObject>("getMessageData")) {
             messageData = JavaUtil.ConvertByteArray(messageBytes);
         }
         bool isReliable = message.Call<bool>("isReliable");
         string senderId = message.Call<string>("getSenderParticipantId");
         
         PlayGamesHelperObject.RunOnGameThread(() => {
             listener.OnRealTimeMessageReceived(isReliable, senderId, messageData);
         });
     }
     message.Dispose();
 }
开发者ID:bruno360,项目名称:net.kibotu.sandbox.unity.dragnslay,代码行数:22,代码来源:AndroidRtmpClient.cs

示例3: Finish

 public void Finish(string matchId, byte[] data, MatchOutcome outcome, Action<bool> callback) {
     Logger.d(string.Format("AndroidTbmpClient.Finish matchId={0}, data={1} outcome={2}",
             matchId, data == null ? "(null)" : data.Length + " bytes", outcome));
                 
     Logger.d("Preparing list of participant results as Android ArrayList.");
     AndroidJavaObject participantResults = new AndroidJavaObject("java.util.ArrayList");
     if (outcome != null) {
         foreach (string pid in outcome.ParticipantIds) {
             Logger.d("Converting participant result to Android object: " + pid);
             AndroidJavaObject thisParticipantResult = new AndroidJavaObject(
                 JavaConsts.ParticipantResultClass, pid,
                 JavaUtil.GetAndroidParticipantResult(outcome.GetResultFor(pid)),
                 outcome.GetPlacementFor(pid));
             
             // (yes, the return type of ArrayList.add is bool, strangely)
             Logger.d("Adding participant result to Android ArrayList.");
             participantResults.Call<bool>("add", thisParticipantResult);
             thisParticipantResult.Dispose();
         }
     }
     
     TbmpApiCall("tbmp finish w/ outcome", "finishMatch", callback, null, 
             matchId, data, participantResults);
 }
开发者ID:486boy,项目名称:play-games-plugin-for-unity,代码行数:24,代码来源:AndroidTbmpClient.cs

示例4: Dispose

 public void Dispose()
 {
     chartboostSingleton = null;
     chartboostSingleton.Dispose();
 }
开发者ID:sujithgt,项目名称:CrystalSwarm,代码行数:5,代码来源:Chartboost.cs

示例5: showExportProgress

        public void showExportProgress()
        {
            string exportTxt = " (" + m_meshes.Count + " meshes)";
            jvalue[] args = new jvalue[1];
            using( AndroidJavaClass progressDlg = new AndroidJavaClass( "android.app.ProgressDialog" ) ) {
                m_progressDlg = progressDlg.CallStatic<AndroidJavaObject>( "show", m_unityActivity, "Exporting...", exportTxt );
                //args[0].i = 1;
                //m_progressDlg.Call( "setProgressStyle", 1 );
                //if( m_progressDlg != null ) {
                //    args[0].i = m_meshes.Count;
                //    m_progressDlg.Call( "setMax", m_meshes.Count );
                //    args[0].i = 0;
                //    m_progressDlg.Call( "setProgress", 0 );
                //}
                //m_progressDlg.Call( "show" );
            }
            //args[0].i = 0;
            int progress = 0;
            m_exportLock.WaitOne();
            while( m_isExporting ) {
                m_exportLock.ReleaseMutex();

                m_progressLock.WaitOne();
                progress = m_progress;
                m_progressLock.ReleaseMutex();
                //m_progressDlg.Call( "setProgress", args[0].i );//FIX THIS THIS THIS SHITE
                m_progressDlg.Call( "setMessage", (progress + " %") );

                Thread.Sleep( 500 );
                m_exportLock.WaitOne();
            }
            m_exportLock.ReleaseMutex();
            m_progressDlg.Call( "dismiss" );
            m_progressDlg.Dispose();//necessary
        }
开发者ID:broostar,项目名称:youvebeentangoed,代码行数:35,代码来源:TangoPointsMesh.cs

示例6: _sendLtv

	private static void _sendLtv(int cvId, string adId){
		AndroidJavaObject ltv = new AndroidJavaObject(ltvClass, currentActivity, ad);
		foreach (DictionaryEntry de in p) {
			ltv.Call("addParam", de.Key, de.Value);
		}
		if (adId == null) {
			ltv.Call("sendLtvConversionUnity", cvId);
		} else {
			ltv.Call("sendLtvConversionUnity", cvId, adId);
		}
		ltv.Dispose();
		p = new Hashtable();
	}
开发者ID:arith-inukai,项目名称:TestBatchBuild,代码行数:13,代码来源:FoxPluginAndroid.cs

示例7: ltvOpenBrowser

	public static void ltvOpenBrowser(string url){
		AndroidJavaObject ltv = new AndroidJavaObject(ltvClass, currentActivity, ad);
		ltv.Call("ltvOpenBrowserUnity", url);
		ltv.Dispose();
	}
开发者ID:arith-inukai,项目名称:TestBatchBuild,代码行数:5,代码来源:FoxPluginAndroid.cs


注:本文中的UnityEngine.AndroidJavaObject.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。