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 ...
随机推荐
- hbase运行mapreduce设置及基本数据加载方法
hbase与mapreduce集成后,运行mapreduce程序,同时需要mapreduce jar和hbase jar文件的支持,这时我们需要通过特殊设置使任务可以同时读取到hadoop jar和h ...
- 课程信息管理系统(javabean + Servlet + jsp)
此项目做的事一个课程管理系统,需要通过web做一个可以实现课程的增删改查的功能. 需要用到数据库,Servlet和jsp等(第一次使用Servlet和数据库连接,所以代码都比较低级,页面也比较粗糙,还 ...
- Runloop的再学习之浅析(一)
一,认识RunLoop 我的理解: 1. 在编程的世界里,万物皆对象.所以RunLoop 实际上也是一个对象,这个对象管理了其需要 处理的事件和消息,并提供了一个入口函数来执行上面 Event Loo ...
- [性能优化] perf 高级用法:完整记录程序性能指标,并按照时间段对程序进行有针对性的性能分析
如题: 假设你已经熟悉了基本用法,知道perf是干嘛的,以及会用 perf top [性能优化] perf 背景:目标程序在运行的某时间段内会出现性能下降,需要了解这个时间内,程序发生了什么. 方法: ...
- [daily][archlinux][btrfs][mysql] 在btrfs上使用mariadb
在btrfs上使用mariadb的时候,需要注意关闭btrfs的Copy on Write (/var/lib/mysql目录) 如下: ┬─[tong@T7:~/Data/anthropoid]─[ ...
- XML文件处理
XML XML简介 XML被设计用来传输和存储数据. XML是可扩展标记语言. 解析XML的几种方式 DOM,DOM4j------先把XML文件读取到内存中,然后再解析 SAX----------边 ...
- 转:string.Format格式化用法
String.format()方法使用说明(比较详细) 地址:https://blog.csdn.net/thc1987/article/details/17528093 典型案例 原文地址:http ...
- LeetCode 283 Move Zeroes 解题报告
题目要求 Given an array nums, write a function to move all 0's to the end of it while maintaining the re ...
- 【PyQt5-Qt Designer】窗口操作
1.窗口最上栏最大化 最小化 关闭按钮显示 #设置最小化与最大化按钮 self.setWindowFlags(QtCore.Qt.Window) 将其添加到Ui_*** 布局代码中即可 2.窗口知识 ...
- python server
#!/usr/bin/env python #coding=utf-8 # modifyDate: 20120808 ~ 20120810 # 原作者为:bones7456, http://li2z. ...