Search Unity

Question Is there an option like "Destroy forever"

Discussion in 'Editor & General Support' started by mfatihbarut, Nov 28, 2022.

  1. mfatihbarut

    mfatihbarut

    Joined:
    Apr 11, 2018
    Posts:
    1,060
    Hi all,
    You know at the beginning of the game you show a message but you don't need it anymore for the rest of the game.
    On the other hand the conventional method is that to make a Playerpref and create a logic like this;
    if (Playerprefs.GetInt("ObjectToDestroy")==1 Destroy(ObjectToDestroy)
    But I don't want to check the prefs for this simple operation I just want it to disappear forever and don't bother me/player anymore.
    Is there a method for this?
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,911
    There is no method other than saving the data in a persistent place somewhere and deciding whether to instantiate or destroy or whatever with it.