private void Start() { //Make MenuManager accessible from any script Instance = this; backgroundPos = backgroundImage.GetComponent <Transform>(); CharacterDB mCharacterDB = new CharacterDB(); mCharacterDB.deleteAllData(); mCharacterDB.close(); }
public void SaveCharacter() { //GameObject character = new GameObject(); if (DropdownMenu.Instance.genVal == 0) { try { //character = GameObject.Find("Canvas/FemaleCharacter"); Debug.Log("Female Character successfully found"); //Debug.Log(DropdownMenu.Instance.typeVal + hairVal + skinVal + eyeVal + outfitVal); CharacterDB mCharacterDB = new CharacterDB(); //mCharacterDB.deleteAllData(); mCharacterDB.addData(new CharacterData("0", DropdownMenu.Instance.typeVal, DropdownMenu.Instance.genVal, hairVal, skinVal, eyeVal, outfitVal)); mCharacterDB.close(); } catch { Debug.Log("Female Character not found"); } } else if (DropdownMenu.Instance.genVal == 1) { try { //character = GameObject.Find("Canvas/MaleCharacter"); Debug.Log("Male Character successfully found"); //Debug.Log(DropdownMenu.Instance.typeVal + hairVal + skinVal + eyeVal + outfitVal); CharacterDB mCharacterDB = new CharacterDB(); //mCharacterDB.deleteAllData(); mCharacterDB.addData(new CharacterData("0", typeVal, DropdownMenu.Instance.genVal, hairVal, skinVal, eyeVal, outfitVal)); mCharacterDB.close(); } catch { Debug.Log("Male Character not found"); } } SceneManager.LoadScene("ARSection"); }