/* * Start is called before the first frame update */ void Start() { //initializes all of the variables that are used during execution player_script = player.GetComponent <Player_Script>(); penguin = GetComponent <Rigidbody>(); game_runner_script = FindObjectOfType <Game_Runner>(); animator = gameObject.GetComponent <Animator>(); penguin_collider = penguin.GetComponent <Collider>(); penguin.useGravity = true; penguin.isKinematic = false; max_velocity = 4.0f; has_collided_with_player = false; direction = ""; is_in_pen = false; sliding_back = false; penguin_switch_num = 4; //randomly decides which direction the penguin is facing at start int rand_walk = Random.Range(0, 1); if (rand_walk == 0) { animator.Play("walk_left"); } else { animator.Play("walk_right"); } }
// Use this for initialization void Start() { player = FindObjectOfType <Player_Script> (); shotCounter = waitBetweenShots; playerInRange = false; stunned = false; }
void Start() { if (instance == null) { instance = this; } } //end void start
///////////////////////////////////////////////////////////////// // Runs on start up ///////////////////////////////////////////////////////////////// private void Start() { // Set detector length detectorLength = GetComponent <Collider>().bounds.size.z; playerScript = playerObject.GetComponent <Player_Script>(); }
// Use this for initialization public override void Start() { base.Start(); player = FindObjectOfType(typeof(Player_Script)) as Player_Script; //Stats bar Name_Text.text = myName; Att_Text.text = attack.ToString(); HP_Text.text = health.ToString(); Def_Text.text = defence.ToString(); Stats_Bar.SetActive(true); //information board Name_Text2.text = myName; Att_Text2.text = attack.ToString(); HP_Text2.text = health.ToString(); Def_Text2.text = defence.ToString(); information_board.SetActive(false); TurnState = State.NONE; RunOnce = false; //for sleeper MaxHp = health; speed = player.speed; DesTileID = CurrentTileID; }
// Start is called before the first frame update void Start() { //setting variables at beginning enemies = GameObject.Find("Enemies").GetComponent <Transform>(); playerScript = GameObject.Find("Player").GetComponent <Player_Script>(); cameraView = GameObject.Find("Camera View").GetComponent <BoxCollider2D>(); rb = this.GetComponent <Rigidbody2D>(); clock = this.transform.GetChild(0).gameObject; visible = false; canMove = false; touchedWall = false; rb.freezeRotation = true; if (prefab) //instantiating enemies { if (playerScript.futureLevel != null && playerScript.futureLevel.activeSelf) { FutureLevel(); } else if (playerScript.businessLevel != null && playerScript.businessLevel.activeSelf) { BusinessLevel(); } else if (playerScript.leaderLevel != null && playerScript.leaderLevel.activeSelf) { LeaderLevel(); } else if (playerScript.americaLevel != null && playerScript.americaLevel.activeSelf) { AmericaLevel(); } } }
protected override void OnCantMove <T>(T component) { Player_Script hitPlayer = component as Player_Script; hitPlayer.AlterFood(-playerDamage); animator.SetTrigger("enemyAttack"); }
// Use this for initialization void Start() { // the_player = FindObjectOfType<Player_Script> (); the_player = GameObject.Find("Player_Bird").GetComponent <Player_Script> (); playerAnimation = GameObject.Find("PlayerAnimation").GetComponent <PlayerAnimation> (); isFollowing = true; lerpSpeed = 0.1f; }
// Use this for initialization void Start() { animator = this.GetComponent <Animator>(); enemyRigidbody = this.GetComponent <Rigidbody2D> (); stunned = false; player = FindObjectOfType <Player_Script> (); notInRange = false; }
// Update is called once per frame void Update() { player = GameObject.FindObjectOfType <Player_Script>(); if (player != null) { player.start_pos = this.gameObject; } }
// Start is called before the first frame update void Start() { //setting variables in scene playerRb = GameObject.Find("Player").GetComponent <Rigidbody2D>(); feet = GameObject.Find("feetPos").GetComponent <BoxCollider2D>(); clockScript = this.transform.parent.gameObject.GetComponent <Procrastination_Script>(); playerScript = GameObject.Find("Player").GetComponent <Player_Script>(); lives = GameObject.Find("Lives").transform; }
// Start is called before the first frame update void Start() { //coin_Count = 0; //all_coins = false; door_Animation = door.GetComponent <Animator>(); player = GameObject.FindGameObjectWithTag("Player"); _playerScript = player.GetComponent <Player_Script>(); }
///////////////////////////////////////////////////////////////// // Runs on start up ///////////////////////////////////////////////////////////////// private void Start() { // Lock cursor Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; // Set player script playerScript = gameObject.GetComponent <Player_Script>(); }
// Use this for initialization void Start() { maxPlayerHealth = PlayerPrefs.GetInt("PlayerCurrentLives"); playerScript = GameObject.Find("Player_Bird").GetComponent <Player_Script>(); image = GetComponent <Image> (); playerHealth = maxPlayerHealth; levelManager = FindObjectOfType <LevelManager> (); isDead = false; }
void Start() { moveSpeed = 4.10f; attackPower = 6; max_HP = 3; current_HP = max_HP; isFaceRight = true; target_Position = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>(); target = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Script>(); }
private void Awake() { dooranim = GetComponent <Animator>(); box = GetComponent <BoxCollider2D>(); player = GameObject.Find("Player").GetComponent <Player_Script>(); diamond1collected = false; diamond2collected = false; diamond3collected = false; }
// Use this for initialization void Start() { player = gameObject.GetComponent<Player_Script>(); float screenArea = Screen.width * ((1 - LightBar_Script.SCREEN_WIDTH_MULTIPLYER) * 0.3f); ButtonRegion = new Rect(Screen.width - (Screen.width * SCREEN_PADDING) - screenArea, Screen.height - (Screen.height * SCREEN_PADDING) - screenArea, screenArea, screenArea); //comment this line out to bring back the button ButtonRegion = new Rect(0,0,0,0); }
// Use this for initialization void Start() { player = FindObjectOfType <Player_Script> (); myRigidBody2D = GetComponent <Rigidbody2D> (); healthBarSwapper = FindObjectOfType <HealthBarSwapper> (); oldPlayer = player.transform.position - this.transform.position; oldPlayer.Normalize(); oldPlayer = oldPlayer * multiplier; oldPlayer = oldPlayer + this.transform.position; shot = true; }
// Start is called before the first frame update void Start() { Enemy = GetComponentInParent <Enemy_Script>(); Player = GetComponent <Player_Script>(); GameObject PlayerObject = GameObject.FindWithTag("Player"); if (PlayerObject != null) { Player = PlayerObject.GetComponent <Player_Script>(); } }
private void Start() { player = GetComponent <Player_Script>(); Respawn_Animation = GetComponent <Animator>(); GameObject PlayerObject = GameObject.FindWithTag("Player"); if (PlayerObject != null) { player = PlayerObject.GetComponent <Player_Script>(); } }
public void Stop_Rain() { //Playerの動きを止める Player_Script rein = Rain.GetComponent <Player_Script>(); Rigidbody2D rigid2D = Rain.GetComponent <Rigidbody2D>(); rigid2D.velocity = new Vector2(0, rigid2D.velocity.y); rein.enabled = false; //Debug.Log("Stop"); //3秒後に動けるようになるようにする Invoke("ReMove", 6.0f); }
// Use this for initialization void Start() { player = FindObjectOfType <Player_Script> (); mainCamera = GameObject.Find("Main Camera").GetComponent <Camera_Script> (); healthBarSwapper = FindObjectOfType <HealthBarSwapper> (); //playerStatus = GameObject.Find ("PlayerAnimation").GetComponent<PlayerAnimation> (); grappleShoot = GameObject.Find("GrapplingHookShoot").GetComponent <AudioSource> (); grappleHitVine = GameObject.Find("GrapplingHookHitVine").GetComponent <AudioSource> (); playerRunning = GameObject.Find("PlayerRunning").GetComponent <AudioSource> (); playerRunning.Play(); }
private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "Player" && E_State == EnemyState.Idle) { pscript = collision.gameObject.GetComponent <Player_Script>(); pscript.Player_State = Player_Script.PlayerState.Death; } else if (collision.gameObject.tag == "Enemy" && E_State == EnemyState.SnowBall) { Instantiate(Die_Particle, transform.position, Quaternion.identity); Destroy(collision.gameObject); } }
// Use this for initialization void Start() { player = FindObjectOfType <Player_Script> (); hidden = false; playerHere = false; // objectHeight = transform.localPosition.y + (transform.GetComponent<Renderer> ().bounds.size.y / 2); // objectLeft = transform.localPosition.x - (transform.GetComponent<Renderer> ().bounds.size.x / 2); // objectRight = transform.localPosition.x + (transform.GetComponent<Renderer> ().bounds.size.x / 2); objectHeight = transform.localPosition.y + (gameObject.transform.GetComponent <Renderer> ().bounds.size.y / 2); objectLeft = transform.localPosition.x - (gameObject.transform.GetComponent <Renderer> ().bounds.size.x / 2); objectRight = transform.localPosition.x + (gameObject.transform.GetComponent <Renderer> ().bounds.size.x / 2); Debug.Log("object Height: " + transform.localPosition.y + " + " + transform.GetComponent <Renderer> ().bounds.size.y / 2); Debug.Log("object Left: " + transform.localPosition.x + " - " + transform.GetComponent <Renderer> ().bounds.size.x / 2); Debug.Log("object Right: " + transform.localPosition.x + " + " + (transform.GetComponent <Renderer> ().bounds.size.x / 2)); // Debug.Log (transform.gameObject. }
// Start is called before the first frame update void Start() { //initializes all of the variables that are used during execution player_script = player.GetComponent <Player_Script>(); penguin = GetComponent <Rigidbody>(); anim = gameObject.GetComponent <Animation>(); game_runner_script = FindObjectOfType <Game_Runner>(); animator = gameObject.GetComponent <Animator>(); penguin_collider = penguin.GetComponent <Collider>(); penguin.useGravity = true; penguin.isKinematic = false; max_velocity = 10.0f; has_collided_with_player = false; }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); player = GetComponent <Player_Script>(); GameObject PlayerObject = GameObject.FindWithTag("Player"); if (PlayerObject != null) { player = PlayerObject.GetComponent <Player_Script>(); } rb.AddForce(new Vector2(6f * player.Player_Direction, 2f), ForceMode2D.Impulse); if (player.Player_Direction == -1f) { rb.transform.Rotate(0f, -180f, 0); } Destroy(this.gameObject, 1f); }
// Only have one GameManager at any one time //void Awake() //{ // if (GM_Script == null) // { // DontDestroyOnLoad(gameObject); // GM_Script = this; // } // // If theres more than one instance // else if (GM_Script != null) // { // Destroy(gameObject); // } //} // Start is called before the first frame update void Start() { // X-Mas Mode (Game_1) if (SceneManager.GetActiveScene().name == "Game_1" || SceneManager.GetActiveScene().name == "Game_2") { // Get the player script P_Script = FindObjectOfType <Player_Script>(); // Get the animator SceneSwitchAnim = GameObject.Find("UI_Canvas/LoadingAnim").GetComponent <Animator>(); // Play the animation SceneSwitchAnim.SetBool("Game_1", true); scoreText = GameObject.Find("UI_Canvas/Kills").GetComponent <Text>(); obs_spawner1 = GameObject.Find("Obsticle_Spawner_1"); obs_spawner2 = GameObject.Find("Obsticle_Spawner_2"); obs_spawner3 = GameObject.Find("Obsticle_Spawner_3"); //Start the speeds // NOTE - Grab the elf and obsticle prefabs (as they spawn), otherwise assign BG from the hirecahy and NOT thier prefabs elf.GetComponent <Elf_Script>().speed = 4f; small_Obs.GetComponent <Obsticle_Script>().speed = 4f; med_Obs.GetComponent <Obsticle_Script>().speed = 4f; big_Obs.GetComponent <Obsticle_Script>().speed = 4f; BG_1.GetComponent <RepeatingBG_Script>().speed = 7f; BG_2.GetComponent <RepeatingBG_Script>().speed = 7f; BG_3.GetComponent <RepeatingBG_Script>().speed = 4f; BG_4.GetComponent <RepeatingBG_Script>().speed = 4f; BG_5.GetComponent <RepeatingBG_Script>().speed = 2f; BG_6.GetComponent <RepeatingBG_Script>().speed = 2f; // Get the screen GameOver_Canvas = GameObject.Find("UI_Canvas/GameOver_Panel").GetComponent <Canvas>(); deathText = GameObject.Find("UI_Canvas/GameOver_Panel/Score").GetComponent <Text>(); // Off GameOver_Canvas.enabled = false; } }
void Start() { //target = GameObject.Find (toRotate.name).transform; pScript = GameObject.Find("Player_Bird").GetComponent <Player_Script>(); pAnim = GameObject.Find("PlayerAnimation").GetComponent <PlayerAnimation> (); crosshair = GameObject.Find("Crosshair"); crosshairColor = crosshair.GetComponent <FollowMouse> ().crosshairColor; crosshairRenderer = crosshair.GetComponent <SpriteRenderer> (); gamepadCrosshairRenderer = GameObject.Find("GamepadCrosshair").GetComponent <SpriteRenderer> (); crosshairFadeTime = 0.2f; transparent = crosshairColor; transparent.a = 0f; grappledCrosshairColor = crosshair.GetComponent <FollowMouse> ().grappledCrosshairColor; cameraDistance = 4f; //We start out with an invisible crosshair crosshairRenderer.color = transparent; gamepadCrosshairRenderer.color = transparent; }
// Start is called before the first frame update private void Awake() { player = GameObject.Find("Player").GetComponent <Player_Script>(); }
private void bluePowerUp(Player_Script script) { script.GetComponent<Controls>().speed = 20.0f; }
private void greenPowerUp(Player_Script script) { throw new NotImplementedException(); }
// Start is called before the first frame update void Start() { rbEnemy = GetComponent <Rigidbody2D>(); A_Enemy = GetComponent <Animator>(); pscript = GetComponent <Player_Script>(); }
// Start is called before the first frame update void Start() { playerScript = GetComponent <Player_Script>(); Destroy(GameObject.Find("Level Controller")); }
// Use this for initialization void Start() { //get player scripts ps = Player_Script.playerObj.GetComponent<Player_Script> (); }
private void whitePowerUp(Player_Script script) { script.SpotLight.gameObject.transform.localPosition = new Vector3(0, 5, 0); script.SpotLight.GetComponent<Light>().spotAngle = 120; }
public void UsePowerUp(Player_Script script) { switch (type) { case PowerUpType.White: whitePowerUp(script); return; case PowerUpType.Green: greenPowerUp(script); return; case PowerUpType.Red: redPowerUp(); return; case PowerUpType.Yellow: yellowPowerUp(); return; case PowerUpType.Blue: bluePowerUp(script); return; default: whitePowerUp(script); return; } }