Unity3D API整理1

本文详细介绍了Unity3D的几个核心API,包括AccelerationEvent、AnimationCurve、AnimationEvent和AnimationState,涉及关键变量、构造器、函数等。此外,还提及了Application类,提供对游戏运行时数据的访问,以及Color32和Color颜色结构体的使用。这些API是Unity3D开发中不可或缺的部分,理解它们有助于提升游戏开发效率。
摘要由CSDN通过智能技术生成

 

 

AccelerationEvent 加速度事件

AccelerationEvent.acceleration 加速度的值

AccelerationEvent.deltaTime 增量时间--------经过一段时间至最后加速度测量。

 

 

 

AnimationCurve动画曲线

An animation curve. Lets you addkeyframes and evaluate the curve at a given time.

动画曲线.让你在给定时间插入关键帧和数值的曲线.

A collection of curves form an AnimationClip.

曲线的集合组成动画剪辑(AnimationClip

Variables变量

·        keys

All keys defined in theanimation curve.

动画曲线中定义的所有键.

·        this[int index]

Retrieves the key at index(Read Only)

检索索引中的键.(只读)

·        length

The number of keys in thecurve (Read Only)

曲线中键的数量(只读)

·        preWrapMode

The behaviour of theanimation before the first keyframe

第一帧关键帧之前动画的行为

·        postWrapMode

The behaviour of theanimation after the last keyframe

最后一帧关键帧之后动画的行为

Constructors构造器

·        AnimationCurve

Creates an animation curvefrom arbitrary number of keyframes. 

根据任意数量的关键帧创建一个动画曲线.

Functions函数

·        Evaluate

Evaluate the curve at time.

曲线在某时刻的值

·        AddKey

Add a new key to the curve.

在曲线中加入一个键

·        MoveKey

Removes the keyframe at indexand inserts key.

删除索引处的关键帧并插入键

·        RemoveKey

Removes a key

删除一个键

·        SmoothTangents

Smooth the in and outtangents of the keyframe at index.

平滑索引处关键帧的切线

Class Functions类函数

·        Linear

A straight Line starting attimeStart, valueStart and ending at timeEnd, valueEnd

一条直线,开始于timeStart, valueStart 终止于 timeEnd, valueEnd

·        EaseInOut

An ease-in and out curvestarting at timeStart, valueStart and ending at timeEnd, valueEnd.

一个渐入渐出的曲线, 开始于timeStart, valueStart 终止于 timeEnd, valueEnd

 

 

 

AnimationEvent动画事件

AnimationEvent lets you call a scriptfunction similar to SendMessage as part of playing back an animation.

AnimationEvent类似于SendMessage让你调用一个脚本函数,这个脚本是动画播放的一部分

Animation events support functions thattake zero or one parameter. The parameter can be a float, a string, an objectreference, or an AnimationEvent.

动画事件支持没有或有一个参数的函数.参数可以是浮点型,字符串,引用对象或AnimationEvent

Variables变量

·        stringParameter

String parameter that isstored in the event and will be sent to the function.

字符串参数,保持在事件中并发送给函数

·        floatParameter

Float parameter that isstored in the event and will be sent to the function.

浮点型参数,保持在事件中并发送给函数

·        intParameter

int parameter that is storedin the event and will be sent to the function.

整型参数, 保持在事件中并发送给函数

·        objectReferenceParameter

Object reference parameterthat is stored in the event and will be sent to the function.

引用对象参数,保持在事件中并发送给函数

·        functionName

The name of the function thatwill be called.

欲调用的函数的名字

·        time

The time at which the eventwill be fired off.

引发该事件的时间

·        messageOptions

Function call options.

函数调用选项

·        animationState

The animation state thatfired this event (Read Only).

引发事件时的函数状态(只读)

Constructors构造器

·        AnimationEvent

Creates a new animation event

创建新的动画事件

 

 

 

 

AnimationState动画状态

Inherits fromTrackedReference

The AnimationState gives full controlover animation blending.

AnimationState完全控制动画混合。

In most cases the Animation interfaceis sufficient and easier to use. Use the AnimationState if you need fullcontrol over the animation blending any playback process.

多数情况下,Animation已经满足使用。如果你需要完全控制动画混合,可以使用AnimationState

The AnimationState interface allows youto modify speed, weight, time and layers while any animation is playing. Youcan also setup animation mixing and wrapMode.

播放动画时,AnimationState允许你修改速度,权值,时间和层。你也可以设置动画合成和wrapMode(循环模式)

The Animation

Variables变量

·        enabled

Enables / disables theanimation.

启动/禁止动画

·        weight

The weight of animation

动画的权重。

·        wrapMode

Wrapping mode of theanimation.

动画的循环模式

·        time

The current time of theanimation

动画当前时间

·        normalizedTime

The normalized time of theanimation.

动画当前规范化时间

·        speed

The playback speed of theanimation. 1 is normal playback speed.

动画的播放速度。1为正常速度。

·        normalizedSpeed

The normalized playback speed.

规范化播放速度。

·        length

The length of the animationclip in seconds.

动画剪辑的长度,单位是秒。

·        layer

The layer of the animation.When calculating the final blend weights, animations in higher layers will gettheir weights

动画层。计算混合权值时,较高层将优先获取权值。

·        clip

The clip that is being playedby this animation state.

此动画状态播放的剪辑。

·        name

The name of the animation

动画的名字

·        blendMode

Which blend mode should beused?

使用哪种混合模式?

Functions函数

·        AddMixingTransform

Adds a transform which shouldbe animated. This allows you to reduce the number of animations you have tocreate.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值