void UpdateCube(BoxParameters box) { Vector3 size = new Vector3(box.width, box.height, box.depth); gameObject.transform.localScale = size; gameObject.GetComponent <Renderer>().material.color = box.color; }
//Update is called once per frame void Update() { Vector3 cuboPos = GameObject.Find ("Cubo").transform.position; ThatBox = GameObject.Find("Box1").GetComponent<Struct>().myParameters; gameObject.transform.position = new Vector3(cuboPos.x,ThatBox.height*0.5f, cuboPos.z); }
public void Load(SaveType _saveType) { switch (_saveType) { case SaveType.Local: boxParameters = saveManager.LoadFromFile("BoxParameters", new BoxParameters()); Debug.Log("Local: Loaded UserPrefs data = " + boxParameters.depth); break; case SaveType.UserPrefs: string boxData = PlayerPrefs.GetString("boxData"); boxParameters = JsonUtility.FromJson <BoxParameters> (boxData); Debug.Log("UserPrefs: Loaded UserPrefsData = " + boxParameters.height); break; } }
public void Save(SaveType _saveType, BoxParameters _boxParameters) { switch (_saveType) { case SaveType.Local: saveManager.SaveToFile(boxParameters, "BoxParameters"); Debug.Log("Local: Saved UserPrefs data = " + boxParameters.depth); break; case SaveType.UserPrefs: string boxData = JsonUtility.ToJson(_boxParameters); PlayerPrefs.SetString("boxData", boxData); Debug.Log("UserPrefs: Saved UserPrefs data = " + boxData); break; } }
public void UpdateCube(BoxParameters box) { Vector3 size = new Vector3(box.width, box.height, box.depth); gameObject.transform.localScale = size; //gameObject.GetComponent<Renderer>().material.color = box.color; }
// Update is called once per frame void Update() { ThatBox = GameObject.Find("Cube").GetComponent<Struct>().myParameters; gameObject.transform.position = new Vector3(0, ThatBox.height * 0.5f, -10); }
// Update is called once per frame void Update() { ThatBox = GameObject.Find("Cube").GetComponent <Struct>().myParameters; gameObject.transform.position = new Vector3(0, ThatBox.height * 0.5f, -10); }