Beispiel #1
0
 public void DisapperAndDestory()
 {
     animator.Dying   = true;
     animator.OnDied += (object sender, EventArgs e) =>
     {
         OnDestory?.Invoke(this, null);
     };
 }
    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;
    }