// Use this for initialization void Start() { initial_position = this.transform.position; rb = this.GetComponent <Rigidbody> (); animator = this.GetComponentInChildren <Animator> (); psm = this.GetComponent <PlayerScoreManager> (); pam = this.GetComponentInChildren <PlayerAnimationManager>(); pm = this.GetComponent <PlayerManager> (); switch (initial_facing_direction) { case (CharacterFacingDirections.FACING_LEFT): this.transform.localScale = new Vector3(-Mathf.Abs(this.transform.localScale.x), this.transform.localScale.y, this.transform.localScale.z); animator.SetBool(PlayerAnimatorParameters.is_facing_left, true); break; case (CharacterFacingDirections.FACING_RIGHT): this.transform.localScale = new Vector3(Mathf.Abs(this.transform.localScale.x), this.transform.localScale.y, this.transform.localScale.z); animator.SetBool(PlayerAnimatorParameters.is_facing_right, true); break; default: break; } }
// Start is called before the first frame update void Start() { currentHealth = maxHealth; enemySprite = GetComponent <SpriteRenderer>(); playerScore = FindObjectOfType <PlayerScoreManager>(); }
private void Start() { rb = GetComponent <Rigidbody2D>(); shake = GameObject.FindGameObjectWithTag("CameraShake").GetComponent <CameraShake>(); sm = GameObject.FindGameObjectWithTag("SM").GetComponent <PlayerScoreManager>(); }
private void Start() { isStarted = false; isBombBracketI = false; sm = GameObject.FindGameObjectWithTag("SM").GetComponent <PlayerScoreManager>(); //StartCoroutine(One()); }
private void Start() { _lineRenderer = GetComponent <LineRenderer>(); _rigidbody = GetComponent <Rigidbody2D>(); _playerScoreManager = GetComponent <PlayerScoreManager>(); _dangerIndicatorRigidbody = GameObject.Find("DangerIndicator").GetComponent <Rigidbody2D>(); }
private void OnCollisionEnter2D(Collision2D other) { PlayerScoreManager playerScoreManager = other.gameObject.GetComponent <PlayerScoreManager>(); if (playerScoreManager != null) { playerScoreManager.ChangeScore(-damageAmount); } }
private void OnTriggerEnter2D(Collider2D collider2D) { PlayerScoreManager playerScoreManager = collider2D.GetComponent <PlayerScoreManager>(); if (playerScoreManager != null) { playerScoreManager.ChangeScore(_scoreValue); Destroy(gameObject); } }
private void Start() { rb = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); sm = GameObject.FindGameObjectWithTag("SM").GetComponent <PlayerScoreManager>(); bus = GameObject.FindGameObjectWithTag("DreamBus").transform; shake = GameObject.FindGameObjectWithTag("CameraShake").GetComponent <CameraShake>(); health = 1; }
private void Start() { rb = GetComponent <Rigidbody2D>(); bus = GameObject.FindGameObjectWithTag("DreamBus").transform; controller = GameObject.FindGameObjectWithTag("DreamBus").GetComponent <DreamBusController>(); shake = GameObject.FindGameObjectWithTag("CameraShake").GetComponent <CameraShake>(); sm = GameObject.FindGameObjectWithTag("SM").GetComponent <PlayerScoreManager>(); health = 1; destroyParticle.transform.rotation = new Quaternion(0f, 0f, 0f, 0f); }
private void Start() { rb = GetComponent <Rigidbody2D>(); sprite = GetComponent <SpriteRenderer>(); bus = GameObject.FindGameObjectWithTag("DreamBus").transform; shake = GameObject.FindGameObjectWithTag("CameraShake").GetComponent <CameraShake>(); sm = GameObject.FindGameObjectWithTag("SM").GetComponent <PlayerScoreManager>(); randomRotatePoint = Random.Range(0, RotatePoint.Length); eventType = 1; timeToMove = timeToMoveToDifferentPos; target = new Vector2(bus.position.x, bus.position.y); health = 10f; }
private void Start() { rb = GetComponent <Rigidbody2D>(); bus = GameObject.FindGameObjectWithTag("DreamBus").transform; if (controller == null) { controller = GameObject.FindGameObjectWithTag("DreamBus").GetComponent <DreamBusController>(); } else { return; } sm = GameObject.FindGameObjectWithTag("SM").GetComponent <PlayerScoreManager>(); shake = GameObject.FindGameObjectWithTag("CameraShake").GetComponent <CameraShake>(); health = 1; }
// Use this for initialization void Start() { pmm = this.GetComponent <PlayerMovementManager> (); pam = this.GetComponentInChildren <PlayerAnimationManager> (); p_score_m = this.GetComponent <PlayerScoreManager> (); p_sound_m = this.GetComponentInChildren <PlayerSoundManager> (); grav_collider = this.GetComponent <BoxCollider> (); PlayerHandCollider[] hand_colliders = this.GetComponentsInChildren <PlayerHandCollider> (); for (int i = 0; i < hand_colliders.Length; i++) { if (hand_colliders [i].player_hand_placement == PlayerHandCollider.PlayerHandPlacement.FRONT) { front_hand = hand_colliders [i]; } if (hand_colliders [i].player_hand_placement == PlayerHandCollider.PlayerHandPlacement.BACK) { back_hand = hand_colliders [i]; } } animator = this.GetComponentInChildren <Animator> (); Debug.Log(animator); }
// Start is called before the first frame update void Start() { scorePlayer = FindObjectOfType <PlayerScoreManager>(); }
// Start is called before the first frame update void Start() { playerScore = FindObjectOfType <PlayerScoreManager>(); playerHealth = FindObjectOfType <PlayerHealthManager>(); }
private void Start() { sm = GameObject.FindGameObjectWithTag("SM").GetComponent <PlayerScoreManager>(); enemySpawer = GameObject.FindGameObjectWithTag("EnemySpawner").GetComponent <EnemySpawer>(); }