animation 老动画
关于设置跳跃:
using System.Collections;
using System.Collections.Generic;
using UnityEngine; public class PeopleAnimation : MonoBehaviour {
Animation ani;
float speed = ;
bool IsGround = false;
bool Isother = true;
// Use this for initialization
void Start () {
ani = GetComponent<Animation>();
ani.Play("idle");
} // Update is called once per frame
void Update () {
float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical"); if (h!=||v!=)
{
if (Input.GetKey(KeyCode.LeftShift))
{
if (IsGround)
{
ani.Play("run");
}
speed = ;
}
else
{
speed = ;
if (IsGround)
{
ani.Play("walk");
} }
}
else
{
if (IsGround)
{
ani.Play("idle"); }
}
if (v>)
{
transform.localScale = Vector3.one;
}
if (v<)
{
transform.localScale = new Vector3(,,-);
}
transform.Translate(,,v*Time.deltaTime*speed);
transform.Rotate(,h,);
if (IsGround)
{
if (Input.GetButtonDown("Jump"))
{ GetComponent<Rigidbody>().AddForce(,,);
ani.Play("jump");
IsGround = false;
//Invoke("Jump",1.25f);
}
}
}
//public void Jump()
//{ // Isother = true; //}
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.name == "Plane")
{
IsGround = true;
Isother = true;
} }
}
animation 老动画的更多相关文章
- iOS开发基础知识:Core Animation(核心动画)
Core Animation,中文翻译为核心动画,它是一组非常强大的动画处理API,使用它能做出非常炫丽的动画效果,而且往往是事半功倍.也就是说,使用少量的代码就可以实现非常强大的功能. Core A ...
- Android动画总结#补间动画(Tween Animation/View Animation) #帧动画(Frame Animation/Drawable Animation)#属性动画(PropertyAnimation)
1.共有三种动画,英文名字多种叫法如下 第一种动画:补间动画(Tween Animation/View Animation) 四个:RotateAnimation旋转. AlphaAnimation透 ...
- Android Property Animation 物业动画
效果图: Property Animation介绍: 出生在sdk3.0,是利用了View所拥有的属性,进行一系列的操作. 比方一个View有什么样的setAbc的属性,那么理论上就能够设置它. ...
- iOS - Core Animation 核心动画
1.UIView 动画 具体讲解见 iOS - UIView 动画 2.UIImageView 动画 具体讲解见 iOS - UIImageView 动画 3.CADisplayLink 定时器 具体 ...
- transition和animation做动画(css动画二)
前言:这是笔者学习之后自己的理解与整理.如果有错误或者疑问的地方,请大家指正,我会持续更新! translate:平移:是transform的一个属性: transform:变形:是一个静态属性,可以 ...
- iOS开发 - Core Animation 核心动画
Core Animation Core Animation.中文翻译为核心动画,它是一组很强大的动画处理API,使用它能做出很炫丽的动画效果.并且往往是事半功倍. 也就是说,使用少量的代码就能够实现很 ...
- iOS - Core Animation(核心动画)
Core Animation,中文翻译为核心动画,它是一组非常强大的动画处理API,使用它能做出非常炫丽的动画效果,而且往往是事半功倍.也就是说,使用少量的代码就可以实现非常强大的功能.Core An ...
- Unity3D学习笔记(十四):Animation旧动画
animator(新动画系统):骨骼动画,骨骼驱动,格式化编辑,动画机图形化 animation(旧动画系统):物理系统,帧动画 一.如何建立动画文件 Animation Clip 手动添加动 ...
- CSS3 animation(动画) 属性
一.animation 1.CSS3 animation(动画) 属性 语法: animation: name duration timing-function delay iteration-cou ...
随机推荐
- [troubleshoot][archliunx][chromium][flash] chrome提示flash不是最新
最近chrome总是在提示flash不是最新要求更新. 原来以前用的flash包 chromium-pepper-flash 不见了,改名变成了pepper-flash. /home/tong [to ...
- day1_接口测试基础
一.什么是接口: 接口:一般分为两种,程序内部接口和程序对外接口 系统对外接口:系统与外部沟通,比如我们平时用的app,网站进行数据处理的时候都是通过接口调用后端服务器的数据. 程序内部接口:程序内部 ...
- Matplotlib 简单的使用
Matplotlib是一个Python 2D绘图库, 只需几行代码即可生成绘图,直方图,功率谱,条形图,错误图,散点图等. 有关示例,请参阅示例图和缩 import matplotlib.pyplot ...
- kubernetes的Kubelet
1. kubelet简介 在kubernetes集群中,每个Node节点都会启动kubelet进程,用来处理Master节点下发到本节点的任务,管理Pod和其中的容器.kubelet会在API Ser ...
- 网页制作中规范使用DIV+CSS命名规则,可以改善优化功效特别是团队合作时候可以提供合作制作效率,具体DIV CSS命名规则CSS命名大全内容如下:
页头:header 如:#header{属性:属性值;}或.header{属性:属性值;},也许你需要了解class与id区别及用法登录条:loginBar 标志:logo ...
- rsyncd的配置和使用
服务器端配置文件说明 # /etc/rsyncd: configuration file for rsync daemon mode # See rsyncd.conf man page for mo ...
- Mysql安装方法介绍
MySQL的yum安装方法 centos7默认不再使用mysql而是用mariadb来代替mysql [root@yxh6 ~]# yum install mysql-server 已加载插件:fas ...
- PowerTCP FTP for .NET 在线e文文档
http://www.dart.com/help/ptftpnet/webframe.html
- 【剑指offer】把数组排成最小的数
一.题目: 输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个.例如输入数组{3,32,321},则打印出这三个数字能排成的最小数字为321323. 二.思路: ...
- component 理解
1: sap中的component理解 component分为 genil component 和ui component component相当于整个应用中某一小块的前台/后台所有的东西都包括进去. ...