• 14-01-2021, 18:00:54
    #1
    [Serializable]
    public class UserJSON
    {
    public string name;
    public float[] position;
    public float[] rotation;
    public int health;

    public static UserJSON CreateFromJSON(string data)
    {
    return JsonUtility.FromJson<UserJSON>(data);
    }
    }
    Seklinde bir kodu inceliyorum userJason un static olmaması neyi değiştirir.
    Postion ve rotation degerleri degişebilen degerler static olması bir hata değil mi
  • 14-01-2021, 19:05:40
    #2
    class static değil clasın içerisindeki metod static yani sistem başlatıldığında doğrudan erişilebilir
    UserJson uj = UserJSON.createfromjson(data)
    Jsonutility classı newleyere(bellekte yeni indis oluşturarak) geri döndürür
    Bu demektirki içerisindeki property gelen dataya göre şekillenir ve static değildir