Exemplo n.º 1
0
 void Start()
 {
     if (!instance)
     {
         instance = this;
     }
 }
Exemplo n.º 2
0
 public BaseRecycler(CreateHandler createHandler, CheckValidHandler checkValidHandler, ResetHandler resetHandler, DestroyHandler destroyHandler)
 {
     items               = new QueuedList <T>();
     OnCreateHandler     = createHandler;
     OnCheckValidHandler = checkValidHandler;
     OnResetHandler      = resetHandler;
     OnDestroyHandler    = destroyHandler;
 }
Exemplo n.º 3
0
    public void DestroyItemInInventory(ItemInstance item)
    {
        if (items.Contains(item))
        {
            RemoveItem(item);

            DestroyHandler DestroyHandler = item.GetComponent <DestroyHandler>();
            if (DestroyHandler != null)
            {
                DestroyHandler.DestroySelf();
            }
            else
            {
                GameObject.Destroy(item.gameObject);
            }
        }
    }
Exemplo n.º 4
0
 public void SetParam(DestroyHandler callback, string combieParam)
 {
     CallBack_    = callback;
     combieParam_ = combieParam;
 }
Exemplo n.º 5
0
 public void RegisterDestroyHandler(DestroyHandler handler)
 {
     PostDestroy += handler;
 }
Exemplo n.º 6
0
 private void OnDestroy()
 {
     DestroyHandler?.Invoke();
 }
Exemplo n.º 7
0
 protected virtual void OnDestroy()
 {
     DestroyHandler?.Invoke();
 }