// Use this for initialization void Start() { GameObject player = GameObject.FindGameObjectWithTag("Player"); playerscript = player.GetComponent(typeof(PlayerController)) as PlayerController; spells = player.GetComponent(typeof(Spells)) as Spells; talents = player.GetComponent (typeof(PlayerTalents)) as PlayerTalents; tagx = gameObject.transform.tag; }
// Use this for initialization void Start() { GameObject player = GameObject.FindGameObjectWithTag("Player"); playerscript = player.GetComponent(typeof(PlayerController)) as PlayerController; spells = player.GetComponent(typeof(Spells)) as Spells; talents = player.GetComponent(typeof(PlayerTalents)) as PlayerTalents; tagx = gameObject.transform.tag; }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } }
// Use this for initialization void Start() { GameObject player = GameObject.FindGameObjectWithTag("Player"); GameObject souls = GameObject.Find("EnergyCluster(Clone)"); playerscript = player.GetComponent(typeof(PlayerController)) as PlayerController; spells = player.GetComponent(typeof(Spells)) as Spells; talents = player.GetComponent(typeof(PlayerTalents)) as PlayerTalents; Items other = player.GetComponent(typeof(Items)) as Items; SaveData data = new SaveData("" + playerscript.savefile); data["name"] = playerscript.name; data["gender"] = playerscript.gender; data["checkpointlevel"] = playerscript.CheckpointLevel; data["checkpointname"] = playerscript.CheckpointName; data["bagisfull"] = playerscript.bagisFull; data["equippedspellL"] = playerscript.equippedSpellL; data["equippedspellR"] = playerscript.equippedSpellR; data["equippedspellQ"] = playerscript.equippedSpellQ; data["equippedspellQ2"] = playerscript.equippedSpellQ2; data["equippedspell1"] = playerscript.equippedSpell1; data["equippedspell2"] = playerscript.equippedSpell2; data["xp"] = playerscript.xp; data["level"] = playerscript.level; data["maxhealth"] = playerscript.maxHealth; data["maxstamina"] = playerscript.max_stamina; data["unlockedspells"] = spells.UnlockedSpells; data["unlockedhats"] = spells.UnlockedHats; data["unlockedtunics"] = spells.UnlockedTunics; data["unlockedamulets"] = spells.UnlockedAmulets; data["pickedupitems"] = spells.PickedUpItems; data["equippedhat"] = spells.EquippedHat; data["equippedtunic"] = spells.EquippedTunic; data["equippedamulet"] = spells.EquippedAmulet; data["itemcount"] = spells.ItemCount; data["bagspace"] = spells.bagSpace; data["bagisfull"] = spells.bagIsFull; data["spellcount"] = spells.SpellCount; data["spellspace"] = spells.SpellSpace; data["spellbookisfull"] = spells.SpellBookIsFull; data["hatcount"] = spells.HatCount; data["hatspace"] = spells.HatSpace; data["hatisfull"] = spells.HatIsFull; data["amuletcount"] = spells.AmuletCount; data["amuletspace"] = spells.AmuletSpace; data["amuletisfull"] = spells.AmuletIsFull; data["tuniccount"] = spells.TunicCount; data["tunicspace"] = spells.TunicSpace; data["tunicisfull"] = spells.TunicIsFull; data["declared"] = talents.Declared; data["declaration"] = talents.declaration; data["spellpower"] = playerscript.SPELLPOWERBONUS; if (talents.Declared) { if (talents.declaration == "Inorganic") { for (int c = 0; c < talents.Inorganic_Talents_t1.Length; ++c) { mystery[c] = talents.Inorganic_Talents_t1[c].mystery; reachable[c] = talents.Inorganic_Talents_t1[c].reachable; visible[c] = talents.Inorganic_Talents_t1[c].visible; gotten[c] = talents.Inorganic_Talents_t1[c].gotten; } } else if (talents.declaration == "Organic") { for (int c = 0; c < talents.Organic_Talents.Length; ++c) { mystery[c] = talents.Organic_Talents[c].mystery; reachable[c] = talents.Organic_Talents[c].reachable; visible[c] = talents.Organic_Talents[c].visible; gotten[c] = talents.Organic_Talents[c].gotten; } } else { for (int c = 0; c < talents.Biolchem_Talents.Length; ++c) { mystery[c] = talents.Biolchem_Talents[c].mystery; reachable[c] = talents.Biolchem_Talents[c].reachable; visible[c] = talents.Biolchem_Talents[c].visible; gotten[c] = talents.Biolchem_Talents[c].gotten; } } } data["talentsmystery"] = mystery; data["talentsreachable"] = reachable; data["talentsvisible"] = visible; data["talentsgotten"] = gotten; data["items"] = other.VodExterior; data["bosses"] = other.bosses; if (souls != null) { EnergyClusterScript ecs = souls.GetComponent<EnergyClusterScript>(); data["energyclusterloc"] = ecs.transform.position; data["energyclusterlevel"] = ecs.levelname; data["energyclusterworth"] = ecs.worth; } else { } /*data["inorg"] = talents.Inorganic_Talent_t1; data["org"] = talents.Organic_Talents; data["bio"] = talents.Biolchem_Talents;*/ data.Save(); print("DONE!"); }
// Use this for initialization void Start() { GameObject sax = GameObject.Find("saveassigner"); SaveAssigner sa = sax.GetComponent(typeof(SaveAssigner)) as SaveAssigner; int file = -1; pp = GameObject.FindGameObjectWithTag("Player"); if (sa.isLoading) { file = sa.savefile; SaveData data = SaveData.Load(Application.streamingAssetsPath + "\\" + file + ".uml"); player = GameObject.FindGameObjectWithTag("Player"); PlayerController playerscript = player.GetComponent(typeof(PlayerController)) as PlayerController; Spells spells = player.GetComponent(typeof(Spells)) as Spells; PlayerTalents talents = player.GetComponent(typeof(PlayerTalents)) as PlayerTalents; Items other = player.GetComponent(typeof(Items)) as Items; playerscript.name = data.GetValue <string>("name"); playerscript.gender = data.GetValue <string>("gender"); playerscript.CheckpointLevel = data.GetValue <string>("checkpointlevel"); playerscript.CheckpointName = data.GetValue <string>("checkpointname"); playerscript.bagisFull = data.GetValue <bool>("bagisfull"); playerscript.equipSpelltoL(data.GetValue <int>("equippedspellL")); playerscript.equipSpelltoR(data.GetValue <int>("equippedspellR")); playerscript.equipSpellto1(data.GetValue <int>("equippedspell1")); playerscript.equipSpellto2(data.GetValue <int>("equippedspell2")); playerscript.equipSpelltoQ(data.GetValue <int>("equippedspellQ")); playerscript.equipSpelltoQ2(data.GetValue <int>("equippedspellQ2")); playerscript.xp = data.GetValue <float>("xp"); playerscript.level = data.GetValue <int>("level"); playerscript.maxHealth = data.GetValue <int>("maxhealth"); playerscript.max_stamina = data.GetValue <int>("maxstamina"); spells.UnlockedSpells = data.GetValue <int[]>("unlockedspells"); spells.UnlockedHats = data.GetValue <int[]>("unlockedhats"); spells.UnlockedAmulets = data.GetValue <int[]>("unlockedamulets"); spells.UnlockedTunics = data.GetValue <int[]>("unlockedtunics"); spells.PickedUpItems = data.GetValue <int[]>("pickedupitems"); spells.ItemCount = data.GetValue <int>("itemcount"); playerscript.equipHat(data.GetValue <int>("equippedhat")); playerscript.equipTunic(data.GetValue <int>("equippedtunic")); playerscript.equipAmulet(data.GetValue <int>("equippedamulet")); spells.bagSpace = data.GetValue <int>("bagspace"); spells.bagIsFull = data.GetValue <bool>("bagisfull"); spells.SpellCount = data.GetValue <int>("spellcount"); spells.SpellSpace = data.GetValue <int>("spellspace"); spells.SpellBookIsFull = data.GetValue <bool>("spellbookisfull"); spells.HatCount = data.GetValue <int>("hatcount"); spells.HatSpace = data.GetValue <int>("hatspace"); spells.HatIsFull = data.GetValue <bool>("hatisfull"); spells.AmuletCount = data.GetValue <int>("amuletcount"); spells.AmuletIsFull = data.GetValue <bool>("amuletisfull"); spells.AmuletSpace = data.GetValue <int>("amuletspace"); spells.TunicCount = data.GetValue <int>("tuniccount"); spells.TunicSpace = data.GetValue <int>("tunicspace"); spells.TunicIsFull = data.GetValue <bool>("tunicisfull"); talents.Declared = data.GetValue <bool>("declared"); talents.declaration = data.GetValue <string>("declaration"); playerscript.numheals = 5; if (talents.Declared) { bool[] mys = data.GetValue <bool[]>("talentsmystery"); bool[] rea = data.GetValue <bool[]>("talentsreachable"); bool[] vis = data.GetValue <bool[]>("talentsvisible"); bool[] gotten = data.GetValue <bool[]>("talentsgotten"); if (talents.declaration == "Inorganic") { for (int c = 0; c < talents.Inorganic_Talents_t1.Length; ++c) { talents.Inorganic_Talents_t1[c].mystery = mys[c]; talents.Inorganic_Talents_t1[c].reachable = rea[c]; talents.Inorganic_Talents_t1[c].visible = vis[c]; talents.Inorganic_Talents_t1[c].gotten = gotten[c]; } } else if (talents.declaration == "Organic") { for (int c = 0; c < talents.Organic_Talents.Length; ++c) { talents.Organic_Talents[c].mystery = mys[c]; talents.Organic_Talents[c].reachable = rea[c]; talents.Organic_Talents[c].visible = vis[c]; talents.Organic_Talents[c].gotten = gotten[c]; } } else { for (int c = 0; c < talents.Biolchem_Talents.Length; ++c) { talents.Biolchem_Talents[c].mystery = mys[c]; talents.Biolchem_Talents[c].reachable = rea[c]; talents.Biolchem_Talents[c].visible = vis[c]; talents.Biolchem_Talents[c].gotten = gotten[c]; } } } bool[] wat = data.GetValue <bool[]>("items"); for (int c = 0; c < wat.Length; ++c) { other.VodExterior[c] = wat[c]; } wat = data.GetValue <bool[]>("bosses"); for (int c = 0; c < wat.Length; ++c) { other.bosses[c] = wat[c]; } if (data.HasKey("spellpower")) { playerscript.SPELLPOWERBONUS = data.GetValue <float>("spellpower"); } playerscript.currentHealth = playerscript.maxHealth; playerscript.savefile = file; StartCoroutine(LoadingScreen.LoadLevelSCREEN(playerscript.CheckpointLevel)); if (data.HasKey("energyclusterloc")) { Vector3 pos = data.GetValue <Vector3>("energyclusterloc"); GameObject wa; if (pos != null) { wa = Instantiate(Resources.Load("EnergyCluster")) as GameObject; ecs = wa.GetComponent <EnergyClusterScript>(); wa.transform.position = pos; ecs.levelname = data.GetValue <string>("energyclusterlevel"); ecs.worth = data.GetValue <float>("energyclusterworth"); } } StartCoroutine(checkpointerputter(playerscript.CheckpointName)); if (data.HasKey("energyclusterlevel")) { StartCoroutine(delayassigner(data.GetValue <string>("energyclusterlevel"), ecs)); } } else { // new game GameObject player = GameObject.FindGameObjectWithTag("Player"); PlayerController playerscript = player.GetComponent(typeof(PlayerController)) as PlayerController; Spells s = player.GetComponent(typeof(Spells)) as Spells; playerscript.CheckpointLevel = "Castle_Vod"; playerscript.CheckpointName = "Checkpoint1"; playerscript.currentHealth = playerscript.maxHealth; playerscript.savefile = sa.savefile; playerscript.name = sa.name; s.AddItem(11); playerscript.gender = sa.gender; Instantiate(Resources.Load("Saved")); StartCoroutine(checkpointerputter("Checkpoint1")); StartCoroutine(LoadingScreen.LoadLevelSCREEN("Castle_Vod")); //StartCoroutine(LoadingScreen.LoadLevelSCREEN("Castle_Vod"); } }
// Use this for initialization void Start() { GameObject player = GameObject.FindGameObjectWithTag("Player"); GameObject souls = GameObject.Find("EnergyCluster(Clone)"); playerscript = player.GetComponent(typeof(PlayerController)) as PlayerController; spells = player.GetComponent(typeof(Spells)) as Spells; talents = player.GetComponent(typeof(PlayerTalents)) as PlayerTalents; Items other = player.GetComponent(typeof(Items)) as Items; SaveData data = new SaveData("" + playerscript.savefile); data["name"] = playerscript.name; data["gender"] = playerscript.gender; data["checkpointlevel"] = playerscript.CheckpointLevel; data["checkpointname"] = playerscript.CheckpointName; data["bagisfull"] = playerscript.bagisFull; data["equippedspellL"] = playerscript.equippedSpellL; data["equippedspellR"] = playerscript.equippedSpellR; data["equippedspellQ"] = playerscript.equippedSpellQ; data["equippedspellQ2"] = playerscript.equippedSpellQ2; data["equippedspell1"] = playerscript.equippedSpell1; data["equippedspell2"] = playerscript.equippedSpell2; data["xp"] = playerscript.xp; data["level"] = playerscript.level; data["maxhealth"] = playerscript.maxHealth; data["maxstamina"] = playerscript.max_stamina; data["unlockedspells"] = spells.UnlockedSpells; data["unlockedhats"] = spells.UnlockedHats; data["unlockedtunics"] = spells.UnlockedTunics; data["unlockedamulets"] = spells.UnlockedAmulets; data["pickedupitems"] = spells.PickedUpItems; data["equippedhat"] = spells.EquippedHat; data["equippedtunic"] = spells.EquippedTunic; data["equippedamulet"] = spells.EquippedAmulet; data["itemcount"] = spells.ItemCount; data["bagspace"] = spells.bagSpace; data["bagisfull"] = spells.bagIsFull; data["spellcount"] = spells.SpellCount; data["spellspace"] = spells.SpellSpace; data["spellbookisfull"] = spells.SpellBookIsFull; data["hatcount"] = spells.HatCount; data["hatspace"] = spells.HatSpace; data["hatisfull"] = spells.HatIsFull; data["amuletcount"] = spells.AmuletCount; data["amuletspace"] = spells.AmuletSpace; data["amuletisfull"] = spells.AmuletIsFull; data["tuniccount"] = spells.TunicCount; data["tunicspace"] = spells.TunicSpace; data["tunicisfull"] = spells.TunicIsFull; data["declared"] = talents.Declared; data["declaration"] = talents.declaration; data["spellpower"] = playerscript.SPELLPOWERBONUS; if (talents.Declared) { if (talents.declaration == "Inorganic") { for (int c = 0; c < talents.Inorganic_Talents_t1.Length; ++c) { mystery[c] = talents.Inorganic_Talents_t1[c].mystery; reachable[c] = talents.Inorganic_Talents_t1[c].reachable; visible[c] = talents.Inorganic_Talents_t1[c].visible; gotten[c] = talents.Inorganic_Talents_t1[c].gotten; } } else if (talents.declaration == "Organic") { for (int c = 0; c < talents.Organic_Talents.Length; ++c) { mystery[c] = talents.Organic_Talents[c].mystery; reachable[c] = talents.Organic_Talents[c].reachable; visible[c] = talents.Organic_Talents[c].visible; gotten[c] = talents.Organic_Talents[c].gotten; } } else { for (int c = 0; c < talents.Biolchem_Talents.Length; ++c) { mystery[c] = talents.Biolchem_Talents[c].mystery; reachable[c] = talents.Biolchem_Talents[c].reachable; visible[c] = talents.Biolchem_Talents[c].visible; gotten[c] = talents.Biolchem_Talents[c].gotten; } } } data["talentsmystery"] = mystery; data["talentsreachable"] = reachable; data["talentsvisible"] = visible; data["talentsgotten"] = gotten; data["items"] = other.VodExterior; data["bosses"] = other.bosses; if (souls != null) { EnergyClusterScript ecs = souls.GetComponent <EnergyClusterScript>(); data["energyclusterloc"] = ecs.transform.position; data["energyclusterlevel"] = ecs.levelname; data["energyclusterworth"] = ecs.worth; } else { } /*data["inorg"] = talents.Inorganic_Talent_t1; * data["org"] = talents.Organic_Talents; * data["bio"] = talents.Biolchem_Talents;*/ data.Save(); print("DONE!"); }
// Use this for initialization void Start() { AudioSource.PlayClipAtPoint(closesound, transform.position); slamstyle = buttonstyle; player = GameObject.FindGameObjectWithTag("Player"); playerscript = player.GetComponent(typeof(PlayerController)) as PlayerController; spells = player.GetComponent(typeof(Spells)) as Spells; talents = player.GetComponent(typeof(PlayerTalents)) as PlayerTalents; if (talents.Declared) { t1o = true; } if (talents.declaration == "Biochemistry") { title = "Biochemistry"; } else if (talents.declaration == "Organic") { title = "Organic Chemistry"; } else if (talents.declaration == "Inorganic") { title = "Inorganic Chemistry"; } Application.LoadLevel(playerscript.CheckpointLevel); playerscript.currentHealth = playerscript.maxHealth; playerscript.numheals = 5; }