public playerData(playerController pC, upgradeMaster crM, upgradeMaster caM, upgradeMaster fM, sneakerInventory sI, upgradeMaster aCM) { cash = pC.cash; cashIncrease = pC.cashIncrease; followers = pC.followers; followerIncrease = pC.followerIncrease; crateProb = pC.crateProb; autoCash = pC.autoCash; crateCount = crM.count; cashCount = caM.count; followerCount = fM.count; autoCashCount = aCM.count; nikeMagsbool = sI.nikeMagsbool; tomSachsbool = sI.tomSachsbool; offWhiteAF1bool = sI.offWhiteAF1bool; offWhiteAJ1bool = sI.offWhiteAJ1bool; travisAJ1bool = sI.travisAJ1bool; wotherspoonbool = sI.travisAJ1bool; yeezy700bool = sI.yeezy700bool; yeezyTurtbool = sI.yeezyTurtbool; chunkyDunkybool = sI.chunkyDunkybool; diorAJ1bool = sI.diorAJ1bool; offWhitePrestobool = sI.offWhitePrestobool; yeezyQntmbool = sI.yeezyQntmbool; nikeAirYeezybool = sI.nikeAirYeezybool; nikeSacaibool = sI.nikeSacaibool; unionAJ1bool = sI.unionAJ1bool; balenciagaSbool = sI.balenciagaSbool; halfEvilYellowBool = sI.halfEvilYellowBool; halfEvilPurpleBool = sI.halfEvilPurpleBool; offWhiteTeeBool = sI.offWhiteTeeBool; kawsTeeBool = sI.kawsTeeBool; antiSocialTeeBool = sI.antiSocialTeeBool; bapeTeeBool = sI.bapeTeeBool; supremeTeeBool = sI.supremeTeeBool; travisTeeBool = sI.travisTeeBool; }
public void cratePrize() { pC = GameObject.FindWithTag("Player").GetComponent <playerController>(); sI = GameObject.FindWithTag("Player").GetComponent <sneakerInventory>(); shoeProb = Random.Range(1, 601); upgradeChoice = Random.Range(1, 5); listNum = Random.Range(0, 10); if (upgradeChoice == 1) { Instantiate(cashNotif, transform.position, Quaternion.identity); pC.cash += prizes[listNum]; } else if (upgradeChoice == 2) { Instantiate(followerNotif, transform.position, Quaternion.identity); pC.followers += prizes[listNum]; } else if (upgradeChoice == 3) { if (shoeProb == 1) { if (sI.yeezy700bool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.yeezy700bool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 2) { if (sI.yeezyTurtbool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.yeezyTurtbool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 3) { if (sI.wotherspoonbool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.wotherspoonbool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 4) { if (sI.travisAJ1bool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.travisAJ1bool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 5) { if (sI.offWhiteAJ1bool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.offWhiteAJ1bool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 6) { if (sI.offWhiteAF1bool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.offWhiteAF1bool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 7) { if (sI.yeezyQntmbool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.yeezyQntmbool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 8) { if (sI.nikeAirYeezybool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.nikeAirYeezybool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 9) { if (sI.nikeSacaibool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.nikeSacaibool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 10) { if (sI.offWhitePrestobool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.offWhitePrestobool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 11) { if (sI.balenciagaSbool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.balenciagaSbool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 12) { if (sI.unionAJ1bool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.unionAJ1bool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 13) { if (sI.halfEvilYellowBool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.halfEvilYellowBool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 14) { if (sI.halfEvilPurpleBool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.halfEvilPurpleBool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 15) { if (sI.kawsTeeBool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.kawsTeeBool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 16) { if (sI.antiSocialTeeBool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.antiSocialTeeBool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 17) { if (sI.bapeTeeBool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.bapeTeeBool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb == 18) { if (sI.offWhiteTeeBool == false) { Instantiate(sneakerNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); sI.offWhiteTeeBool = true; } else { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } if (shoeProb >= 19) { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, -1.0f), Quaternion.identity); } } else if (upgradeChoice > 3) { Instantiate(deadNotif, new Vector3(-0.03f, 1.76f, 0.0f), Quaternion.identity); } }
public static void SavePlayer(playerController pC, upgradeMaster crM, upgradeMaster caM, upgradeMaster fM, sneakerInventory sI, upgradeMaster aCM) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/player.fun"; FileStream stream = new FileStream(path, FileMode.Create); playerData data = new playerData(pC, crM, caM, fM, sI, aCM); formatter.Serialize(stream, data); stream.Close(); }