// Use this for initialization void Start() { omNomText = GameObject.Find("OmNomText"); if (GameObject.Find("Om")) { om = omNomText.transform.Find("Om").gameObject; } if (GameObject.Find("Nom1")) { nom1 = omNomText.transform.Find("Nom1").gameObject; } if (GameObject.Find("Nom2")) { nom2 = omNomText.transform.Find("Nom2").gameObject; } if (GameObject.Find("PakuPaku")) { paku_spot = omNomText.transform.Find("PakuPaku").gameObject; } if (GameObject.Find("DuckHuntDirector")) { DuckHuntDirector = GameObject.Find("DuckHuntDirector"); } eat_pop = GetComponent <AudioSource>(); //Debug.Log(om.name + nom1.name + nom2.name); saver = GameObject.Find("SceneDirector").GetComponent <SaveandLoad>(); }
// Use this for initialization void Awake() { hot = GameObject.Find("HotSauce").GetComponent <SauceType>().sauced_sushi_material; xeno = GameObject.Find("XenoSauce").GetComponent <SauceType>().sauced_sushi_material; tron = GameObject.Find("TronSauce").GetComponent <SauceType>().sauced_sushi_material; trek = GameObject.Find("TrekSauce").GetComponent <SauceType>().sauced_sushi_material; monster = GameObject.Find("MonsterSauce").GetComponent <SauceType>().sauced_sushi_material; scifi = GameObject.Find("SciFiSauce").GetComponent <SauceType>().sauced_sushi_material; digital = GameObject.Find("DigitalSauce").GetComponent <SauceType>().sauced_sushi_material; target = GameObject.Find("TargetSauce").GetComponent <SauceType>().sauced_sushi_material; combo_effect = GameObject.Find("SauceComboParticles"); dish_sauce = GameObject.Find("DishSauce"); new_combo_yay = dish_sauce.GetComponents <AudioSource>()[1]; combo_poof = dish_sauce.GetComponents <AudioSource>()[0]; saver = GameObject.Find("SceneDirector").GetComponent <SaveandLoad>(); if (this.name.Contains("Dish")) { sauce_material = this.GetComponent <SauceType>().sauced_sushi_material; sauce_type = this.GetComponent <SauceType>().sauce_type; } else { sauce_material = this.GetComponentInParent <SauceType>().sauced_sushi_material; sauce_type = this.GetComponentInParent <SauceType>().sauce_type; } }
// Use this for initialization private void Awake() { saver = GetComponent <SaveandLoad>(); if (clearOnLoad) { saver.ClearSave(); clearOnLoad = false; } }
// Use this for initialization void Start() { SaveandLoad.Load(); lbBack.text = Localization.instance.Get("Level"); lbNext.text = Localization.instance.Get("START"); lbCoins.text = Localization.instance.Get("Coins"); lbSettings.text = Localization.instance.Get("Settings"); lbSelectLevel.text = Localization.instance.Get("SelectLevel"); lbGetCoins.text = Localization.instance.Get("GetCoins"); lbCostBrakes.text = Localization.instance.Get("CostBrakes"); lbBrakes.text = Localization.instance.Get("Brakes"); lbBrakesOf.text = Localization.instance.Get("Of"); lbBrakesUpgrade.text = Localization.instance.Get("Upgrade"); lbtitleBrakes.text = Localization.instance.Get("titleBrakes"); lbCostSteering.text = Localization.instance.Get("CostBrakes"); lbSteering.text = Localization.instance.Get("Steering"); lbSteeringOf.text = Localization.instance.Get("Of"); lbSteeringUpgrade.text = Localization.instance.Get("Upgrade"); lbtitleSteering.text = Localization.instance.Get("titleSteering"); lbCostTires.text = Localization.instance.Get("CostBrakes"); lbTires.text = Localization.instance.Get("Tires"); lbTiresOf.text = Localization.instance.Get("Of"); lbTiresUpgrade.text = Localization.instance.Get("Upgrade"); lbtitleTires.text = Localization.instance.Get("titleTires"); lbCostEngine.text = Localization.instance.Get("CostBrakes"); lbEngine.text = Localization.instance.Get("Engine"); lbEngineOf.text = Localization.instance.Get("Of"); lbEngineUpgrade.text = Localization.instance.Get("Upgrade"); lbtitleEngine.text = Localization.instance.Get("titleEngine"); // Debug.LogError("ConstantsNew.CURRENT_VEHICLE="+ConstantsNew.CURRENT_VEHICLE); lbBrakesCurrentUpgradeCost.text = VehicleManager.vehicleArray[UserPrefs.currentVehicle - 1].brakeUpgradePrice[VehicleManager.vehicleArray[ConstantsNew.CURRENT_VEHICLE - 1].brakeCurrentUpgradeLevel - 1].ToString(); lbBrakesCurrentUpgradeValue.text = VehicleManager.vehicleArray[UserPrefs.currentVehicle - 1].brakeCurrentUpgradeLevel.ToString(); lbBrakesTotalUpgradeValue.text = VehicleManager.vehicleArray[UserPrefs.currentVehicle - 1].brakeTotalUpgradeLevel.ToString(); lbSteeringCurrentUpgradeCost.text = VehicleManager.vehicleArray[UserPrefs.currentVehicle - 1].steeringUpgradePrice[VehicleManager.vehicleArray[ConstantsNew.CURRENT_VEHICLE - 1].steeringCurrentUpgradeLevel - 1].ToString(); lbSteeringCurrentUpgradeValue.text = VehicleManager.vehicleArray[UserPrefs.currentVehicle - 1].steeringCurrentUpgradeLevel.ToString(); lbSteeringTotalUpgradeValue.text = VehicleManager.vehicleArray[UserPrefs.currentVehicle - 1].steeringTotalUpgradeLevel.ToString(); lbTiresCurrentUpgradeCost.text = VehicleManager.vehicleArray[UserPrefs.currentVehicle - 1].tiresUpgradePrice[VehicleManager.vehicleArray[ConstantsNew.CURRENT_VEHICLE - 1].tiresCurrentUpgradeLevel - 1].ToString(); lbTiresCurrentUpgradeValue.text = VehicleManager.vehicleArray[UserPrefs.currentVehicle - 1].tiresCurrentUpgradeLevel.ToString(); lbTiresTotalUpgradeValue.text = VehicleManager.vehicleArray[UserPrefs.currentVehicle - 1].tiresTotalUpgradeLevel.ToString(); lbEngineCurrentUpgradeCost.text = VehicleManager.vehicleArray[UserPrefs.currentVehicle - 1].engineUpgradePrice[VehicleManager.vehicleArray[ConstantsNew.CURRENT_VEHICLE - 1].engineCurrentUpgradeLevel - 1].ToString(); //lbEngineCurrentUpgradeValue.text = VehicleManager.vehicleArray[UserPrefs.currentVehicle-1].engineCurrentUpgradeLevel.ToString(); Debug.Log("aaa=" + VehicleManager.vehicleArray[UserPrefs.currentVehicle - 1].engineCurrentUpgradeLevel.ToString()); lbEngineTotalUpgradeValue.text = VehicleManager.vehicleArray[UserPrefs.currentVehicle - 1].engineTotalUpgradeLevel.ToString(); lbCoins.text = string.Format("{0:#,###0}", UserPrefs.totalCoins); }
// Use this for initialization void Start() { object_rigid_body = this.GetComponent <Rigidbody>(); if (transform.childCount > 0) { foreach (Transform child in transform) { children.Add(child.gameObject); } } //Debug.Log("Got children"); if (GameObject.Find("SceneDirector")) { saver = GameObject.Find("SceneDirector").GetComponent <SaveandLoad>(); } else { Debug.Log("Scene Director not present in this scene"); } }
// Use this for initialization void Start() { //Add rocket engines & sparks rocket_glow = Instantiate((GameObject)Resources.Load("RocketStack"), transform.position, transform.rotation, transform); rocket_sparks = Instantiate((GameObject)Resources.Load("PS_Engine_Sparks"), transform.position, transform.rotation, transform); rocket_sparks.transform.localPosition += new Vector3(0, 0, 2.1f); //Add rocket particle effects rocket_trail = Instantiate((GameObject)Resources.Load("Rocket"), transform.position, transform.rotation, transform); rocket_trail.transform.localPosition += new Vector3(0, 0, 5.42f); rocket_trail.SetActive(false); //explosion effects explosion = (GameObject)Resources.Load("Single_Firework_Blue"); //sushi becomes zero g sushi_body = GetComponent <Rigidbody>(); sushi_body.useGravity = false; glows = new List <GameObject>(); foreach (Transform rocket in rocket_glow.transform) { foreach (Transform child in rocket) { if (child.gameObject.name.Contains("Disc_1")) { glows.Add(child.gameObject); child.gameObject.SetActive(false); } } } rocket_time = 0; speed = 0; max_rocket_time += pause_time; //speed = transform.forward; saver = GameObject.Find("SceneDirector").GetComponent <SaveandLoad>(); }
public static void purchaseSteerUpgrade() { int coinsRequire = VehicleManager.vehicleArray[(UserPrefs.currentVehicle - 1)].steeringUpgradePrice[VehicleManager.vehicleArray[(UserPrefs.currentVehicle - 1)].steeringCurrentUpgradeLevel - 1]; GAManager.Instance.LogDesignEvent("steeringUpgrade"); GameManager.Instance.SubtractCoins(coinsRequire); // GameObject.FindGameObjectWithTag("VehicleUpgradeMenu").GetComponent<UpgradeMenuLocalize>().lbCoins.text = UserPrefs.totalCoins.ToString(); updateCoins(); VehicleManager.vehicleArray[(UserPrefs.currentVehicle - 1)].steeringCurrentUpgradeLevel++; if (VehicleManager.vehicleArray[(UserPrefs.currentVehicle - 1)].steeringCurrentUpgradeLevel == VehicleManager.vehicleArray[(UserPrefs.currentVehicle - 1)].steeringTotalUpgradeLevel) { GameObject.FindGameObjectWithTag("btnUpgradeSteering").SetActive(false); GameObject.FindGameObjectWithTag("VehicleUpgradeMenu").GetComponent <UpgradeMenuLocalize>().lbSteeringCurrentUpgradeValue.text = VehicleManager.vehicleArray[(UserPrefs.currentVehicle - 1)].steeringCurrentUpgradeLevel.ToString(); GameObject.FindGameObjectWithTag("VehicleUpgradeMenu").GetComponent <UpgradeMenuLocalize>().lbSteeringCurrentUpgradeCost.text = "0"; } else { GameObject.FindGameObjectWithTag("VehicleUpgradeMenu").GetComponent <UpgradeMenuLocalize>().lbSteeringCurrentUpgradeValue.text = VehicleManager.vehicleArray[(UserPrefs.currentVehicle - 1)].steeringCurrentUpgradeLevel.ToString(); //GameObject.FindGameObjectWithTag("VehicleUpgradeMenu").GetComponent<UpgradeMenuLocalize>().lbSteeringCurrentUpgradeCost.text = VehicleManager.vehicleArray[(UserPrefs.currentVehicle-1)].steeringUpgradePrice[ VehicleManager.vehicleArray[(UserPrefs.currentVehicle-1)].steeringCurrentUpgradeLevel-1 ].ToString(); } SaveandLoad.Save(); }
void UpgradeBrake() { Debug.Log("upgrade brake "); int coinsRequire = VehicleManager.vehicleArray[ConstantsNew.CURRENT_VEHICLE - 1].brakeUpgradePrice[VehicleManager.vehicleArray[ConstantsNew.CURRENT_VEHICLE - 1].brakeCurrentUpgradeLevel - 1]; if (UserPrefs.totalCoins > coinsRequire) { GameManager.Instance.SubtractCoins(coinsRequire); GameObject.FindGameObjectWithTag("UpgradeMenu").GetComponent <UpgradeMenuLocalize>().lbCoins.text = UserPrefs.totalCoins.ToString(); VehicleManager.vehicleArray[ConstantsNew.CURRENT_VEHICLE - 1].brakeCurrentUpgradeLevel++; if (VehicleManager.vehicleArray[ConstantsNew.CURRENT_VEHICLE - 1].brakeCurrentUpgradeLevel == VehicleManager.vehicleArray[ConstantsNew.CURRENT_VEHICLE - 1].brakeTotalUpgradeLevel) { GameObject.FindGameObjectWithTag("btnUpgradeBrakes").SetActive(false); GameObject.FindGameObjectWithTag("UpgradeMenu").GetComponent <UpgradeMenuLocalize>().lbBrakesCurrentUpgradeValue.text = VehicleManager.vehicleArray[ConstantsNew.CURRENT_VEHICLE - 1].brakeCurrentUpgradeLevel.ToString(); GameObject.FindGameObjectWithTag("UpgradeMenu").GetComponent <UpgradeMenuLocalize>().lbBrakesCurrentUpgradeCost.text = "0"; } else { GameObject.FindGameObjectWithTag("UpgradeMenu").GetComponent <UpgradeMenuLocalize>().lbBrakesCurrentUpgradeValue.text = VehicleManager.vehicleArray[ConstantsNew.CURRENT_VEHICLE - 1].brakeCurrentUpgradeLevel.ToString(); GameObject.FindGameObjectWithTag("UpgradeMenu").GetComponent <UpgradeMenuLocalize>().lbBrakesCurrentUpgradeCost.text = VehicleManager.vehicleArray[ConstantsNew.CURRENT_VEHICLE - 1].brakeUpgradePrice[VehicleManager.vehicleArray[ConstantsNew.CURRENT_VEHICLE - 1].brakeCurrentUpgradeLevel - 1].ToString(); } } SaveandLoad.Save(); }
// Start is called before the first frame update void Start() { saver = GameObject.Find("SceneDirector").GetComponent <SaveandLoad>(); dishtemplate = GameObject.Find("SauceDishTemplate"); }
// Start is called before the first frame update void Start() { saver = GameObject.Find("SceneDirector").GetComponent <SaveandLoad>(); }