Ejemplo n.º 1
0
    public override void Init()
    {
        GameObject prefab = ActorMananger.Instance().GetPrefab("Effect/" + EffectPrefabName);

        _instance = GameObject.Instantiate(prefab);

        if (Target != null)
        {
            Target.AddChild(_instance);
        }

        animator = _instance.GetComponentInChildren <Animator>();

        animator.Play("hit");

        AnimatorClipInfo[] clipInfo = animator.GetCurrentAnimatorClipInfo(0);

        _time = clipInfo[0].clip.length;
    }