private int colorModes = 0; //Will be used to change the next color UI void Start() { playerRB = GetComponent <Rigidbody>(); playerController = GetComponent <Player3D>(); projectilePrefab.tag = "Grayscale"; //Player should always begin with the default grayscale mode stopShooting = false; }
void OnTriggerEnter(Collider other) { Player3D player = other.GetComponent <Player3D>(); ShootingController shoot = other.GetComponent <ShootingController>(); if (player != null) { if (player.bristles == requiredBristleAmount) { { superBrushActive = true; mainCamera.enabled = false; sweepCamera.enabled = true; camSweepAnim.enabled = true; checkpointUI.SetActive(false); curColorUI.SetActive(false); prevColorUI.SetActive(false); nextColorUI.SetActive(false); bristleUI.SetActive(false); timerUI.SetActive(false); pauseUI.SetActive(false); winUI.SetActive(true); restartButton.SetActive(true); quitButton.SetActive(true); player.playerSpeed = 0f; player.stopJumping = true; shoot.stopShooting = true; player.inkySound.Stop(); } } } }
void Start() { _speed = 0; _jumpForce *= 100; _player = GetComponent <Player3D>(); _rb = GetComponent <Rigidbody>(); _animator = GetComponent <Animator>(); _jumpSound = GetComponent <AudioSource>(); }
void OnCollisionStay(Collision collision) { Player3D player = collision.gameObject.GetComponent <Player3D>(); if (player != null) { player.ResetToCheckpoint(); } }
//Set checkpoint and show checkpoint text void OnTriggerEnter(Collider other) { Player3D player = other.GetComponent <Player3D>(); if (player != null) { player.SetCheckpoint(transform.position); player.ShowCPText(true); } }
//Add 1 bristle to the current bristle amount UI text void OnTriggerEnter(Collider other) { Player3D player = other.GetComponent <Player3D>(); if (player != null) { player.AddBristles(1); Destroy(gameObject); } }
//Exit and remove last checkpoint void OnTriggerExit(Collider exitCP) { Player3D player = exitCP.GetComponent <Player3D>(); if (player != null) { player.ShowCPText(false); Destroy(gameObject); } }
// Start is called before the first frame update void Start() { //Get player GameObject testPlayer = GameObject.FindWithTag("Player"); //Find player if (testPlayer != null) { player = testPlayer.GetComponent <Player3D>(); } mesh = GetComponent <Renderer>(); }
void Awake() { if (instance == null) { instance = this; } else { Debug.LogError("There can't be more than one player3D in the scene at any given time."); } box_collider = GetComponent <BoxCollider>(); }
/////////Test color change from player collision///////// void OnCollisionEnter(Collision change) { if (change.gameObject.tag == "Player") { //Color change code Player3D player = change.gameObject.GetComponent <Player3D>(); if (player != null) { mesh.material.color = player.currentColor.color; } } }
// Start is called before the first frame update void Start() { canPress = true; amountPP.SetActive(false); //Get and find Inky GameObject inky = GameObject.FindGameObjectWithTag("Player"); if (inky != null) { inkyBr = inky.GetComponent <Player3D>(); } }
// Start is called before the first frame update void Start() { reappear = false; disappear = false; //Find and get player GameObject feelPlayer = GameObject.FindGameObjectWithTag("Player"); if (feelPlayer != null) { player = feelPlayer.GetComponent <Player3D>(); } }
//private int components; void Start() { //paintball = GetComponentInChildren<Renderer>(); ammoMovement = GetComponent <Animator>(); //components = paintball.Length; //Get length of ammo's materials //Find and get player GameObject colorizeAmmo = GameObject.FindGameObjectWithTag("Player"); if (colorizeAmmo != null) { player = colorizeAmmo.GetComponent <Player3D>(); } }
private void InitPlayer() { m_player2D_GO = transform.Find("Player2D").gameObject; m_player3D_GO = transform.Find("Player3D").gameObject; m_player2D_S = m_player2D_GO.GetComponent <Player2D>(); m_player3D_S = m_player3D_GO.GetComponent <Player3D>(); // 플레이어 설정 ChangePlayer(); // 중력사용 m_useGravity = true; }
public AudioClip activatedClip; //Play sfx when activated // Start is called before the first frame update void Start() { toonShader = GetComponent <ShaderBW>(); isSticky = false; cooldown = false; //Find and get player GameObject inky = GameObject.FindGameObjectWithTag("Player"); if (inky != null) { player = inky.GetComponent <Player3D>(); } swSource = GetComponent <AudioSource>(); }
// Start is called before the first frame update void Start() { canTime = true; //Find and get player GameObject inky = GameObject.FindGameObjectWithTag("Player"); if (inky != null) { player = inky.GetComponent <Player3D>(); } //Find and get player's shooting ability GameObject shooting = GameObject.FindGameObjectWithTag("Player"); if (shooting != null) { shoot = shooting.GetComponent <ShootingController>(); } }
// Start is called before the first frame update void Start() { open = false; canOpen = false; //Find and get button GameObject but = GameObject.FindGameObjectWithTag("Button"); if (but != null) { activatedButton = but.GetComponent <Button>(); } //Find and get player GameObject inky = GameObject.FindGameObjectWithTag("Player"); if (inky != null) { inkyBristles = inky.GetComponent <Player3D>(); } }
void Start() { player = GetComponentInParent <Player3D>(); }
void Start() { player = GetComponentInParent<Player3D>(); }
private void OnTriggerEnter(Collider col) { if (col.gameObject.tag == "rightArm") { //damage me here Player3D p = col.gameObject.GetComponentInParent <Player3D>(); if (recovered) { int x = 0, y = 0; if (p.FacingRight) { x = 1; } else { x = -1; } if (p.transform.position.y > this.transform.position.y) { y = -1; } else { y = 1; } int d = p.Damage; damage(d, new Vector2(x, y)); } } if (col.gameObject.tag == "fallBox") { int fallDamage = 100; damage(fallDamage, new Vector2(0, 0)); } if (col.gameObject.tag == "weapon") { Weapon w = col.gameObject.GetComponent <Weapon>(); Player3D p = col.gameObject.GetComponentInParent <Player3D>(); if (recovered && p.Attacking && w.PlayerNum != this.playerNum) { int x = 0, y = 0; if (p.FacingRight) { x = 1; } else { x = -1; } if (p.transform.position.y > this.transform.position.y) { y = -1; } else { y = 1; } int d = w.Damage; damage(d, new Vector2(x, y)); } } }
public void spawnPlayer() { actualPlayer = Instantiate(player_prefab, _spawnPoint.position, _spawnPoint.rotation, _spawnPoint.parent).GetComponent <Player3D>(); Debug.Log("Spawn player to world pos : " + _spawnPoint.position); actualPlayer.SpawnPlayer(); }