zoukankan      html  css  js  c++  java
  • Unity3D 基本概念合集

       鼠标监听回调
    >* OnMouseEnter(); 当鼠标进入
    >* OnMouseExit(); 当鼠标离开
    >* OnMouseDown(); 当鼠标按下
    >* OnMouseUp(); 当鼠标抬起
    >* OnMouseDrag(); 当鼠标拖拽

        碰撞检测回调
    >* OnCollisionEnter(Collision co); 当发生碰撞时

    ###GameObject对象的使用(相当于整个视频的策划,而Camera只是扛摄像机的)
    >* Instantiate(x,x,x); 用于创建一个对象
    >* Destory(x); 用于销毁一个对象
    >* Find(x); 用于查找一个对象

        按键反馈
    >* Input.getKeyDown(KeyCode.x)
    >* Input.getKeyUp(KeyCode.x)
    >* Input.getMouseButtonDown(0 或者 1)

        用户界面设计
    >### OnGUI(); 用户界面显示的回调
    GUI.Lable(); 显示文本
    GUI.Button(); 按钮
    GUI.RepeatButton(); 按钮,与上面不同的时,按下的会一直回调
    GUI.TextField() 文本输入框
    GUI.TextArea() 文本输入块
    GUI.PasswordwordField(); 密码输入框
    GUI.Toggle(); 单选按钮或者是复选按钮

        GUILayOut的使用
    GUILayout.Label()....
    GUILayout有常用的布局方式:水平布局或者是垂直布局,默认的是垂直布局
    //水平
    GUILayout.beginHorizontal();
    GUILayout.endHorizontal();
    //垂直
    GUILayout.beginVertical();
    GUILayout.endVertical();



         阴影烘焙
    > 对象是静止的才能进行阴影的烘焙

        Application对象(相当于视频导演)
    Application.loadLevel(); //加载关卡
    Application.captureScreenShot(string fileName); //进行屏幕截图
    Application.openURL(); //打开网络连接
    Application.Quite(); //整个应用退出



       射线技术,进行碰撞检测,碰撞销毁
    > Ray ray = Camera.main.ScreenPointToRay
    > RayCastHint hitInfo;
    > if(PhySics.RayCast(Ray,out hitinfo)
    {
    Destory(hitInfo.Collider.gameObject);
    }

      

     

  • 相关阅读:
    Linux shell的&&和||--转载
    Paxos算法之旅(四)zookeeper代码解析--转载
    linux shell less 命令---转
    8 Pratical Examples of Linux “Touch” Command--reference
    5 Ways to Use Log Data to Analyze System Performance--reference
    Load resources from classpath in Java--reference
    Eclipse Key Shortcuts for Greater Developers Productivity--reference
    binary heap
    Nginx vs Apache--reference
    【Java技术位】——代理模式及其事务包
  • 原文地址:https://www.cnblogs.com/android-er/p/5937182.html
Copyright © 2011-2022 走看看