public void SkinUnlockOrEquip(int catNumber, int skinNumber) { playerDetails = gameDataObject.GetComponent <PlayerDetailsScript>(); playerInv = gameDataObject.GetComponent <PlayerInventoryScript>(); playerStable = gameDataObject.GetComponent <PlayerStableScript>(); Debug.Log(playerInv.catSkins[skinNumber]); int skinStatus = playerInv.catsUnlocked[catNumber]; //Grab the status of the skin if (skinStatus == 1) //If we own it { playerStable.currentCat = catNumber; //Equip it catSpawn.DeleteCat(); catSpawn.SpawnOwnCat(); //Code to refresh cat here } if (skinStatus == 0) { if (playerDetails.hardCurrency >= 500) //If we can afford it { playerDetails.hardCurrency -= 500; //Buy it playerInv.catsUnlocked[catNumber] = 1; //Register it in inventory SkinUnlockOrEquip(catNumber, skinNumber); } } }
// Use this for initialization void Start() { //GameObject ownCat = Instantiate(cattoSpawnPrefab, gameObject.transform, false) as GameObject; if (challengerCat) { SpawnChallengerCat(); } if (friendCat) { SpawnFriendCat(); } catDataObject = GameObject.FindGameObjectWithTag("GameData"); playerStable = catDataObject.GetComponent <PlayerStableScript>(); playerDetails = catDataObject.GetComponent <PlayerDetailsScript>(); runningCatObjects = GameObject.FindGameObjectsWithTag("CatAttachObjects"); levelCam = GameObject.FindGameObjectWithTag("LevelCam").GetComponent <Camera>(); if (mainMenu && ownCat) { nameObject = true; } if (ownCat) { SpawnOwnCat(); } }
// Use this for initialization void Start() { playerDataObject = GameObject.FindGameObjectWithTag("GameData"); playerStable = playerDataObject.GetComponent <PlayerStableScript>(); catNameText = gameObject.GetComponent <Text>(); //catNameText.text = playerStable.catName[playerStable.currentCat]; }
// Use this for initialization void Start() { gameDataObject = GameObject.FindGameObjectWithTag("GameData"); gameOptions = gameDataObject.GetComponent <GameOptionsScript>(); playerDetails = gameDataObject.GetComponent <PlayerDetailsScript>(); playerInv = gameDataObject.GetComponent <PlayerInventoryScript>(); playerStable = gameDataObject.GetComponent <PlayerStableScript>(); }
// Use this for initialization void Start() { theButton = gameObject.GetComponent <Button>(); theButton.onClick.AddListener(delegate { CollarUnlockOrEquip(catNumber, collarNumber); }); gameDataObject = GameObject.FindGameObjectWithTag("GameData"); catSpawner = GameObject.FindGameObjectWithTag("MainMenuSpawner"); catSpawn = catSpawner.GetComponent <CatSpawnScript>(); playerStable = gameDataObject.GetComponent <PlayerStableScript>(); }
// Use this for initialization void Start() { catDataObject = GameObject.FindGameObjectWithTag("GameData"); playerStable = catDataObject.GetComponent <PlayerStableScript>(); SpawnRoom(); }