Search Unity

2d array lose value

Discussion in 'Scripting' started by KimIns, May 29, 2015.

  1. KimIns

    KimIns

    Joined:
    May 13, 2014
    Posts:
    6
    hi.
    Scene have one GameObject.
    and GameObject have ASciprt Component. and ASciprt have 2d Array.

    and i initialize 2d array like this "int[,] a = new int[5,5]; " in AScript.
    BSciprt inherited editor have this code " void asdf(){AScript.getinstacne.a[0,1] = 3}" and i call "asdf" function on custom inspector

    when i play game in unity editor, 2d array lose value. how to keep value of 2d array?

    sorry for my english
     
    Last edited: May 29, 2015
  2. Duugu

    Duugu

    Joined:
    May 23, 2015
    Posts:
    241
    I guess this woun't be answered without seeing your full code. Please post both scripts.