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 ...
随机推荐
- PostgreSQL源码安装文档
This document describes the installation of PostgreSQL using the source code distribution. (If yo ...
- Zend 缓存
一. Zend Optimizer 和 Zend Guard Loader 作用和区别 两者的功能一样. Zend Optimizer 在PHP5.3以前的版本使用,解密和代码优化,提高PHP应用程序 ...
- 2016年蓝桥杯省赛A组c++第2题(暴力求解)
/* 某君从某年开始每年都举办一次生日party,并且每次都要吹熄与年龄相同根数的蜡烛. 现在算起来,他一共吹熄了236根蜡烛. 请问,他从多少岁开始过生日party的? 请填写他开始过生日party ...
- Flink - ResultPartition
发送数据一般通过,collector.collect public interface Collector<T> { /** * Emits a record. * * @param re ...
- Ollydbg
1.用来查看dll文件的信息,取代现在使用的exescope;
- ms sql server 游标
很简单的一个小例子. /****** Object: StoredProcedure [dbo].[usp_test] Script Date: 10/28/2016 15:08:31 ******/ ...
- postgre
切换用户:su postgres 启动:psql 查看有哪些数据库: \l 切换到数据库air: \c air 列出数据库中所有表: \d 列出指定表的所有字段信息: \d+ dag 或者 \d da ...
- java之String类在堆栈存储机制
String类是一个比较特殊的类,最主要的体现是它有多种创建形式,例如,String a ="abc";Sting a=new("abc");表面上看得到的结果 ...
- 敏捷开发之Scrum扫盲篇(转)
现在敏捷开发是越来越火了,人人都在谈敏捷,人人都在学习Scrum和XP... 为了不落后于他人,我也开始学习Scrum.今天主要是对我最近阅读的相关资料,根据自己的理解,用自己的语言来描述Scrum中 ...
- 第 7 章 Data 类型
目录 第 7 章 Data 类型 一.创建方式 二.转时间戳 其他 第 7 章 Data 类型 @(es5) 参考了: 阮一峰javascript的标准.<javascript高级教程> ...