解决方案 »

  1.   

    Unity盖住了整个屏幕???
    按钮可见能点击不?
      

  2.   

    按钮可见,点击不了,不知道是否是盖住了整个屏幕,我试了三种布局,FrameLayout、LinearLayout、RelativeLayout都不可以,感觉可能是焦点的问题,Unity那部分本身的触摸事件,点击事件也触发不了。
      

  3.   

    按钮可见,点击不了,不知道是否是盖住了整个屏幕,我试了三种布局,FrameLayout、LinearLayout、RelativeLayout都不可以,感觉可能是焦点的问题,Unity那部分本身的触摸事件,点击事件也触发不了。
      

  4.   


    改布局
    <?xml version="1.0" encoding="utf-8"?>  
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
        android:layout_width="match_parent"  
        android:layout_height="match_parent"  
        android:orientation="vertical" >  
       
        <Button  
            android:id="@+id/trun_round"  
            android:layout_width="match_parent"  
            android:layout_height="wrap_content"  
            android:layout_alignParentTop="true"  
            android:text="around" />  
       
        <Button  
            android:id="@+id/left"  
            android:layout_width="match_parent"  
            android:layout_height="wrap_content"  
            android:layout_alignParentBottom="true"
            android:text="left" />
        
        <LinearLayout
            android:id="@+id/unity"
            android:layout_width="100dp"
            android:layout_height="match_parent"
            android:layout_below="@id/trun_round"
            android:layout_above="@id/left"
            android:background="#ccffcc"
            android:orientation="horizontal" >
       
        </LinearLayout>  
       
          
       
    </RelativeLayout>  
      

  5.   


    改布局
    <?xml version="1.0" encoding="utf-8"?>  
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
        android:layout_width="match_parent"  
        android:layout_height="match_parent"  
        android:orientation="vertical" >  
       
        <Button  
            android:id="@+id/trun_round"  
            android:layout_width="match_parent"  
            android:layout_height="wrap_content"  
            android:layout_alignParentTop="true"  
            android:text="around" />  
       
        <Button  
            android:id="@+id/left"  
            android:layout_width="match_parent"  
            android:layout_height="wrap_content"  
            android:layout_alignParentBottom="true"
            android:text="left" />
        
        <LinearLayout
            android:id="@+id/unity"
            android:layout_width="100dp"
            android:layout_height="match_parent"
            android:layout_below="@id/trun_round"
            android:layout_above="@id/left"
            android:background="#ccffcc"
            android:orientation="horizontal" >
       
        </LinearLayout>  
       
          
       
    </RelativeLayout>  跟布局没啥关系吧,这布局还要怎么改?三种基本的我都试过了。都没用。
      

  6.   

    小弟大概了解了下:## unity3d anroid sdk 嵌入有两种方法---1. 在android项目中写好所有api,然后生成jar,导入到u3d项目中,让u3d的脚本逻辑调用这些api
    2. unity3d项目中写好所有事件触发,然后在android项目中捕捉这些事件,然后实现里面的逻辑楼主的应该是采用第一种方法,而第一种方法的弊端就是你不能使用所有布局控件,因为unity3d不会传递触摸事件到这些布局中的,解决方法:采用WindowManager来代替Layout来实现布局,然后采用WindowManager来展示
      

  7.   

    给你看一个我的博客
    http://blog.csdn.net/jiguangcanhen/article/details/40339381
      

  8.   

    我按照楼主的步骤,怎么运行android项目的时候 ,出错,运行不起来!
    提示我:the application xxx has stopped unexceptedly......
    请问楼主怎么回事???
      

  9.   

    解决方法是在AndroidManifest.xml文件中的activity子节点下增加如下两行代码:            <meta-data android:name="android.app.lib_name" android:value="unity" /> 
                <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />