-
Notifications
You must be signed in to change notification settings - Fork 2
Component
DucNV_2000 edited this page Jul 16, 2024
·
2 revisions
- Some components support
- Play animation by
Animancer
void PlayAnim(ClipTransition clip, Action _endAnim = null, float _durationFade = .2f, FadeMode mode = default)
PauseClip
void PauseClip(ClipTransition clip)
PauseAll
void PauseAll()
StopClip
void StopClip(ClipTransition clip)
StopAll
void StopAll()
- Example
private HandleAnimancerComponent handleAnimancerComponent;
public ClipTransition animIdle;
public void PlayAnimIdle()
{
handleAnimancerComponent.PlayAnim(animIdle);
}
public void PauseAnimIde()
{
handleAnimancerComponent.PauseClip(animIdle);
}
public void PauseAllAnim()
{
handleAnimancerComponent.PauseAll();
}
public void StopIdle()
{
handleAnimancerComponent.StopClip(animIdle);
}
public void StopAllAnim()
{
handleAnimancerComponent.StopAll();
}
-
Init
before use
void Init()
Initialize
void Initialize(bool reload = false)
ChangeAnimationName
void ChangeAnimationName(string animationName)
-
FlipX
&FlipY
void FlipX(bool isFlipX = false)
void FlipY(bool isFlipY = false)
ChangeDataAsset
void ChangeDataAsset(SkeletonDataAsset dataAsset);
AddAnimation
void AddAnimation(int trackIndex, string animationName, bool loop, float timeDelay = 0)
PlayAnimation
async UniTask<TrackEntry> PlayAnimation(int trackIndex, string animationName, bool loop = false, float speed = 1)
RegisterEvent
void RegisterEvent(string eventName, Action actionEvent = null)
StopAnimation
void StopAnimation()
-
Init
before use
void Init()
-
MixSkin
Add more skin to the current skin
void MixSkin(string mixSkinName)
void MixSkin(List<string> listMixSkinName)
-
MixNewSkin
Create a new skin then setup
void MixNewSkin(string mixSkinName)
void MixNewSkin(List<string> listMixSkinName)
-
SetSkin
Setup a new skin
void SetSkin(string skinName)
- Auto loop bounce
- Support buoyancy in 2D and 3D
- Support appear when
OnEnable()
- Support loop zoom in out when
OnEnable()
- Support move by point
- Move on awake
- Stop Move
void StopMoving()
- Resume move
void ResumeMoving()
- Support rotate when awake
- Rotate along the x, y or z axis
- Reverse rotation
- Support get time remaining
-
InitTargetTime
after use
void InitTargetTime() // Use the value input from the inspector to init
void InitTargetTime(int year, int month, int day, int hour, int minute, int second)
GetTimeRemaining
TimeSpan GetTimeRemaining()
- Support this game object follow to the target game object
- Follow types including: SetPosition, Lerp, SmoothDamp
- Follow direction included: XYZ, XY, XZ, YZ, X, Y, Z