Hello
I’m toying around with a class called turbine and, say i wanna make different turbine models, and edit the values of those from the editor. I’ve managed to figure out a solution like in the code, but somehow the values i give doesn’t stick once i run the program/script. it seems that the values return to zero/default when i run.
Initially i just wanted to make it a struct, but i read something about those not being able to being set from the editor. If anyone can provide a workaround for this it would be appreciated.
using UnityEngine;
using System.Collections;
//using System.Serializable;
public class turbines : MonoBehaviour {
[System.Serializable]
public class turbine{
public string model;
public int lifetime;
public float height;
public int ratedWind;
public int cutinWind;
public int cutoutWind;
}
/*
public struct turbine{
public string model;
public int lifetime;
public float height;
public int ratedWind;
public int cutinWind;
public int cutoutWind;
}*/
public turbine V10018MW;
// Use this for initialization
void Start () {
V10018MW = new turbine();
Debug.Log(V10018MW);
}
// Update is called once per frame
void Update () {
}
}