Example #1
0
 public void DisapperAndDestory()
 {
     animator.Dying   = true;
     animator.OnDied += (object sender, EventArgs e) =>
     {
         OnDestory?.Invoke(this, null);
     };
 }
Example #2
0
    private void DestoryObject()
    {
        //TODO: Use GC

        /*
         * if (actionController != null)
         * {
         *  //actionController.ClearCurrent();
         *  actionController.AddAction(stop);
         *  _mainCollider.enabled = true;
         * }
         * GCManager.Destory(GCKey, gameObject);*/

        OnDestory?.Invoke(dataIndex);
        Destroy(gameObject);
        Destroy(actionController);
        this.enabled = false;
    }