移除一些无用代码

This commit is contained in:
zhl 2023-02-07 12:04:05 +08:00
parent 6cc30df088
commit 0c6efd0cb6

View File

@ -14,7 +14,6 @@ import android.provider.MediaStore;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.Window; import android.view.Window;
import android.widget.Toast; import android.widget.Toast;
@ -143,10 +142,6 @@ public class MainActivity extends UnityPlayerActivity
String cmdLine = updateUnityCommandLineArguments(getIntent().getStringExtra("unity")); String cmdLine = updateUnityCommandLineArguments(getIntent().getStringExtra("unity"));
getIntent().putExtra("unity", cmdLine); getIntent().putExtra("unity", cmdLine);
// mUnityPlayer = new UnityPlayer(this);
// setContentView(mUnityPlayer);
// mUnityPlayer.requestFocus();
onLoadNativeLibraries(); onLoadNativeLibraries();
app = this; app = this;
Cocos2dxHelper.init(this); Cocos2dxHelper.init(this);
@ -213,7 +208,6 @@ public class MainActivity extends UnityPlayerActivity
} }
} }
if (!next) { if (!next) {
// JcSDK.csCallback(funId, "{errcode: 0, errmsg: 'cancel'}");
if (requestCode == RC_SIGN_IN) { if (requestCode == RC_SIGN_IN) {
Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data); Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
handleSignInResult(task); handleSignInResult(task);
@ -234,20 +228,11 @@ public class MainActivity extends UnityPlayerActivity
@Override @Override
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
// mUnityPlayer.start();
if (mExecutor.isShutdown()) { if (mExecutor.isShutdown()) {
mExecutor = Executors.newSingleThreadExecutor(); mExecutor = Executors.newSingleThreadExecutor();
} }
} }
// Resume Unity
@Override
protected void onResume() {
super.onResume();
// mUnityPlayer.resume();
}
// begin for unity // begin for unity
@Override @Override
protected void onNewIntent(Intent intent) { protected void onNewIntent(Intent intent) {
@ -258,86 +243,6 @@ public class MainActivity extends UnityPlayerActivity
setIntent(intent); setIntent(intent);
} }
// Pause Unity
@Override
protected void onPause() {
super.onPause();
// mUnityPlayer.pause();
}
@Override
protected void onStop() {
super.onStop();
// mUnityPlayer.stop();
}
// Quit Unity
@Override
protected void onDestroy() {
// mUnityPlayer.destroy();
super.onDestroy();
}
// This ensures the layout will be correct.
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// mUnityPlayer.configurationChanged(newConfig);
}
// Low Memory Unity
@Override
public void onLowMemory() {
super.onLowMemory();
// mUnityPlayer.lowMemory();
}
// Trim Memory Unity
@Override
public void onTrimMemory(int level) {
super.onTrimMemory(level);
if (level == TRIM_MEMORY_RUNNING_CRITICAL) {
// mUnityPlayer.lowMemory();
}
}
// @Override
// public boolean onKeyDown(int keyCode, KeyEvent event) {
// return mUnityPlayer.injectEvent(event);
// }
// Pass any events not handled by (unfocused) views straight to UnityPlayer
// @Override
// public boolean onKeyUp(int keyCode, KeyEvent event) {
// return mUnityPlayer.injectEvent(event);
// }
// @Override
// public boolean onTouchEvent(MotionEvent event) {
// return mUnityPlayer.injectEvent(event);
// }
/*API12*/
// public boolean onGenericMotionEvent(MotionEvent event) {
// return mUnityPlayer.injectEvent(event);
// }
// Notify Unity of the focus change.
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
// mUnityPlayer.windowFocusChanged(hasFocus);
}
// For some reason the multiple keyevent type is not supported by the ndk.
// Force event injection by overriding dispatchKeyEvent().
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// if (event.getAction() == KeyEvent.ACTION_MULTIPLE)
// return mUnityPlayer.injectEvent(event);
return super.dispatchKeyEvent(event);
}
protected void onLoadNativeLibraries() { protected void onLoadNativeLibraries() {
try { try {
ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA); ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA);