现在的位置: 首页 > 综合 > 正文

POCKET RPG WEAPON TRAILS(for Unity3D)武器拖尾插件

2013年06月03日 ⁄ 综合 ⁄ 共 2853字 ⁄ 字号 评论关闭

There are two scripts required to get Pocket RPG Weapon Trails working.

要使武器拖尾运作需要两个脚本。

WeaponTrail.cs

AnimationController.cs

You will also need another script that calls AnimationController and WeaponTrails and controls their behavior. In the example scene this is BladeMaster,cs (Please look at this script)

你还需要其他脚本调用动画控制和武器拖尾效果并进行行为控制。在示例中使用了BladeMaster.cs(请注意一下这个脚本)

Please look in the example scene: "Blade Master Example".

请看一下示例场景:"Blade Master Example.unity"

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

WeaponTrails.cs :

This script must be attached to the transform from which you want draw the trail. It also needs a MeshRenderer with a trail type material on it (like in the example scene).

这个脚本必须被附加到你要绘制拖尾的transform对象上。他需要一个拥有一个拖尾类型的材质的MeshRenderer(就像示例场景中一样)。

Calling StartTrail(float timeToTweenTo, float fadeInTime) andFadeOut(float fadeTime) will fade in and fade out the trail respectively.

调用StartTrail(float timeToTweenTo, float fadeInTime)
FadeOut(float fadeTime)将分别淡入淡出拖尾效果。

Calling SetTime(float trailTime, float timeToTweenTo, float tweenSpeed)can change the length of the trail instantly, giving you a little more control.

调用SetTime(float trailTime, float timeToTweenTo, float tweenSpeed)可以立即改变拖尾的长度,让你进行更多的控制。

The WeaponTrail can be built by calling Itterate(float itterateTime) andUpdateTrail(float currentTime, float deltaTime). These functions are called by AnimationController,
however if you don't want to use AnimationController you can call these yourself.

武器拖尾的创建可以调用Itterate(float itterateTime)UpdateTrail(float currentTime, float deltaTime)。这些函数可以被AnimationController调用,如果你不想使用AnimationController你可以自己调用。

(Like in the Unity Line Renderer the "time" variable of the WeaponTrail determines the length of the trail in seconds.)

就像Unity线性渲染器一样,武器拖尾变量"time" 按秒决定了拖尾的长度。

AnimationController.cs :

You don't have to use AnimationController to build the trail, but if you want trails smoother than the framerate then AnimationController is necessary.

你可以不使用AnimationController进行创建拖尾,但是如果你想要使拖尾比帧速率光滑 AnimationController脚本还是必要的。

IF YOU USE ANIMATION CONTROLLER YOU CANNOT USE THE BUILT IN ANIMATION COMPONENT TO PLAY ANIMATIONS. THEY WILL CONFLICT WITH EACH OTHER. PLEASE LOOK AT THE EXAMPLE.

如果你使用AnimationController你将不能使用内置动画组件来播放动画。他们会互相冲突,请查看示例。

AnimationController reproduces the animation playing functionality of the built-in Unity Animation component. It samples the animation at 300 fps by default (though this can be adjusted).

AnimationController从Unity内置动画组件中复制动画播放功能。其帧速率为300fps(可调整)。

To play animations use PlayAnimation (AnimationState state).

播放动画使用PlayAnimation (AnimationState state).

To crossfade into an animation use
CrossfadeAnimation (AnimationState state, float fadeTime)
.

动画的交叉渐变使用CrossfadeAnimation (AnimationState state, float fadeTime).

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

PocketRPG Weapon Trails is written by Evan Greenwood (of Free Lives) for the game PocketRPG by Tasty Poison Games.

ALL CODE IN THIS PACKAGE IS PROVIDED AS IS. IT IS ALSO PROVIDED FOR FREE. SADLY I HAVE AN INCREDIBLY BUSY DAY JOB, I SIMPLY HAVE NO TIME TO REPLY TO MESSAGES ABOUT THIS.

I hope you enjoy it and make great weapon slicing games!

抱歉!评论已关闭.