• unity 控制一个盒子移动代码


    //个人原创转载请声明转载自http://www.cnblogs.com/suxsho

    var
    target : Transform; var smoothTime : float; private var velocity = Vector3.zero; var x = 10; var fireRate : float = 0.0; private var nextFire : float = 0.0; var postrue : boolean = false; function Update () { target.position.y = x; //TIME if (Time.time > nextFire) { nextFire = Time.time + fireRate; postrue = true; } //MOVE if (postrue) { smoothTime = 0.05; //Random.value; fireRate = 0.15; //Random.Range(0.1,0.5); x *= -1; postrue = false; } transform.position = Vector3.SmoothDamp(transform.position, target.position, velocity, smoothTime); print (smoothTime); }
  • 相关阅读:
    2.13 day 10
    2.12 day9
    Mongo基础知识
    给mongodb设置密码
    前端框架
    SecureCRT的一些设置
    node 服务器框架
    python 知识博客
    数据库记录
    有用的网站
  • 原文地址:https://www.cnblogs.com/suxsho/p/3008305.html
Copyright © 2020-2023  润新知