找回密碼
 注冊帳號

掃一掃,訪問微社區

animation 動畫

2014-12-31 01:50| 發布者: 楊炎| 查看: 2287| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: animation 動畫inherits frombehaviour,ienumerablethe animation component is used to play back animations.animation組件用于播放動畫。you can assign animation clips to the animation component and control ...

animation 動畫

inherits frombehaviour,ienumerable

the animation component is used to play back animations.

animation組件用于播放動畫

you can assign animation clips to the animation component and control playback from your script. the animation system in unity is weight based and supports: animation blending, additive animations, animation mixing, layers and full control over all aspects of animation playback.

可以指定動畫剪輯到動畫組件并從腳本控制動畫播放。在unity的動畫系統基于權重并且支持動畫融合,疊加動畫,動畫混合,標簽和 完全控制動畫播放的各個方面。

to play a simple animation useanimation.play

to cross-fade between animations useanimation.crossfade

to change how animations wrap (loop, once, pingpong) change thewrapmodeof the respective animationclips in their import settings, oruse animationstate.wrapmodeto change it at runtime.

animationstatecan be used to change the layer of an animation, modify playback speed, and for direct control over blending and mixing.

如果想播放一個簡單的動畫,可以使用animation.play;

如果想在動畫之間交叉淡入,可以使用animation.crossfade;

如果想改變動畫模式(循環,一次,乒乓),可以改變動畫導入設置里面的動畫幀的wrapmode,或者在運行時改變animationstate.wrapmode的值;

animationstate可以用于改變動畫的層,修改播放速度,并且直接控制融合與混合。

animation also supports enumerators so you can loop through all animationstates like this:

動畫也支持枚舉,所以你可以像這樣在animationstates之間循環:

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public void awake() {

foreach (animationstatestate in animation) {

state.speed = 0.5f;

}

}

}

// make all animations in this character play at half speed

// 使這個角色的所有動畫的播放速度降為一半

for (var state :animationstatein animation) {

state.speed = 0.5;

}

variables變量

clip

the default animation.

默認的動畫剪輯。

playautomatically

should the default animation clip (animation.clip) automatically start playing on startup.

是否在開始的時候自動播放默認的動畫(animation.clip)。

wrapmode

how should time beyond the playback range of the clip be treated?

動畫剪輯播放完成之后,應該如何操作?

isplaying

are we playing any animations?

是否在播放任何動畫?

this [string name]

returns the animation state named name.

返回名稱為name的動畫狀態。

animatephysics

when turned on, animations will be executed in the physics loop. this is only useful in conjunction with kinematic rigidbodies.

如果打開這個選項,動畫會在物理循環過程中被執行。這個選項只有在結合運動學剛體的時候才有用。

animateonlyifvisible

when turned on, unity might stop animating if it thinks that the results of the animation won't be visible to the user.

如果打開這個選項,unity可能在它認為用戶不會看到當前動畫的時候停止播放。

cullingtype

controls culling of this animation component.

控制動畫組件的消隱。

localbounds

aabb of this animation animation component in local space.

在本地坐標空間這個動畫的動畫組件的aabb。

functions函數

stop

stops all playing animations that were started with this animation.

停止所有當前animation正在播放的動畫。

rewind

rewinds the animation named name.

倒播名稱為name的動畫。

sample

samples animations at the current state.

在當前狀態對動畫進行采樣。

isplaying

is the animation named name playing?

名為name的動畫正在播放嗎?

play

plays animation without any blending.

沒有任何混合的播放動畫。

crossfade

fades the animation with name animation in over a period of time seconds and fades other animations out.

在一定時間內淡入名稱為name的動畫并且淡出其他動畫。

blend

blends the animation named animation towards targetweight over the next time seconds.

在接下來的幾秒內混合名稱為name的動畫直到targetweight。

crossfadequeued

cross fades an animation after previous animations has finished playing.

在前一個動畫播放完成之后淡入淡出下一個動畫。

playqueued

plays an animation after previous animations has finished playing.

在前一個動畫播放完成之后直接播放下一個動畫。

addclip

adds a clip to the animation with name newname.

給動畫添加一個名稱為newname的動畫剪輯。

removeclip

remove clip from the animation list.

從動畫列表移除剪輯。

getclipcount

get the number of clips currently assigned to this animation

取得當前動畫的動畫剪輯數量。

synclayer

synchronizes playback speed of all animations in the layer.

同步某層的動畫的播放速度。

inherited members繼承成員

inherited variables繼承變量

enabled

enabled behaviours are updated, disabled behaviours are not.

啟用行為被更新,禁用行為不更新。

transform

thetransformattached to thisgameobject(null if there is none attached).

transform附加到gameobject(游戲物體)(如無附加則為空)。

rigidbody

therigidbodyattached to thisgameobject(null if there is none attached).

rigidbody附加到gameobject(游戲物體)(如無附加則為空)。

camera

thecameraattached to thisgameobject(null if there is none attached).

camera附加到gameobject(游戲物體)(如無附加則為空)。

light

thelightattached to thisgameobject(null if there is none attached).

light附加到gameobject(游戲物體)(如無附加則為空)。

animation

theanimationattached to thisgameobject(null if there is none attached).

animation附加到gameobject(游戲物體)(如無附加則為空)。

constantforce

theconstantforceattached to thisgameobject(null if there is none attached).

constantforce附加到gameobject(游戲物體)(如無附加則為空)。

renderer

therendererattached to thisgameobject(null if there is none attached).

renderer附加到gameobject(游戲物體)(如無附加則為空)。

audio

theaudiosourceattached to thisgameobject(null if there is none attached).

audiosource附加到gameobject(游戲物體)(如無附加則為空)。

guitext

theguitextattached to thisgameobject(null if there is none attached).

guitext附加到gameobject(游戲物體)(如無附加則為空)。

networkview

thenetworkviewattached to thisgameobject(read only). (null if there is none attached)

networkview附加到gameobject(游戲物體)(只讀)(如無附加則為空)。

guitexture

theguitextureattached to thisgameobject(read only). (null if there is none attached)

guitexture附加到gameobject(游戲物體)(只讀)(如無附加則為空)。

collider

thecolliderattached to thisgameobject(null if there is none attached).

collider附加到gameobject(游戲物體)(如無附加則為空)。

hingejoint

thehingejointattached to thisgameobject(null if there is none attached).

hingejoint附加到gameobject(游戲物體)(如無附加則為空)。

particleemitter

theparticleemitterattached to thisgameobject(null if there is none attached).

particleemitter附加到gameobject(游戲物體)(如無附加則為空)。

gameobject

the game object this component is attached to. a component is always attached to a game object.

組件附加的游戲物體。一個組件總是被附加到一個游戲物體。

tag

the tag of this game object.

游戲物體的標簽。

name

the name of the object. //物體的名字

hideflags

should the object be hidden, saved with the scene or modifiable by the user?

物體是否被隱藏、保存在場景中或被用戶修改?

文章點評
极速时时彩开奖最快的网站