// Use this for initialization void Start() { player = FindObjectOfType <PlayerScript2> (); enemyBody = FindObjectOfType <Rigidbody2D> (); enemyBody.freezeRotation = true; animator = GetComponent <Animator>(); }
public float strength = 50; //Bullets and slashing are equal to start void Start() { //bulletBox = FindObjectOfType<BoxCollider2D> (); player = FindObjectOfType <PlayerScript2>(); //Finds the players location //bulletMoving = false; //These next statement determine which direction to shoot the bullet in if (player.getDirectionString() == "r") { shootRight(); } if (player.getDirectionString() == "l") { shootLeft(); //transform.rotation() } if (player.getDirectionString() == "u") { shootUp(); } if (player.getDirectionString() == "d") { shootDown(); } }
// Use this for initialization void Start() { player = new Rigidbody2D(); p2Script = gameManager.opponentCharacter.GetComponent <PlayerScript2> (); playerMov = this.gameController.P1.GetComponent <Animator> (); player = this.gameController.P1.GetComponent <Rigidbody2D> (); }
void Start() { //animator = FindObjectOfType<Animator> (); animator = GetComponent <Animator>(); //Finds the animator component player = FindObjectOfType <PlayerScript2> (); //Finds the players location bulletOrientation = Bullet.GetComponent <SpriteRenderer>(); }
// Use this for initialization void Start() { player = FindObjectOfType <PlayerScript2>(); StartCoroutine("LoseTime"); levelLoadCanvas.SetActive(true); barCanvas.SetActive(false); }
void Update() { // If player has contacted enemy player = GameObject.Find("Player").GetComponent <PlayerScript2>(); if (player.gameOver) { // Tell the animator the game is over // Don't have animator set up yet player.canControl = false; GameObject.Find("Player").GetComponent <Rigidbody2D>().velocity = noMovement; Invoke("GameOver", levelStartDelay); // // increment a timer to count up to restarting // restartTimer += Time.deltaTime; // // // if it reaches the restart delay // if (restartTimer >= restartDelay) { // // Reload the currently loaded level // SceneManager.LoadScene("game"); // } } else if (player.isComplete) { player.canControl = false; GameObject.Find("Player").GetComponent <Rigidbody2D>().velocity = noMovement; GameObject.Find("Enemy").GetComponent <Rigidbody2D>().velocity = noMovement; Invoke("Complete", levelStartDelay); } }
// Use this for initialization void Start() { player = FindObjectOfType <PlayerScript2>(); shop = FindObjectOfType <playerShop>(); // GameObject player = GameObject.Find("Player") // shooting shootsc = FindObjectOfType<shooting>(); equipDag = true; }
// Use this for initialization public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer) { LobbyPlayer lobby = lobbyPlayer.GetComponent <LobbyPlayer>(); PlayerScript2 p = gamePlayer.GetComponent <PlayerScript2>(); p.playerName = lobby.playerName; p.color = new PlayerScript2.PlayerColor(lobby.playerColor.r, lobby.playerColor.g, lobby.playerColor.b); }
// Used for initialization void Start() { player = FindObjectOfType <PlayerScript2>(); enemyBody = FindObjectOfType <Rigidbody2D>(); animator = FindObjectOfType <Animator>(); enemyBody.freezeRotation = true; //IMPORTANT! ENEMY MUST BE KINEMATIC playerInRange = false; //enemyRange.enabled = true; }
// Use this for initialization void Start() { SceneNum = SceneManager.GetActiveScene().buildIndex; print(SceneNum); player = GetComponent <PlayerScript2> (); currentHealth = startingHealth; healthUI = healthImage.GetComponent <Animator> (); healthUI.speed = 0; time = 0; }
private bool triggered = false; // Set to true when the 'trap' is triggered // Used for initialization void Start() { player = FindObjectOfType <PlayerScript2>(); enemyBody = FindObjectOfType <Rigidbody2D>(); animator = FindObjectOfType <Animator>(); enemyBody.freezeRotation = true; //IMPORTANT! ENEMY MUST BE KINEMATIC playerInRange = false; spawnSpot = transform.position; goalSpot = spawnSpot; }
//Initializes the boxes to off void Start() { left.enabled = false; right.enabled = false; up.enabled = false; down.enabled = false; player = FindObjectOfType <PlayerScript2> (); //animator = FindObjectOfType<Animator> (); animator = GetComponent <Animator>(); }
void InitGame() { player = GameObject.Find("Player").GetComponent <PlayerScript2>(); player.canControl = false; levelImage = GameObject.Find("LevelImage"); levelText = GameObject.Find("LevelText").GetComponent <Text> (); levelText.text = "Level " + level; // enemies.clear (); // boardScript.SetupScene (level); Invoke("HideLevelImage", levelStartDelay); }
// Use this for initialization void Start() { player = FindObjectOfType <PlayerScript2>(); playerbar = FindObjectOfType <BarScript>(); enemy = FindObjectOfType <EnemyScript>(); }
// Start is called before the first frame update void Start() { playerScript = player.GetComponent <PlayerScript2>(); CreateIcons(); }
private void Start() { target = GameObject.Find("Player"); // The target of the game object player = GameObject.Find("Player").GetComponent <PlayerScript2>(); _centre = transform.position; }
public float strength = 50; //Bullets and slashing are equal to start void Start() { player = FindObjectOfType <PlayerScript2>(); shootRight(); }
void Start() { //animator = FindObjectOfType<Animator> (); animator = GetComponent <Animator>(); //Finds the animator component player = FindObjectOfType <PlayerScript2> (); //Finds the players location }
void Start() { player = FindObjectOfType <PlayerScript2> (); //Finds the player object }
// Use this for initialization void Start() { inventory = FindObjectOfType <Inventory>(); player = FindObjectOfType <PlayerScript2>(); }
// Use this for initialization void Start() { playerScript = player.GetComponent <PlayerScript2> (); timer.text = playerScript.timeLeft.ToString(); }