10/24 completed
This commit is contained in:
@@ -6,6 +6,7 @@ public class RocketSkinStats : ScriptableObject
|
||||
public RocketLevel[] baseLevels;
|
||||
public RocketLevel[] commonLevels;
|
||||
public RocketLevel[] rareLevels;
|
||||
public RocketLevel[] epicLevels;
|
||||
public RocketLevel[] legendaryLevels;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using TMPro;
|
||||
using UnityEngine.UI;
|
||||
public class RocketUpgradePanel : MonoBehaviour
|
||||
{
|
||||
public TMP_Text txtRocketLevel;
|
||||
public TMP_Text txtEnergyGain;
|
||||
public TMP_Text txtSpeed;
|
||||
public TMP_Text txtBoostConsumption;
|
||||
@@ -28,6 +29,8 @@ public class RocketUpgradePanel : MonoBehaviour
|
||||
int curSpeedLevel;
|
||||
int curEnergyLevel;
|
||||
int curBoostLevel;
|
||||
|
||||
public int curRocketLevel => Mathf.Clamp(curSpeedLevel + curEnergyLevel + curBoostLevel+1,1,10);
|
||||
SkinType rarity;
|
||||
public float curSpeed => SkinShopManager.GetStatsForRarity(rarity)[curSpeedLevel].speedMultiplier;
|
||||
public float curEnergy => SkinShopManager.GetStatsForRarity(rarity)[curEnergyLevel].moonMultiplier;
|
||||
@@ -36,6 +39,8 @@ public class RocketUpgradePanel : MonoBehaviour
|
||||
public RocketLevel nextSpeedStats =>SkinShopManager.GetStatsForRarity(rarity)[curSpeedLevel];
|
||||
public RocketLevel nextEnergyStats =>SkinShopManager.GetStatsForRarity(rarity)[curEnergyLevel];
|
||||
public RocketLevel nextBoostStats =>SkinShopManager.GetStatsForRarity(rarity)[curBoostLevel];
|
||||
public RocketLevel nextRocketLevel => (curRocketLevel < 10) ? SkinShopManager.GetPriceForRarity(rarity)[curRocketLevel] : null;
|
||||
|
||||
|
||||
|
||||
public float nextSpeed => SkinShopManager.GetStatsForRarity(rarity)[curSpeedLevel+1].speedMultiplier;
|
||||
@@ -58,35 +63,65 @@ public class RocketUpgradePanel : MonoBehaviour
|
||||
curSpeedLevel = data.speedLevel;
|
||||
curEnergyLevel = data.energyLevel;
|
||||
curBoostLevel = data.boostLevel;
|
||||
|
||||
txtRocketLevel.text = "Level " + curRocketLevel;
|
||||
txtEnergyGain.text = $"{ curEnergy } Per moon";
|
||||
txtSpeed.text = $"{curSpeed*100}%";
|
||||
txtBoostConsumption.text = $"{ curBoost *100}%";
|
||||
int maxLevels =SkinShopManager.GetStatsForRarity(rarity).Length;
|
||||
// int maxleve
|
||||
|
||||
if(curEnergyLevel < maxLevels-1) {txtEnergyGain.text += $" -> <color=green> {nextEnergy}</color>";}
|
||||
if(curSpeedLevel < maxLevels-1) {txtSpeed.text += $" -> <color=green> {nextSpeed*100}%</color>";}
|
||||
if(curBoostLevel < maxLevels-1) {txtBoostConsumption.text += $" -> <color=green> {nextBoost*100}%</color>";}
|
||||
bool boostAvailable = curBoostLevel < maxLevels-1;
|
||||
bool speedAvailable = curSpeedLevel < maxLevels-1;
|
||||
bool energyAvailable = curEnergyLevel < maxLevels-1;
|
||||
|
||||
if(energyAvailable) {txtEnergyGain.text += $" -> <color=green> {nextEnergy}</color>";}
|
||||
if(speedAvailable) {txtSpeed.text += $" -> <color=green> {nextSpeed*100}%</color>";}
|
||||
if(boostAvailable) {txtBoostConsumption.text += $" -> <color=green> {nextBoost*100}%</color>";}
|
||||
|
||||
if(curRocketLevel < 10){
|
||||
txtRocketLevel.text += $" -> <color=green> {curRocketLevel+1}</color>";
|
||||
}else{
|
||||
txtRocketLevel.text += " <color=green> <b> MAX! </b></color>";
|
||||
}
|
||||
|
||||
btn_upgrade_boost.interactable = DBmanager.Coins >= nextBoostStats.goldCost && DBmanager.Metal >= nextBoostStats.metalCost && curBoostLevel < maxLevels-1;
|
||||
btn_upgrade_energy.interactable = DBmanager.Coins >= nextEnergyStats.goldCost && DBmanager.Metal >= nextEnergyStats.metalCost&& curEnergyLevel < maxLevels-1;
|
||||
btn_upgrade_speed.interactable = DBmanager.Coins >= nextSpeedStats.goldCost && DBmanager.Metal >= nextSpeedStats.metalCost&& curSpeedLevel < maxLevels-1;
|
||||
|
||||
if(nextRocketLevel == null){
|
||||
btn_upgrade_boost.interactable = false;
|
||||
btn_upgrade_energy.interactable = false;
|
||||
btn_upgrade_speed.interactable=false;
|
||||
btn_upgrade_boost.transform.GetChild(1).gameObject.SetActive(false);
|
||||
btn_upgrade_energy.transform.GetChild(1).gameObject.SetActive(false);
|
||||
btn_upgrade_speed.transform.GetChild(1).gameObject.SetActive(false);
|
||||
|
||||
btn_upgrade_boost.transform.GetChild(1).GetChild(0).gameObject.SetActive(nextBoostStats.goldCost > 0);
|
||||
btn_upgrade_boost.transform.GetChild(1).GetChild(0).GetComponentInChildren<TMP_Text>().text = nextBoostStats.goldCost.ToString();
|
||||
btn_upgrade_boost.transform.GetChild(1).GetChild(1).gameObject.SetActive(nextBoostStats.metalCost > 0);
|
||||
btn_upgrade_boost.transform.GetChild(1).GetChild(1).GetComponentInChildren<TMP_Text>().text = nextBoostStats.metalCost.ToString();
|
||||
}else{
|
||||
btn_upgrade_boost.interactable = DBmanager.Coins >= nextRocketLevel.goldCost && DBmanager.Metal >= nextRocketLevel.metalCost && curRocketLevel < 10 && boostAvailable && curBoostLevel < maxLevels-1;
|
||||
btn_upgrade_energy.interactable = DBmanager.Coins >= nextRocketLevel.goldCost && DBmanager.Metal >= nextRocketLevel.metalCost&& curRocketLevel < 10&& energyAvailable && curEnergyLevel < maxLevels -1;
|
||||
btn_upgrade_speed.interactable = DBmanager.Coins >= nextRocketLevel.goldCost && DBmanager.Metal >= nextRocketLevel.metalCost&& curRocketLevel < 10&& speedAvailable && curSpeedLevel < maxLevels-1;
|
||||
|
||||
btn_upgrade_boost.GetComponentInChildren<TMP_Text>().text = curBoostLevel < maxLevels-1 ? "Upgrade" : "Max!";
|
||||
btn_upgrade_boost.transform.GetChild(1).gameObject.SetActive(boostAvailable);
|
||||
|
||||
btn_upgrade_speed.transform.GetChild(1).GetChild(0).gameObject.SetActive(nextSpeedStats.goldCost > 0);
|
||||
btn_upgrade_speed.transform.GetChild(1).GetChild(0).GetComponentInChildren<TMP_Text>().text = nextSpeedStats.goldCost.ToString();
|
||||
btn_upgrade_speed.transform.GetChild(1).GetChild(1).gameObject.SetActive(nextSpeedStats.metalCost > 0);
|
||||
btn_upgrade_speed.transform.GetChild(1).GetChild(1).GetComponentInChildren<TMP_Text>().text = nextSpeedStats.metalCost.ToString();
|
||||
btn_upgrade_boost.transform.GetChild(1).GetChild(0).gameObject.SetActive(nextRocketLevel.goldCost > 0);
|
||||
btn_upgrade_boost.transform.GetChild(1).GetChild(0).GetComponentInChildren<TMP_Text>().text = nextRocketLevel.goldCost.ToString();
|
||||
btn_upgrade_boost.transform.GetChild(1).GetChild(1).gameObject.SetActive(nextRocketLevel.metalCost > 0);
|
||||
btn_upgrade_boost.transform.GetChild(1).GetChild(1).GetComponentInChildren<TMP_Text>().text = nextRocketLevel.metalCost.ToString();
|
||||
|
||||
btn_upgrade_energy.transform.GetChild(1).GetChild(0).gameObject.SetActive(nextEnergyStats.goldCost > 0);
|
||||
btn_upgrade_energy.transform.GetChild(1).GetChild(0).GetComponentInChildren<TMP_Text>().text = nextEnergyStats.goldCost.ToString();
|
||||
btn_upgrade_energy.transform.GetChild(1).GetChild(1).gameObject.SetActive(nextEnergyStats.metalCost > 0);
|
||||
btn_upgrade_energy.transform.GetChild(1).GetChild(1).GetComponentInChildren<TMP_Text>().text = nextEnergyStats.metalCost.ToString();
|
||||
btn_upgrade_speed.GetComponentInChildren<TMP_Text>().text = curSpeedLevel < maxLevels-1 ? "Upgrade" : "Max!";
|
||||
btn_upgrade_speed.transform.GetChild(1).gameObject.SetActive(speedAvailable);
|
||||
|
||||
btn_upgrade_speed.transform.GetChild(1).GetChild(0).gameObject.SetActive(nextRocketLevel.goldCost > 0);
|
||||
btn_upgrade_speed.transform.GetChild(1).GetChild(0).GetComponentInChildren<TMP_Text>().text = nextRocketLevel.goldCost.ToString();
|
||||
btn_upgrade_speed.transform.GetChild(1).GetChild(1).gameObject.SetActive(nextRocketLevel.metalCost > 0);
|
||||
btn_upgrade_speed.transform.GetChild(1).GetChild(1).GetComponentInChildren<TMP_Text>().text = nextRocketLevel.metalCost.ToString();
|
||||
|
||||
btn_upgrade_energy.GetComponentInChildren<TMP_Text>().text = curEnergyLevel < maxLevels-1 ? "Upgrade" : "Max!";
|
||||
btn_upgrade_energy.transform.GetChild(1).gameObject.SetActive(energyAvailable);
|
||||
|
||||
btn_upgrade_energy.transform.GetChild(1).GetChild(0).gameObject.SetActive(nextRocketLevel.goldCost > 0);
|
||||
btn_upgrade_energy.transform.GetChild(1).GetChild(0).GetComponentInChildren<TMP_Text>().text = nextRocketLevel.goldCost.ToString();
|
||||
btn_upgrade_energy.transform.GetChild(1).GetChild(1).gameObject.SetActive(nextRocketLevel.metalCost > 0);
|
||||
btn_upgrade_energy.transform.GetChild(1).GetChild(1).GetComponentInChildren<TMP_Text>().text = nextRocketLevel.metalCost.ToString();
|
||||
}
|
||||
gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
@@ -100,7 +135,7 @@ public class RocketUpgradePanel : MonoBehaviour
|
||||
DBmanager.UpgradeRocketSpeed(selectedRocket, nextSpeedStats);
|
||||
SkinShopManager.instance.Populate();
|
||||
// MessageDialog.instance.ShowMessage("Success","Rocket Upgraded Successfully!");
|
||||
AudioManager.instnace.ChestOpen();
|
||||
AudioManager.instnace.CollectPickup();
|
||||
// Hide();
|
||||
Show(selectedRocket);
|
||||
|
||||
@@ -116,7 +151,7 @@ public class RocketUpgradePanel : MonoBehaviour
|
||||
DBmanager.UpgradeRocketBoost(selectedRocket, nextBoostStats);
|
||||
SkinShopManager.instance.Populate();
|
||||
// MessageDialog.instance.ShowMessage("Success","Rocket Upgraded Successfully!");
|
||||
AudioManager.instnace.ChestOpen();
|
||||
AudioManager.instnace.CollectPickup();
|
||||
// Hide();
|
||||
Show(selectedRocket);
|
||||
}
|
||||
@@ -131,7 +166,7 @@ public class RocketUpgradePanel : MonoBehaviour
|
||||
DBmanager.UpgradeRocketEnergy(selectedRocket, nextEnergyStats);
|
||||
SkinShopManager.instance.Populate();
|
||||
// MessageDialog.instance.ShowMessage("Success","Rocket Upgraded Successfully!");
|
||||
AudioManager.instnace.ChestOpen();
|
||||
AudioManager.instnace.CollectPickup();
|
||||
// Hide();
|
||||
Show(selectedRocket);
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@ using UnityEngine.UI;
|
||||
public class SkinShopItem : MonoBehaviour
|
||||
{
|
||||
public Image spaceshipImg;
|
||||
[Tooltip("In order of: normal, rare, legendary. 3 items required")]
|
||||
[Tooltip("In order of: normal, rare, legendary. 5 items required")]
|
||||
public GameObject[] banners;
|
||||
public Image frame;
|
||||
public bool Available;
|
||||
// public GameObject notPurchasedIndicator;
|
||||
public SkinShopItemData skinData;
|
||||
[Header("Stats")]
|
||||
// public TMP_Text txtLevel;
|
||||
public TMP_Text txtLevel;
|
||||
public TMP_Text txtEnergyGain;
|
||||
public TMP_Text txtSpeed;
|
||||
public TMP_Text txtBoostConsumption;
|
||||
@@ -26,6 +26,8 @@ public class SkinShopItem : MonoBehaviour
|
||||
int curEnergyLevel;
|
||||
int curBoostLevel;
|
||||
|
||||
public int curRocketLevel => Mathf.Clamp(curBoostLevel + curEnergyLevel + curSpeedLevel+1,1,10);
|
||||
|
||||
public void Set(SkinShopItemData data, bool available){
|
||||
skinData = data;
|
||||
// newItem.backgroundImg.color = (skinsData.skins[i].skinType==SkinType.Base) ? basicColor : (skinsData.skins[i].skinType==SkinType.Rare ? rareColor : legendaryColor);
|
||||
@@ -42,7 +44,8 @@ public class SkinShopItem : MonoBehaviour
|
||||
banners[1].SetActive(data.skinType== SkinType.Base);
|
||||
}
|
||||
banners[2].SetActive(data.skinType== SkinType.Rare);
|
||||
banners[3].SetActive(data.skinType== SkinType.Legendary);
|
||||
banners[3].SetActive(data.skinType== SkinType.Epic);
|
||||
banners[4].SetActive(data.skinType== SkinType.Legendary);
|
||||
|
||||
//Level
|
||||
rarity = SkinShopManager.GetRarityFromName(data.name);
|
||||
@@ -53,7 +56,7 @@ public class SkinShopItem : MonoBehaviour
|
||||
curBoostLevel = purchasedSkin.boostLevel;
|
||||
}
|
||||
|
||||
// txtLevel.text = "";
|
||||
txtLevel.text = "Level " +curRocketLevel;
|
||||
|
||||
txtEnergyGain.transform.parent.gameObject.SetActive(available);
|
||||
txtSpeed.transform.parent.gameObject.SetActive(available);
|
||||
|
||||
@@ -9,8 +9,9 @@ public class SkinShopManager : MonoBehaviour
|
||||
{
|
||||
public static SkinShopManager instance;
|
||||
public RocketSkinStats rocketStats;
|
||||
public RocketSkinStats rocketPrices;
|
||||
public static RocketSkinStats RocketStats;
|
||||
public static bool availableToUpgrade;
|
||||
// public static bool availableToUpgrade;
|
||||
public NewSkinDisplay newSkinDisplay;
|
||||
public Building skinShopBuilding;
|
||||
public SkinsData skinsData;
|
||||
@@ -50,8 +51,8 @@ public class SkinShopManager : MonoBehaviour
|
||||
}
|
||||
List<SkinShopItemData> skinsAvailableToPurchase= new List<SkinShopItemData>();
|
||||
public void Populate(){
|
||||
int purchasedFlagships=0;
|
||||
int flagshipsCount=0;
|
||||
// int purchasedFlagships=0;
|
||||
// int flagshipsCount=0;
|
||||
|
||||
//Validate skins list
|
||||
if(DBmanager.SkinsPurchased.Count <=0){
|
||||
@@ -73,22 +74,25 @@ public class SkinShopManager : MonoBehaviour
|
||||
skinShopItems = new List<SkinShopItem>();
|
||||
for(int i=0; i<skinsData.skins.Length;i++){
|
||||
int rarity = getRarityInt(skinsData.skins[i]);
|
||||
bool isAvailable = skinShopBuilding.curLevel >= rarity;
|
||||
if(!isAvailable){continue;}
|
||||
// bool isAvailable = skinShopBuilding.curLevel >= rarity;
|
||||
// if(!isAvailable){continue;}
|
||||
|
||||
|
||||
bool isOwned = DBmanager.GetSkinIdByName(skinsData.skins[i].name) >= 0;
|
||||
|
||||
|
||||
if(skinShopBuilding.curLevel == rarity){
|
||||
flagshipsCount++;
|
||||
if(isOwned){
|
||||
purchasedFlagships++;
|
||||
}
|
||||
}
|
||||
// if(skinShopBuilding.curLevel == rarity){
|
||||
// flagshipsCount++;
|
||||
// if(isOwned){
|
||||
// purchasedFlagships++;
|
||||
// }
|
||||
// }
|
||||
|
||||
if(!isOwned){
|
||||
skinsAvailableToPurchase.Add(skinsData.skins[i]);
|
||||
// skinsAvailableToPurchase.Add(skinsData.skins[i]);
|
||||
}else{
|
||||
if(!DBmanager.GetSkinByName(skinsData.skins[i].name).built){
|
||||
continue;
|
||||
}
|
||||
SkinShopItem newItem = Instantiate(listItemPrefab, listItemsParent).GetComponent<SkinShopItem>();
|
||||
|
||||
newItem.Set(skinsData.skins[i],isOwned);
|
||||
@@ -106,7 +110,7 @@ public class SkinShopManager : MonoBehaviour
|
||||
skinShopItems.Add(newItem);
|
||||
}
|
||||
|
||||
availableToUpgrade = purchasedFlagships >= ((float)flagshipsCount/2f);
|
||||
// availableToUpgrade = purchasedFlagships >= ((float)flagshipsCount/2f);
|
||||
|
||||
SelectItem(selectedSkin,true);
|
||||
}
|
||||
@@ -114,7 +118,8 @@ public class SkinShopManager : MonoBehaviour
|
||||
int getRarityInt(SkinShopItemData skin){
|
||||
int rarity = 0;
|
||||
if(skin.skinType == SkinType.Rare){rarity=1;}
|
||||
if(skin.skinType == SkinType.Legendary){rarity=2;}
|
||||
if(skin.skinType == SkinType.Legendary){rarity=3;}
|
||||
if(skin.skinType == SkinType.Epic){rarity=2;}
|
||||
|
||||
return rarity;
|
||||
}
|
||||
@@ -131,7 +136,7 @@ public class SkinShopManager : MonoBehaviour
|
||||
}
|
||||
if(DBmanager.GetSkinIdByName(data.name)>=0){ // <-- purchased
|
||||
btn_Equip.gameObject.SetActive(true);
|
||||
btn_Upgrade.gameObject.SetActive(true);
|
||||
btn_Upgrade.gameObject.SetActive(getRarityInt(data) <= skinShopBuilding.curLevel);
|
||||
btn_Buy.gameObject.SetActive(false);
|
||||
btn_Equip.interactable = GetEquipedSkin() != data.name; // <-- disable equip button if already equipped
|
||||
}else{
|
||||
@@ -208,8 +213,10 @@ public class SkinShopManager : MonoBehaviour
|
||||
rarityIndex=1;
|
||||
}else if(item.skinType == SkinType.Rare){
|
||||
rarityIndex = 2;
|
||||
}else if(item.skinType == SkinType.Epic){
|
||||
rarityIndex = 3;
|
||||
}else{
|
||||
rarityIndex=3;
|
||||
rarityIndex=4;
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -218,6 +225,18 @@ public class SkinShopManager : MonoBehaviour
|
||||
|
||||
return rarityIndex;
|
||||
}
|
||||
public static SkinShopItemData GetSkinDataByName(string name){
|
||||
int rarityIndex = 0;
|
||||
|
||||
foreach(SkinShopItemData item in SkinsData.skins){
|
||||
if(item.name == name){
|
||||
//this is it
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static SkinType GetRarityFromName(string name){
|
||||
return GetRarityFromIndex(GetRarityIndexFromName(name));
|
||||
@@ -230,6 +249,8 @@ public class SkinShopManager : MonoBehaviour
|
||||
return SkinType.Base;
|
||||
}else if(id==2){
|
||||
return SkinType.Rare;
|
||||
}else if(id ==3){
|
||||
return SkinType.Epic;
|
||||
}else{
|
||||
return SkinType.Legendary;
|
||||
}
|
||||
@@ -254,6 +275,8 @@ public class SkinShopManager : MonoBehaviour
|
||||
return RocketStats.commonLevels;
|
||||
}else if(data.skinType == SkinType.Rare){
|
||||
return RocketStats.rareLevels;
|
||||
}else if(data.skinType == SkinType.Epic){
|
||||
return RocketStats.epicLevels;
|
||||
}else{
|
||||
return RocketStats.legendaryLevels;
|
||||
}
|
||||
@@ -266,14 +289,59 @@ public class SkinShopManager : MonoBehaviour
|
||||
return RocketStats.commonLevels;
|
||||
}else if(data == SkinType.Rare){
|
||||
return RocketStats.rareLevels;
|
||||
}else if(data == SkinType.Epic){
|
||||
return RocketStats.epicLevels;
|
||||
}else{
|
||||
return RocketStats.legendaryLevels;
|
||||
}
|
||||
}
|
||||
public static RocketLevel[] GetPriceForRarity(SkinType data){
|
||||
if(data == SkinType.Default){
|
||||
return instance.rocketPrices.baseLevels;
|
||||
}else if(data == SkinType.Base){
|
||||
return instance.rocketPrices.commonLevels;
|
||||
}else if(data == SkinType.Rare){
|
||||
return instance.rocketPrices.rareLevels;
|
||||
}else if(data == SkinType.Epic){
|
||||
return instance.rocketPrices.epicLevels;
|
||||
}else{
|
||||
return instance.rocketPrices.legendaryLevels;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetRarityName(SkinType data){
|
||||
if(data == SkinType.Default){
|
||||
return "Basic";
|
||||
}else if(data == SkinType.Base){
|
||||
return "Common";
|
||||
}else if(data == SkinType.Rare){
|
||||
return "Rare";
|
||||
}else if(data == SkinType.Epic){
|
||||
return "Epic";
|
||||
}else{
|
||||
return "Legendary";
|
||||
}
|
||||
}
|
||||
|
||||
public static Color GetRarityColor(SkinType data){
|
||||
if(data == SkinType.Default){
|
||||
return Color.grey;
|
||||
}else if(data == SkinType.Base){
|
||||
return Color.green;
|
||||
|
||||
}else if(data == SkinType.Rare){
|
||||
return Color.blue;
|
||||
|
||||
}else if(data == SkinType.Epic){
|
||||
return Color.magenta;
|
||||
|
||||
}else{
|
||||
return Color.red;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class SkinShopItemData{
|
||||
[Serializable]public class SkinShopItemData{
|
||||
public string name;
|
||||
public Sprite image;
|
||||
public int price_gold,price_metal;
|
||||
@@ -285,7 +353,8 @@ public enum SkinType{
|
||||
Default,
|
||||
Base,
|
||||
Rare,
|
||||
Legendary
|
||||
Legendary,
|
||||
Epic
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
||||
@@ -178,6 +178,7 @@ public class SpaceshipController : NetworkBehaviour
|
||||
ResetStats();
|
||||
if(MinigameManager.instance.isRanked){
|
||||
DBmanager.SetMetal(DBmanager.Metal + DBmanager.CurrentRank.energyReward);
|
||||
DBmanager.SetMetal(DBmanager.Metal - DBmanager.CurrentRank.entryFee);
|
||||
}
|
||||
if (joystick == null) { joystick = FindObjectOfType<Joystick>(); }
|
||||
FindObjectOfType<CameraFollower>().SetTarget(transform);
|
||||
@@ -557,7 +558,7 @@ public class SpaceshipController : NetworkBehaviour
|
||||
void OnKill()
|
||||
{
|
||||
Kills++;
|
||||
Scores += 10; //TODO: Need to change Scores on kills?
|
||||
// Scores += 10; //TODO: Need to change Scores on kills?
|
||||
// scaleMultiplier += 0.05f;
|
||||
// OnScaleChanged(scaleMultiplier, scaleMultiplier);
|
||||
IncreaseTrail(trailIncrementRate);
|
||||
@@ -608,10 +609,13 @@ public class SpaceshipController : NetworkBehaviour
|
||||
IncreaseTrail(trailIncrementRate);
|
||||
// scaleMultiplier += 0.05f;
|
||||
moonsCollected++;
|
||||
Scores += 2;
|
||||
break;
|
||||
|
||||
case PickupItem.PickupType.Star:
|
||||
IncreaseTrail(trailIncrementRate / 2f);
|
||||
Scores += 1;
|
||||
|
||||
// scaleMultiplier += 0.025f;
|
||||
|
||||
break;
|
||||
@@ -638,7 +642,7 @@ public class SpaceshipController : NetworkBehaviour
|
||||
public void Die(string killer)
|
||||
{
|
||||
|
||||
MinigameManager.instance.SpawnLeftoverPickups(transform.position, Scores);
|
||||
MinigameManager.instance.SpawnLeftoverPickups(transform.position, (int)((float)Scores/4f));
|
||||
Debug.Log($"Sending death signal to {pname} by {killer}");
|
||||
|
||||
//Handle Respawning
|
||||
|
||||
Reference in New Issue
Block a user