private void Awake() { self = this; visuals = GetComponent <gamestateVisuals>(); camShaker = Camera.main.GetComponent <cameraShake>(); gameTimer = self.gameTime; }
void Start() { shake = Camera.main.GetComponent <cameraShake> (); col = gameObject.GetComponent <SpriteRenderer> ().color; small_astroid = Resources.Load("Prefabs/Enemies/small_astroid") as GameObject; medium_astroid = Resources.Load("Prefabs/Enemies/medium_astroid") as GameObject; large_astroid = Resources.Load("Prefabs/Enemies/large_astroid") as GameObject; }
void Start() { camShake = GameScript.gm.GetComponent <cameraShake> (); if (camShake == null) { Debug.LogError("No Camera Shake"); } }
} //Easier to debug void Start() { camShake = GameScript.gm.GetComponent <cameraShake> (); if (camShake == null) { Debug.LogError("No Camera Shake"); //Get camera shake component, if not found, return error } }
void Start() { dashTime = startDashTime; currentState = "Idle"; SetCharacterState(currentState); SceneIndex = SceneManager.GetActiveScene().buildIndex; cameraShake = GameObject.Find("CameraControllerContainer").GetComponent <cameraShake>(); //Infoscript.instance.UpdateDashAmulette(); }
// Start is called before the first frame update void Start() { bulletDir = Camera.main.ScreenToWorldPoint(Input.mousePosition) - transform.position; bulletDir.z = 0; bulletDir.Normalize(); cameraShake = GameObject.Find("Main Camera").GetComponent <cameraShake>(); Destroy(gameObject, 3f); }
// Use this for initialization void Start() { crate = GameObject.Find("crate1"); cratesound1 = GetComponent <AudioSource>(); cameraShake = new cameraShake(); fx_fire_a = GetComponent <ParticleSystem>(); inputGiven = false; speed = 0.5f; }
void Start() { camShake = GameScript.gm.GetComponent <cameraShake> (); if (camShake == null) { Debug.LogError("No Camera Shake"); //Checks if camShake has a value } firePointBoss = transform.Find("firePointBoss"); //Find the firePos object if (firePointBoss == null) { Debug.LogError("No Fire Point for boss"); //Return an error if not found } }
private void Start() { //progressManager = GameObject.Find("ProgressManager").GetComponent<ProgressSave>(); //HealthPoints = progressManager.playerHP; //maxDash = progressManager.playerMaxdash; currDash = maxDash; //Infoscript.instance.UpdateHealthpoints(); //Infoscript.instance.UpdateDashAmulette(); cameraShake = GameObject.Find("CameraControllerContainer").GetComponent <cameraShake>(); ProgressCollectables = GameObject.Find("CollectablesProgress").GetComponent <NoDestruction>(); Infoscript.instance.UpdateDashAmulette(); }
void Start() { //NEW CODE HERE GameObject shieldControllerObject = GameObject.FindWithTag("ShieldController"); GameObject playerHealthObject = GameObject.FindWithTag("Health"); GameObject gameControllerObject = GameObject.FindWithTag("GameController"); GameObject shotSpawnObject = GameObject.FindWithTag("ShotSpawn"); GameObject camShakeControllerObject = GameObject.FindWithTag("MainCamera"); if (gameControllerObject != null) { gameController = gameControllerObject.GetComponent <GameController>(); camShake = camShakeControllerObject.GetComponent <cameraShake>(); } if (playerHealthObject != null) { playerHealth = playerHealthObject.GetComponent <PlayerHealth>(); } if (shieldControllerObject != null) { shieldController = shieldControllerObject.GetComponent <ShieldController>(); } if (shotSpawnObject != null) { shotSpawnController = shotSpawnObject.GetComponent <ShotSpawn>(); } fileName = "shoot"; file = new FileInfo(Application.persistentDataPath + "\\" + fileName + ".txt"); //LoadShot(); if (PlayerPrefs.HasKey("Shot")) { loadedFireType = PlayerPrefs.GetInt("Shot"); } else { loadedFireType = 1; } fireType = loadedFireType; rigidBody = gameObject.GetComponent <Rigidbody2D>(); }
public void Die() { Global pg = GameObject.FindGameObjectWithTag("FGlobal").GetComponent <Global>(); if (pg.playerlifeGlobal == 3) { Instantiate(explosion, gameObject.transform.position, Quaternion.identity); AudioSource.PlayClipAtPoint(deathclip, gameObject.transform.position, 20); RawImage pi = GameObject.FindGameObjectWithTag("lifeimg1").GetComponent <RawImage>(); pi.color = Color.red; pg.playerlifeGlobal--; gameObject.transform.transform.position = new Vector3(0, 0, -13.2f); cameraShake cs = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <cameraShake>(); cs.shouldShake = true; } else if (pg.playerlifeGlobal == 2) { Instantiate(explosion, gameObject.transform.position, Quaternion.identity); AudioSource.PlayClipAtPoint(deathclip, gameObject.transform.position, 20); RawImage pi = GameObject.FindGameObjectWithTag("lifeimg2").GetComponent <RawImage>(); pi.color = Color.red; pg.playerlifeGlobal--; gameObject.transform.transform.position = new Vector3(0, 0, -13.2f); cameraShake cs = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <cameraShake>(); cs.shouldShake = true; } else if (pg.playerlifeGlobal == 1) { playertime = 0; Instantiate(explosion, gameObject.transform.position, Quaternion.identity); AudioSource.PlayClipAtPoint(deathclip, gameObject.transform.position, 20); RawImage pi = GameObject.FindGameObjectWithTag("lifeimg3").GetComponent <RawImage>(); pi.color = Color.red; pg.playerlifeGlobal--; cameraShake cs = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <cameraShake>(); cs.shouldShake = true; GetComponent <Renderer>().enabled = !GetComponent <Renderer>().enabled; jetsrc sss = GameObject.FindGameObjectWithTag("playerengine").GetComponent <jetsrc>(); sss.Die(); StartCoroutine(LoadLevelAfterDelay(1.0f)); //SceneManager.LoadScene("gameover"); } }
// Start is called before the first frame update private void Start() { shake = GameObject.FindGameObjectWithTag("CameraShake").GetComponent <cameraShake>(); playerController = GameObject.FindWithTag("Player"); if (playerController != null) { pc = playerController.GetComponent <playerController>(); } if (pc.facingRight == true) { orientation = 1; } else { orientation = -1; } Invoke("destroyProjectile", duration); }
// Start is called before the first frame update void Start() { anim = GetComponent <Animator>(); rb = GetComponent <Rigidbody2D>(); shake = GameObject.FindGameObjectWithTag("CameraShake").GetComponent <cameraShake>(); dashTime = startDashTime; originalSpeed = speed; lowHealthColor = new Color(0.53725490196f, 0.21176470588f, 0.21176470588f, 1.0f); //sets collectible amount in UI and reads from playerprefs if (collectibleExists == true) { collectibleCounter.text = PlayerPrefs.GetFloat(collectibleType).ToString() + "/" + maxCollectibles.ToString(); } collectibleCount = PlayerPrefs.GetFloat(collectibleType); if (PlayerPrefs.GetFloat("health") > 0) { health = PlayerPrefs.GetFloat("health"); } }
public override void star() { shake = cameraShake.instance; }
void Start() { cameraShake = GameObject.Find("Main Camera").GetComponent <cameraShake>(); }
void Awake() { instance = this; }
void Start() { instance = this; }
// Use this for initialization void Awake() { score = GameObject.Find("Player").GetComponent <PlayerClass> (); sez = GameObject.Find("Main Camera").GetComponent <cameraShake> (); //prefab = Resources.Load ("Prefabs/explosion") as GameObject; }
void Start() { //NEW CODE HERE GameObject shieldControllerObject = GameObject.FindWithTag("ShieldController"); GameObject playerHealthObject = GameObject.FindWithTag("Health"); GameObject gameControllerObject = GameObject.FindWithTag("GameController"); GameObject shotSpawnObject = GameObject.FindWithTag("ShotSpawn"); GameObject camShakeControllerObject = GameObject.FindWithTag("MainCamera"); if (gameControllerObject != null) { gameController = gameControllerObject.GetComponent<GameController>(); camShake = camShakeControllerObject.GetComponent<cameraShake>(); } if (playerHealthObject!=null) { playerHealth = playerHealthObject.GetComponent<PlayerHealth>(); } if (shieldControllerObject != null) { shieldController = shieldControllerObject.GetComponent<ShieldController>(); } if (shotSpawnObject != null) { shotSpawnController = shotSpawnObject.GetComponent<ShotSpawn>(); } fileName = "shoot"; file = new FileInfo(Application.persistentDataPath + "\\" + fileName + ".txt"); //LoadShot(); if (PlayerPrefs.HasKey("Shot")) { loadedFireType = PlayerPrefs.GetInt("Shot"); } else { loadedFireType = 1; } fireType = loadedFireType; rigidBody = gameObject.GetComponent<Rigidbody2D>(); }
public static cameraShake instance; // creates a new instance of this class, we make this static so that we can access it from outside of this class without needing a reference #endregion #region Constructor public cameraShake() { instance = this; // initialises the variable "instance" to this class }