private void Start() { Gamemanager.instance.LoadUI(this); bulletDictionary.Add(1, bullet1); bulletDictionary.Add(2, bullet2); bulletDictionary.Add(3, bullet3); bulletDictionary.Add(4, bullet4); stackPosition = new List <Vector3>(); player = FindObjectOfType <Player>(); playerShoot = player.GetComponent <PlayerShootingController>(); UpdatePoints(); for (int i = 0; i < 10; i++) { Vector3 position = new Vector3(position0Bullets.x, position0Bullets.y + i * offsetYBullets, position0Bullets.z); stackPosition.Add(position); } playerShoot.bulletsStack.OnStack += OnStackHandler; playerShoot.bulletsStack.OnUnStack += OnUnstackhandler; player.OnGetItem += OnGetItemHandler; enemiesLeftText = enemiesLeft.GetComponent <TextMeshProUGUI>(); enemiesLeftAnim = enemiesLeft.GetComponent <Animator>(); }
void Start() { Player = GameObject.FindGameObjectWithTag("Player"); playerRB = Player.GetComponent <Rigidbody2D> (); ShootingController = Player.gameObject.GetComponentInChildren <PlayerShootingController> (); //GameObject.FindObjectOfType<PlayerShootingController> (); playerMC = Player.GetComponent <PlayerMovementController>(); _rope = this.gameObject.GetComponent <HingeJoint2D>(); }
private void Start() { anim = GetComponent<Animator>(); lifeController = new LifeController(maxLife); lifeController.OnGetDamage += OnGetDamageHandler; lifeController.OnGetHeal += OnGetHealHandler; lifeController.OnDead += OnDeadHandler; sprRend = GetComponent<SpriteRenderer>(); playerShootingController = GetComponent<PlayerShootingController>(); Gamemanager.instance.UI.UpdateHealth(lifeController.CurrentLife); }
private void OnTriggerEnter2D(Collider2D collision) { PlayerShootingController playerShootController = collision.GetComponent <PlayerShootingController>(); if (playerShootController != null && playerShootController.ActiveFiring == false) { //Throw this in an event playerShootController.bulletsStack.Stack(bulletToCollect); playerShootController.CollectBulletSound(); FindObjectOfType <BulletSpawner>().BulletDestroyed(); Destroy(this.gameObject); } }
void Awake() { #region Singleton if (Finder != null && Finder != this) { Debug.LogWarning("Multiples finder del jugador"); } Finder = this; #endregion if (player == null) { player = GameObject.FindGameObjectWithTag("Player"); } pm = player.GetComponent <PlayerMovement>(); ps = player.GetComponent <PlayerShootingController>(); }
void GameOver() { Debug.Log("GameOver"); var dop = ppp.depthOfField.settings; dop.aperture = 0; dop.focusDistance = 0.1f; ppp.depthOfField.settings = dop; CameraController cc = GetComponentInChildren <CameraController>(); PlayerShootingController psc = GetComponentInChildren <PlayerShootingController>(); cc.enabled = false; psc.enabled = false; Animator playerAnimator = GetComponent <Animator>(); //playerAnimator.SetTrigger(DEATH_ANIMATION_KEY); playerAnimator.Play("PlayerDeath"); Invoke("GameOverView", 1.5f); }
private void Start() { _movementController = GetComponent <PlayerMovementController>(); _shootingController = GetComponent <PlayerShootingController>(); }
public void RefreshWeaponPanel(PlayerShootingController playerShootingController) { WeaponPanel.RefreshPanel(playerShootingController.Weapons); }
private void Start() { GameStateManager.instance.RegisterPlayer(this); playerDamageableComponent = GetComponent <DamageableComponent>(); shootingController = GetComponent <PlayerShootingController>(); }
public void CachePlayerShootingController(PlayerShootingController playerShootingController) { CachedPlayerShootingController = playerShootingController; }