|
资源信息 Asset Information
资源名称: | TouchAnimation触摸动画源码 (发帖教程) |
版本: | 无 (版本) |
资源等级: | 1 |
资源格式: | .rar (链接失效请点击帖子右下方举报通知管理员) |
资源大小: | 1MB (默认:MB) |
下载地址: | 站内下载 (购买积分) |
[code=javascript]var hit : RaycastHit;
function Update () {
// Use Raycast to pick objects that have mesh colliders attached.
var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
if (Input.GetMouseButtonDown (0)) //Returns true during the frame the user touches the object
{
if (Physics.Raycast (ray, hit, 100))
{
animation.Play("forward");
}
}
if (Input.GetMouseButtonUp (0)) //Returns true during the frame the user deselects the object
{
if (Physics.Raycast (ray, hit, 100))
{
animation.Play("backward");
}
}
else {
}
}
[/code]
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|