zoukankan      html  css  js  c++  java
  • UGUI&&Animator模块知识点随记

    1.Render Texture,把这个赋给摄像机,这个对象就保存了摄像机拍摄到的纹理,再把他赋给Raw Image。

    2.给Button添加事件关联时,函数不能带有yield WaitForSeconds (waitTime);(js)必须使用协程

    function OnMouseDown(waitTime:float) {
    yield WaitForSeconds (waitTime);}
    StartCoroutine(OnMouseDown(0.35));
    

    3.Input.GetKey(KeyCode.Q))与Input.GetKeyDown(KeyCode.Escape)

    4.Mathf.Lerp. lerp差值  transform.position.x = Mathf.Lerp(min:float,max:float,(Time.time - i:float)*speed);数学差值函数。

    5.创建一个空物体如果他的Scale,x=0,y=0,那么这个物体的子物体改变子物体的position,他的位置也不会改变。

    6.animation组件和animator组件的区别,,animator是动画状态机,animation是它子集。

    7.animator的trigger变量。a.animator.settrigger("name");执行时为真,下一句自动为假。

    8.状态树动画转换控制,,float h = Input.GetAxis("Horizontal"); float DirectionDampTime = 0.25; animator.SetFloat("Direction",h,DirectionDampTime,Time.deltaTime);  前跑,左跑,右跑转换。

    9.截图功能:if(Input.GetKey(KeyCode.P)&&Input.GetKey(KeyCode.LeftControl)){Application.captureScreenshot("Screenshot.png");}

    10.五种坐标系。c#中[DllImport("user32.dll")]

    屏幕坐标和像素视口坐标Z值体现的是与摄像机中心距离的远近。

    11.全屏。Screen.fullScreen = !Screen.fullScreen;

    12.锁定鼠标。Screen.lockCursor = ture;

    13.Switch to 800×600 windowed,切换到,,,,Screen.SetResolution(800,600,false),false代表非全屏。

    14.var ScreenPos:Vector3 = camera.WorldToScreenPoint(cube.position);世界坐标转屏幕坐标。

    15.var World:Vector3 = camera.ScreenToWorldPoint(Input.mousePosition);

    16.var ViewportPos:Vector3 = camera.ScreenToViewportPoint(Input.mousePosition);

    17.var World:Vector3 = camera.ViewportToWorldPoint(Vector3(0.5,0.5,0.4));

    18.光线投射,从摄像机投到屏幕中心

    var p1: Vector3 = new Vector3(-0.86,0.38,-2.05);
    Instantiate(sp,p1,transform.rotation);
    var ray: Ray = camera.ViewportPointToRay(Vector3(0.5,0.5,0));
    var hit: RaycastHit;
    //发射光线
    if (Physics.Raycast(ray,hit)){
        wz.text = "I am looking at"+hit.transform.name;}
    else
        wz,text = "I am looking at noting";
    

     19.小岛游戏存档功能使得charge数组指针超出了范围,但是游戏里没有体现具体的异常。

  • 相关阅读:
    用移动硬盘代替DVD安装单系统Vista方法
    背完这444句,你的口语绝对不成问题了
    DataGridView 只能输入整数解决方案
    转载:Firefox的失败在中国几乎就是命中注定
    ZBlog 添加运行天数
    并行和串行通信
    ZBlog 添加收藏本站
    ITPUB调查高达42%的DBA由开发人员转变而成
    DataGridView 只能输入整数解决方案
    用移动硬盘代替DVD安装单系统Vista方法
  • 原文地址:https://www.cnblogs.com/white-L/p/6204215.html
Copyright © 2011-2022 走看看