// Use this for initialization void Start () { GameObject gui = GameObject.FindGameObjectWithTag ("_gui_"); if(gui != null){ my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); } /*int health = StoreInventory.GetItemBalance ("health"); if (health != 0) { healtcount = StoreInventory.GetItemBalance ("health"); } int healthx2 = StoreInventory.GetItemBalance ("healthx2"); int healtcountx2 = 0; if (healthx2 != 0) { healtcount = StoreInventory.GetItemBalance ("healthx2"); } int healthx3 = StoreInventory.GetItemBalance ("healthx3"); int healtcountx3 = 0; if (healthx3 != 0) { healtcount = StoreInventory.GetItemBalance ("healthx3"); } */ if (game_master.game_master_obj) my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master"); }
void Awake() { if (Application.loadedLevelName != "Home") { my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent <game_uGUI>(); } }
void Awake() { if (SceneManager.GetActiveScene().name != "Home") { my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent <game_uGUI>(); } }
// Use this for initialization void Start() { if (game_master.game_master_obj) { my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master"); //selet the rule if (virtual_money_cost <= 0) { if (my_game_master.my_ads_master.ads_when_reach_a_check_point.this_ad_is_enabled) { activation_cost_selected = activation_cost.unity_ad; } else { activation_cost_selected = activation_cost.free; } } else //can use money to activate the checkpoint { if (my_game_master.my_ads_master.ads_when_reach_a_check_point.this_ad_is_enabled) { activation_cost_selected = activation_cost.virtual_money_or_unity_ad; } //else //activation_cost_selected = activation_cost.virtual_money; } } my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent <game_uGUI>(); checkpoint_triggered = false; checkpoint_enabled = false; //base_color = GetComponent<Renderer>().material.color; }
void OnCollisionEnter2D(Collision2D collision) { //if(collision.gameObject.GetComponent<Rigidbody>().name != "Cube 1"){ // if(collision.gameObject.GetComponent<Rigidbody>().name == "front wheel"){ //objectname = GameObject.Find ("urban_zombie_mobile1"); // Vector3 zombie = transform.position; // Collider[] colliders = Physics.OverlapSphere (zombie, radius); // foreach (Collider hit in colliders) { //for loop that says if we hit any colliders, then do the following below GameObject gui = GameObject.FindGameObjectWithTag ("_gui_"); if(gui != null){ my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); } if (collision.gameObject.name == ObjectToCollided) { makeclick Achievement = new makeclick(); Achievement.SENDACHIEVEMENTINCREMENT(INCREMENTAL_ACHIEVEMENT_ID_Veteran,1); Achievement.SENDACHIEVEMENTINCREMENT(INCREMENTAL_ACHIEVEMENT_ID_Assassin,1); Achievement.SENDACHIEVEMENTINCREMENT(INCREMENTAL_ACHIEVEMENT_ID_Sergeant,1); my_game_uGUI.Update_int_score(points); /* if (!game_uGUI.in_pause) { my_game_uGUI.my_progress_bar.Add_to_fill(quantity); if (my_game_uGUI.star_number<3) { my_game_uGUI.Add_stars(1); } //this.gameObject.SetActive(false); }*/ if(sound){ sound.Play(); } Hit.transform.position = body.transform.position; Hit.SetActive (true); Instantiate (Hit); // CFX_SpawnSystem.Instantiate (Hit); Blood.transform.position = body.transform.position; Blood.SetActive (true); Instantiate (Blood); if (Object != null) { Destroy (Object); Hit.SetActive (false); Blood.SetActive (false); } } }
void Start() { GameObject gui = GameObject.FindGameObjectWithTag ("_gui_"); if(gui != null){ my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); } }
void Start () { Hit.SetActive (false); Blood.SetActive (false); this.gameObject.SetActive(true); GameObject gui = GameObject.FindGameObjectWithTag ("_gui_"); if(gui != null){ my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); } }
public void Start_me(game_uGUI script) { my_game_uGUI = script; for (int i = 0; i < 3; i++) { //reset sprites star_sprites[i].sprite = star_off; //set stars positions star_slider[i].maxValue = star_target_values[2]; star_slider[i].value = star_target_values[i]; //reset fill main_slider.maxValue = star_target_values[2]; main_slider.value = 0; } }
public void Start_me (game_uGUI script) { my_game_uGUI = script; for (int i = 0; i < 3; i++) { //reset sprites star_sprites[i].sprite = star_off; //set stars positions star_slider[i].maxValue = star_target_values[2]; star_slider[i].value = star_target_values[i]; //reset fill main_slider.maxValue = star_target_values[2]; main_slider.value = 0; } }
// Use this for initialization void Start () { endTime = Time.time + endTime; count = 0; count2 = 0; distance = 0; // gameObject.GetComponent<Rigidbody2D>().isKinematic = false; GameObject gui = GameObject.FindGameObjectWithTag ("_gui_"); if(gui != null){ my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); } zombiedead=false; // anim = GetComponent<Animator>(); }
void Start() { count = 0; GameObject gui = GameObject.FindGameObjectWithTag ("_gui_"); if(gui != null){ my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); } //my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); finish = false; winText = GameObject.Find ("win text").GetComponent<GUIText>(); crashText = GameObject.Find ("crash text").GetComponent<GUIText>(); winText.enabled = false; crashText.enabled = false; //change text colors winText.material.color = winTextColor; crashText.material.color = crashTextColor; //ignoring collision between biker's bodytrigger and motorcycle body //Physics.IgnoreCollision (this.GetComponent<Collider>(), transform.parent.GetComponent<Collider>()); //add new audio sources and add audio clips to them, used to play sounds bonesCrackSC = gameObject.AddComponent<AudioSource>(); hitSC = gameObject.AddComponent<AudioSource>(); oohCrowdSC = gameObject.AddComponent<AudioSource>(); bonesCrackSC.playOnAwake = false; hitSC.playOnAwake = false; oohCrowdSC.playOnAwake = false; bonesCrackSC.rolloffMode = AudioRolloffMode.Linear; hitSC.rolloffMode = AudioRolloffMode.Linear; oohCrowdSC.rolloffMode = AudioRolloffMode.Linear; bonesCrackSC.clip = bonesCrackSound; hitSC.clip = hitSound; oohCrowdSC.clip = oohCrowdSound; //-------------------------------------------------- }
// Use this for initialization void Start () { GameObject gui = GameObject.FindGameObjectWithTag ("_gui_"); if(gui != null){ my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); } bonesCrackSC = gameObject.AddComponent<AudioSource>(); hitSC = gameObject.AddComponent<AudioSource>(); oohCrowdSC = gameObject.AddComponent<AudioSource>(); bonesCrackSC.playOnAwake = false; hitSC.playOnAwake = false; oohCrowdSC.playOnAwake = false; bonesCrackSC.rolloffMode = AudioRolloffMode.Linear; hitSC.rolloffMode = AudioRolloffMode.Linear; oohCrowdSC.rolloffMode = AudioRolloffMode.Linear; bonesCrackSC.clip = bonesCrackSound; hitSC.clip = hitSound; oohCrowdSC.clip = oohCrowdSound; }
// Use this for initialization void Start() { this.gameObject.SetActive(true); my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent <game_uGUI>(); }
// Use this for initialization void Start() { if (game_master.game_master_obj) { my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master"); //selet the rule if (virtual_money_cost <= 0) { if (my_game_master.my_ads_master.ads_when_reach_a_check_point.this_ad_is_enabled) activation_cost_selected = activation_cost.unity_ad; else activation_cost_selected = activation_cost.free; } else //can use money to activate the checkpoint { if (my_game_master.my_ads_master.ads_when_reach_a_check_point.this_ad_is_enabled) activation_cost_selected = activation_cost.virtual_money_or_unity_ad; //else //activation_cost_selected = activation_cost.virtual_money; } } my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); checkpoint_triggered = false; checkpoint_enabled = false; //base_color = GetComponent<Renderer>().material.color; }
// Use this for initialization void Start() { current_game_uGUI = this; my_options = options_screen.GetComponent <options_menu>(); normal_emoticon = perfect_target.sprite; if (game_master.game_master_obj) { my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master"); my_game_master.my_ads_master.my_game_uGUI = this; } if (my_game_master) { //set ads gui my_game_master.my_ads_master.Initiate_ads(); my_game_master.my_ads_master.my_feedback_window = my_feedback_window; my_game_master.my_ads_master.my_gift_manager = my_gift_manager; my_gift_manager.my_game_master = my_game_master; //star score if (!ignore_game_master_preferences) { show_star_score = my_game_master.show_star_score; show_progress_bar = my_game_master.show_progres_bar; //int score show_int_score = my_game_master.show_int_score; } show_stage_record = my_game_master.show_int_score_stage_record_in_game_stage; if (my_game_master.score_name != "") { int_score_ico.GetComponent <Text>().text = my_game_master.score_name; } if (!ignore_game_master_preferences) { show_debug_messages = my_game_master.show_debug_messages; show_debug_warnings = my_game_master.show_debug_warnings; } if (my_game_master.use_same_scene_for_all_stages_in_the_same_world) { n_stage = my_game_master.current_stage; } my_game_master.latest_stage_played_world[my_game_master.current_profile_selected] = n_world; my_game_master.latest_stage_played_stage[my_game_master.current_profile_selected] = n_stage; my_game_master.current_world[my_game_master.current_profile_selected] = n_world - 1; } else { temp_score_name = win_screen_int_score_title.text; if (show_debug_warnings) { Debug.LogWarning("In order to allow saves and play music and menu sfx, you must star from Home scene and open this stage using the in game menu"); } } //star score if (show_star_score) { star_container.SetActive(true); } else { show_star_count = false; star_container.SetActive(false); } if (show_progress_bar) { my_progress_bar.Start_me(this); my_progress_bar.gameObject.SetActive(true); } else { my_progress_bar.gameObject.SetActive(false); } //int score if (show_int_score) { int_score_ico.SetActive(true); } else { int_score_ico.SetActive(false); } Reset_me(); }
//Transform myTransform; //current transform data of this enemy void Start () { count = 0; distance = 0; gameObject.GetComponent<Rigidbody2D>().isKinematic = false; GameObject gui = GameObject.FindGameObjectWithTag ("_gui_"); if(gui != null){ my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); } zombiedead=false; anim = GetComponent<Animator>(); rb2d = GetComponent<Rigidbody2D>(); Flip (); if(gameObject.tag =="ZombieFat"){ gameObject.GetComponent<Rigidbody2D>().mass =0.2f; } if(gameObject.tag =="Zombie"){ gameObject.GetComponent<Rigidbody2D>().mass =0.01f; } if(gameObject.tag =="ZombieMid"){ gameObject.GetComponent<Rigidbody2D>().mass =1f; } //this.originalX = this.transform.position.x; /* yRotation += Input.GetAxis("Horizontal"); //transform.eulerAngles = new Vector2(0, 360); transform.eulerAngles = new Vector2(360,0);*/ /*walkingDirection = 1.0f; wallLeft = transform.position.x - wallLeft; wallRight = transform.position.x + wallRight;*/ }
void Awake() { if (Application.loadedLevelName != "Home") my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); }
void Start() { isFinish = false; if(GooglePlayConnection.State == GPConnectionState.STATE_CONNECTED) { //GooglePlayConnection.Instance.Disconnect (); } else { GooglePlayConnection.Instance.Connect (); } //SpeedMotorMobile = SpeedMotorMobile + 10; if (this.name == "super_bike(Clone)") { AuraModular = GameObject.Find ("AuraModular"); AuraModular.SetActive (false); GroundModular2 = GameObject.Find ("GroundModular2"); GroundModular2.SetActive (false); } if (this.name == "party_bike(Clone)") { SpinningModular = GameObject.Find ("SpinningModular"); SpinningModular.SetActive (false); SpinningModular2 = GameObject.Find ("SpinningModular (1)"); SpinningModular2.SetActive (false); } if (this.name == "nightmare_bike(Clone)") { SkullRotate = GameObject.Find ("SkullRotate"); SkullRotate.SetActive (false); } if (this.name == "monster_bike(Clone)") { LifeImpact1 = GameObject.Find ("LifeImpact1"); LifeImpact1.SetActive (false); LifeImpact2 = GameObject.Find ("LifeImpact2"); LifeImpact2.SetActive (false); } if (this.name == "hell_bike(Clone)") { SpinningFire = GameObject.Find ("SpinningFire (2)"); SpinningFire.SetActive (false); SpinningFire1 = GameObject.Find ("SpinningFire (1)"); SpinningFire1.SetActive (false); } if (SelectedCharacter.super_bike_effect) { if(this.name == "super_bike(Clone)"){ AuraModular.SetActive(true); GroundModular2.SetActive (true); } } if (SelectedCharacter.party_effect) { if(this.name == "party_bike(Clone)"){ SpinningModular.SetActive(true); SpinningModular2.SetActive(true); } } if (SelectedCharacter.nightmare_effect) { if(this.name == "nightmare_bike(Clone)"){ SkullRotate.SetActive(true); } } if (SelectedCharacter.monster_effect) { if(this.name == "monster_bike(Clone)"){ LifeImpact1.SetActive(true); LifeImpact2.SetActive(true); } } if (SelectedCharacter.neon_effect) { if(this.name == "neon_bike(Clone)"){ GameObject.Find ("Main Camera").GetComponent<GlowEffect.GlowEffect> ().enabled = true; } } else { if(this.name == "neon_bike(Clone)"){ GameObject.Find ("Main Camera").GetComponent<GlowEffect.GlowEffect> ().enabled = false; } } if (SelectedCharacter.hell_effect) { if(this.name == "hell_bike(Clone)"){ SpinningFire.SetActive(true); SpinningFire1.SetActive(true); } } //Motorcycle_Controller2D.checkpoint = false; GameObject gui = GameObject.FindGameObjectWithTag ("_gui_"); if(gui != null){ my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); } if (!testing) { if (my_game_uGUI) { int health = StoreInventory.GetItemBalance ("health"); if (health != 0) { healtcount = StoreInventory.GetItemBalance ("health"); } int healthx2 = StoreInventory.GetItemBalance ("healthx2"); int healtcountx2 = 0; if (healthx2 != 0) { healtcount = StoreInventory.GetItemBalance ("healthx2"); } int healthx3 = StoreInventory.GetItemBalance ("healthx3"); int healtcountx3 = 0; if (healthx3 != 0) { healtcount = StoreInventory.GetItemBalance ("healthx3"); } virtualmoneycount = virtualmoneycount + StoreInventory.GetItemBalance (StoreInfo.Currencies [0].ItemId); //my_game_uGUI.Update_lives (healtcount); my_game_uGUI.Update_virtual_money (virtualmoneycount); } } crashBurned = false; crashDrown = false; crashDrowned = false; time =0; ifnitro = false; /*if (GameObject.Find ("smoke_effect_purple(Clone)")) { effect = GameObject.Find ("smoke_effect_purple(Clone)"); effectstatic = effect; } if (GameObject.Find ("blood_effect(Clone)")) { effect = GameObject.Find ("blood_effect(Clone)"); effectstatic = effect; } if (GameObject.Find ("fire_effect(Clone)")) { effect = GameObject.Find ("fire_effect(Clone)"); effectstatic = effect; } if (GameObject.Find ("ice_effect(Clone)")) { effect = GameObject.Find ("ice_effect(Clone)"); effectstatic = effect; } if (GameObject.Find ("electric_effect(Clone)")) { effect = GameObject.Find ("electric_effect(Clone)"); effectstatic = effect; } if (GameObject.Find ("wave_effect(Clone)")) { effect = GameObject.Find ("wave_effect(Clone)"); effectstatic = effect; } if (GameObject.Find ("neon_effect(Clone)")) { effect = GameObject.Find ("neon_effect(Clone)"); effectstatic = effect; } */ if (GameObject.Find ("nitro_effect")) { effectnitro = GameObject.Find ("nitro_effect"); effectnitrostatic = effectnitro; } if (GameObject.Find ("burn_effect")) { effectburn = GameObject.Find ("burn_effect"); } effect = GameObject.Find ("fire_effect"); effectstatic = effect; GetComponent<AudioSource>().pitch = StartingPitch; GetComponent<AudioSource>().volume = 1.0f; BodyCarStatic = Car; CarBodyStatic = CarBody; PoliStatic = Poli; HelmetStatic = helmet; rightarmStatic = rightHand; leftarmStatic = leftHand; legStatic = leg; trunkStatic = trunk; CarBodyTransformStatic = CarBodyTransform; frontWheelStatic = frontWheelObject; backWheelStatic = backWheelObject; if(useUpgrade){ UpgradeInventory (); } nubes = GameObject.Find ("Nubes"); edif2 = GameObject.Find ("edif 2"); humo = GameObject.Find ("humo"); edif1 = GameObject.Find ("edif 1"); /* CarBody = GameObject.Find("Body2D"); CenterOfMass = GameObject.Find("CoM2D"); Smoke = GameObject.Find("Smoke"); Ensemble = GameObject.Find("Ensemble2D"); */ endTime = Time.time + endTime; crashSaw = false; crashSawHead = false; crash = false; crashed = false; isControllable = true; mobileButtons = GameObject.Find ("mobile buttons").transform; throttleTexture = mobileButtons.FindChild ("throttle").GetComponent<GUITexture>(); brakeTexture = mobileButtons.FindChild ("brake").GetComponent<GUITexture>(); leftTexture = mobileButtons.FindChild ("left").GetComponent<GUITexture>(); rightTexture = mobileButtons.FindChild("right").GetComponent<GUITexture>(); backflipParticle = GameObject.Find ("backflip particle").GetComponent<ParticleSystem>(); frontflipParticle = GameObject.Find ("frontflip particle").GetComponent<ParticleSystem>(); scoreText = GameObject.Find ("score text").GetComponent<GUIText>(); scoreText.text = "SCORE : " + score; //change score text color scoreText.material.color = scoreTextColor; Camera.main.GetComponent<CameraFollow2D>().target = CarBody.transform; audioSource = Car.GetComponent<AudioSource>(); //ORIGINAL 2D MOTOR CarMoveLeft = false; CarMoveRight = false; CarHandbrake = false; CarFlip = false; Reset = false; //axisH = 0; axisV = 0.2f; //Center of mass CarBody.GetComponent<Rigidbody2D>().centerOfMass = CenterOfMass.transform.localPosition; //Get radius for each wheel for(var i = 0; i <= (Wheels.Length-1); i++) { WheelRadius[i] = Wheels[i].GetComponent<CircleCollider2D>().radius; } if (lastcheckpoint) { //if ((Input.GetKeyDown (KeyCode.C) || (Input.touchCount > 0 && Input.GetTouch (0).phase == TouchPhase.Began)) && crashed) { if (checkpoint) { //Checkpoint.Reset (); //Destroy (gameObject); Car.transform.position = lastcheckpoint.position; crash = false; crashed=false; } } //CalculateVelocity(); }
// Use this for initialization void Start() { this.gameObject.SetActive(true); my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent <game_uGUI>(); my_game_uGUI.total_collectable_stars_in_this_stage++; }
void Start () { GameObject gui = GameObject.FindGameObjectWithTag ("_gui_"); if(gui != null){ my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); } countTimes = 1; // Explotion.SetActive (false); // GameObject effect= GameObject.Find ("CFXM2_GroundWoodHit Bigger Dark"); // effect.SetActive (false); // EffectLoseGravity.SetActive (false); //EffectLoseGravity2.SetActive (false); //EffectLoseGravity3.SetActive (false); //EffectLoseGravity4.SetActive (false); }
void Start() { my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); }
void Start() { start_player_position = player.transform.position; my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); }
void Start() { start_player_position = player.transform.position; my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent <game_uGUI>(); }
// Use this for initialization void Start() { my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent <game_uGUI>(); trigger_on = true; }
void Start () { GameObject gui = GameObject.FindGameObjectWithTag ("_gui_"); if(gui != null){ my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); } countTimes = 1; if(ifShake){ cameraShake = cameraObject.GetComponent(typeof(Shake)) as Shake; } //objectShake = cubeObject.GetComponent(typeof(Shake)) as Shake; // Explotion.SetActive (false); // GameObject effect= GameObject.Find ("CFXM2_GroundWoodHit Bigger Dark"); // effect.SetActive (false); // EffectLoseGravity.SetActive (false); //EffectLoseGravity2.SetActive (false); //EffectLoseGravity3.SetActive (false); //EffectLoseGravity4.SetActive (false); }
// Use this for initialization void Start () { this.gameObject.SetActive(true); my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); }
void Start () { count = 0; distance = 0; D2D_DamageOnCollision.UsedSlowMotionActivated =false; GameObject gui = GameObject.FindGameObjectWithTag ("_gui_"); if(gui != null){ my_game_uGUI = GameObject.FindGameObjectWithTag("_gui_").GetComponent<game_uGUI>(); } countTimes = 1; if(ifShake){ cameraShake = cameraObject.GetComponent(typeof(Shake)) as Shake; } }