Skip to content

Component

DucNV_2000 edited this page Jul 16, 2024 · 2 revisions

What

  • Some components support

Component

HandleAnimancerComponent

  • 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();
    }

AnimatorSkeletonComponent & AnimatorSkeletonUIComponent

  • 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()

SkinSkeletonComponent & SkinSkeletonUIComponent

  • 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)

BounceComponent

  • Auto loop bounce

Buoyancy2DComponent & BuoyancyComponent

  • Support buoyancy in 2D and 3D

EffectAppearComponent

  • Support appear when OnEnable()

EffectZoomInOutComponent

  • Support loop zoom in out when OnEnable()

MoveComponent

  • Support move by point
  • Move on awake
  • Stop Move
void StopMoving()
  • Resume move
void ResumeMoving()

RotateComponent

  • Support rotate when awake
  • Rotate along the x, y or z axis
  • Reverse rotation

TimeRemainingComponent

  • 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()

FollowTargetComponent

  • 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