Guest User

Untitled

a guest
Feb 23rd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. public class BaseNativeActivity extends UnityPlayerActivity {
  2. public static final void setCallbackGameObjectName(String name) {
  3. SampleUnityListener.getInstance().setCallbackGameObjectName(name);
  4. }
  5.  
  6. @Override
  7. protected void onStart() {
  8. super.onStart();
  9. SampleLifecycle.onStart(this);
  10. }
  11.  
  12. @Override
  13. protected void onResume() {
  14. super.onResume();
  15. SampleLifecycle.onResume(this);
  16. }
  17.  
  18. @Override
  19. protected void onPause() {
  20. super.onPause();
  21. SampleLifecycle.onPause(this);
  22. }
  23.  
  24. @Override
  25. protected void onDestroy() {
  26. super.onDestroy();
  27. SampleLifecycle.onDestroy();
  28. }
  29.  
  30. @Override
  31. public boolean onPrepareOptionsMenu(Menu menu) {
  32. return super.onPrepareOptionsMenu(menu);
  33. }
  34.  
  35. public void start(String sampleCode) {
  36. Sample.getInstance().start(this);
  37. }
  38.  
  39. public void doSomething() {
  40. runOnUiThread(new Runnable() {
  41. @Override
  42. public void run() {
  43. Sample.getInstance().doSomething()
  44. }
  45. });
  46. }
  47.  
  48. public int getScore() {
  49. return Sample.getInstance().getScore();
  50. }
  51.  
  52. public String getSomeText() {
  53. return Sample.getInstance().getSomeText();
  54. }
  55.  
  56. public boolean isAvailable() {
  57. return Sample.getInstance().isAvailable();
  58. }
  59. }
Add Comment
Please, Sign In to add comment