找回密碼
 注冊帳號

掃一掃,訪問微社區

animation.synclayer 同步層

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

摘要: animation.synclayer 同步層functionsynclayer(layer: int) : voiddescription描述synchronizes playback speed of all animations in the layer.同步某層的動畫的播放速度。when blending between two looping anim ...

animation.synclayer 同步層

functionsynclayer(layer: int) : void

description描述

synchronizes playback speed of all animations in the layer.

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

when blending between two looping animations they often have different lengths. for example a walk cycle often takes longer than a run cycle. when blending between them you need to make sure that the foot placement of the walk and run cycle happens at the same time. in other word playback speed of the animations must be adjusted so that the animations are synchronized. synclayer will calculate the average normalized playback speed of all animations in the layer based on their blend weight. then it will apply that playback speed to all animations in the layer.

在混合兩個循環動畫的時候,他們通常有不同的長度。比如一個走路的動畫通常比一個跑步的動畫要長。當混合他們的時候,你需要確定走路和跑步動畫發生的時候腳的位置要在同一時間走動。換句話說,這兩個動畫播放速度要被調整一致,以便動畫的同步。synclayer函數將根據動畫的混合權重來計算同一層中動畫的平均正常播放速度。然后它會給同一層的所有動畫應用這個播放速度。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public void awake() {

animation["walk"].layer = 1;

animation["run"].layer = 1;

animation.synclayer(1);

}

}

// puts the walk and run animation in the same

// layer and synchronizes their speed

// 把walk和run動畫放到同一層,然后同步他們的速度。

animation["walk"].layer = 1;

animation["run"].layer = 1;

animation.synclayer(1);

文章點評
女校游泳队彩金 网络赚钱平台有哪些 山东群英会最大遗漏 黑龙江11选5带跨度 29选7开奖结果查询 河北十一选五前三遗 新疆体育彩票11选5开奖 河南快三万能倍率表 广东麻将* 体彩排五近100期 秒速赛车实力大平台 20选5开奖结果 av女优名 北京11选五怎么玩规则 马拉多纳意甲球队 每天签到赚钱的网站 31选714013开奖结果