- Home /
Question by
montblack · Sep 09, 2011 at 04:06 AM ·
serializableworkdoesntunity3.4
Serializable doesnt work
i got this c# class on unity
using UnityEngine;
using System.Collections;
[System.Serializable]
public class test
{
public int x;
public int y;
}
and serializable doesnt work ¿why? i got unity 3.4
Comment
Can you show us the script in which you actually use the "test" class?
using UnityEngine;
using System.Collections;
[System.Serializable]
public class test
{
public int x;
public int y;
}
public class pruebas : $$anonymous$$onoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
If this is used ... the editor should set this value yes ? if you change it ? I have a very similar problem where this value keeps defaulting back to 0 when I press play, even though I am setting it in the editor ?
Best Answer
Answer by GuyTidhar · Sep 09, 2011 at 06:32 AM
using UnityEngine;
using System.Collections;
[System.Serializable]
public class test
{
public int x;
public int y;
}
public class pruebas : MonoBehaviour {
public test myTestVar1; // This will be shown in the editor
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
Your answer
Follow this Question
Related Questions
Mac standalone doesn't open 0 Answers
Simple Collision with children of other GameObject doesnt work 1 Answer
Android back button not working 2 Answers
Network functions doesn't work 0 Answers
Problem with Animator 2 Answers