public void OnShowSplash()//在onCreate里调用 { imageView = new ImageView(this); imageView.setScaleType(ImageView.ScaleType.FIT_XY); imageView.setBackgroundResource(R.drawable.splash); imageView.setImageResource(R.drawable.anim); animationDrawable = (AnimationDrawable)imageView.getDrawable(); animationDrawable.start(); mUnityPlayer.addView(imageView); } // 在unity的Activity中暴露方法给unity,让unity在准备好内容后调用隐藏启动画面 public void OnHideSplash()//在Unity3D的Start()方法里调用 { new Thread(()->{ currentActivity.runOnUiThread(() -> { animationDrawable.stop(); mUnityPlayer.removeView(imageView); }); }).start(); }
AndroidActivity跳UnityActivity时,加载动画
最新推荐文章于 2022-10-28 14:47:30 发布