Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Caching Problem with JS File Variables

Discussion in 'Scripting' started by uwi2k2, Oct 13, 2014.

  1. uwi2k2

    uwi2k2

    Joined:
    Oct 13, 2014
    Posts:
    1
    hi there,

    i just started with unity and love it !
    but now with my first scripts i have a strange problem.

    I made a Array of my own chunk class like this:
    @HideInInspector var chunk: Chunk[]= new Chunk[9];

    than i realiyed i need more lements in the array:
    @HideInInspector var chunk: Chunk[]= new Chunk[12];

    but whatever i do it stazs with the initial 9 elements.
    I cleard cache in mono but nothing helps ...

    what do i need to do

    thanx
    uwi2k2
     
  2. Diablo404

    Diablo404

    Joined:
    Mar 15, 2013
    Posts:
    136
    try to make it private like : private var chunk: Chunk[]= new Chunk[12];

    Save, Go to Editor. Wait For Unity validating script. Go Back to your script. And then switch back to non-private
     
  3. Magiichan

    Magiichan

    Joined:
    Jan 5, 2014
    Posts:
    403
    This, or reset the script on the gameObject.
     
  4. Diablo404

    Diablo404

    Joined:
    Mar 15, 2013
    Posts:
    136
    I didn't know about this one! Thanks for sharing @Magiichan !