本文整理汇总了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 ();
}
示例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();
}
示例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);
}
示例4: Dispose
public void Dispose()
{
chartboostSingleton = null;
chartboostSingleton.Dispose();
}
示例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
}
示例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();
}
示例7: ltvOpenBrowser
public static void ltvOpenBrowser(string url){
AndroidJavaObject ltv = new AndroidJavaObject(ltvClass, currentActivity, ad);
ltv.Call("ltvOpenBrowserUnity", url);
ltv.Dispose();
}