移除一些无用代码
This commit is contained in:
parent
6cc30df088
commit
0c6efd0cb6
@ -14,7 +14,6 @@ import android.provider.MediaStore;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.Window;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -143,10 +142,6 @@ public class MainActivity extends UnityPlayerActivity
|
||||
String cmdLine = updateUnityCommandLineArguments(getIntent().getStringExtra("unity"));
|
||||
getIntent().putExtra("unity", cmdLine);
|
||||
|
||||
// mUnityPlayer = new UnityPlayer(this);
|
||||
// setContentView(mUnityPlayer);
|
||||
// mUnityPlayer.requestFocus();
|
||||
|
||||
onLoadNativeLibraries();
|
||||
app = this;
|
||||
Cocos2dxHelper.init(this);
|
||||
@ -213,7 +208,6 @@ public class MainActivity extends UnityPlayerActivity
|
||||
}
|
||||
}
|
||||
if (!next) {
|
||||
// JcSDK.csCallback(funId, "{errcode: 0, errmsg: 'cancel'}");
|
||||
if (requestCode == RC_SIGN_IN) {
|
||||
Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
|
||||
handleSignInResult(task);
|
||||
@ -234,20 +228,11 @@ public class MainActivity extends UnityPlayerActivity
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
// mUnityPlayer.start();
|
||||
|
||||
if (mExecutor.isShutdown()) {
|
||||
mExecutor = Executors.newSingleThreadExecutor();
|
||||
}
|
||||
}
|
||||
|
||||
// Resume Unity
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
// mUnityPlayer.resume();
|
||||
}
|
||||
|
||||
// begin for unity
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
@ -258,86 +243,6 @@ public class MainActivity extends UnityPlayerActivity
|
||||
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() {
|
||||
try {
|
||||
ApplicationInfo ai = getPackageManager().getApplicationInfo(getPackageName(), PackageManager.GET_META_DATA);
|
||||
|
Loading…
x
Reference in New Issue
Block a user