Esempio n. 1
0
 private void InitAttr()
 {
     _attr = new XHitAttribute(_entity.EntityTransfer,
                               _anim.OverideControllder,
                               _anim.Ator,
                               _entity.present);
 }
Esempio n. 2
0
    IEnumerator Start()
    {
        yield return(new WaitForSeconds(0.4f));

        var present = XTableMgr.GetTable <XEntityPresentation>().GetItemID((uint)PresentID);

        var contr = new AnimatorOverrideController();
        var ator  = GetComponent <Animator>();

        contr.runtimeAnimatorController = ator.runtimeAnimatorController;
        ator.runtimeAnimatorController  = contr;

        AnimationClip clip = XResources.Load <AnimationClip>("Animation/" + present.AnimLocation + present.AttackIdle, AssetType.Anim);

        contr[Clip.Idle]       = clip;
        contr[Clip.HitLanding] = present.HitFly != null && present.HitFly.Length == 0 ? null : XResources.Load <AnimationClip>("Animation/" + present.AnimLocation + present.HitFly[1], AssetType.Anim);

        _attr = new XHitAttribute(transform, contr, ator, present);
    }