Exemplo n.º 1
0
        private void OnTriggerEnter2D(Collider2D collider)
        {
            if (collider.GetComponent <PickupHealth>() != null)
            {
                // Health item!
                materialTintColor.SetTintColor(Color.green);
                healthSystem.Heal(healthSystem.GetHealthMax());
                Destroy(collider.gameObject);
            }

            if (collider.GetComponent <PickupShotgun>() != null)
            {
                // Shotgun
                materialTintColor.SetTintColor(Color.blue);
                SetCanUseShotgun();
                Destroy(collider.gameObject);
                OnPickedUpWeapon?.Invoke(Weapon.WeaponType.Shotgun, EventArgs.Empty);
            }

            if (collider.GetComponent <PickupRifle>() != null)
            {
                // Shotgun
                materialTintColor.SetTintColor(Color.blue);
                SetCanUseRifle();
                Destroy(collider.gameObject);
                OnPickedUpWeapon?.Invoke(Weapon.WeaponType.Rifle, EventArgs.Empty);
            }

            if (collider.GetComponent <Star>() != null)
            {
                // Star!
                // Game Win!
                collider.gameObject.SetActive(false);
                playerMain.PlayerSwapAimNormal.PlayWinAnimation();
                playerMain.PlayerMovementHandler.Disable();
                //transform.Find("Body").GetComponent<MeshRenderer>().material = GameAssets.i.m_PlayerWinOutline;
                healthBar.Hide();
                CameraFollow.Instance.SetCameraFollowPosition(GetPosition());
                CameraFollow.Instance.SetCameraZoom(35f);
                CinematicBars.Show_Static(150f, .6f);

                transform.Find("AimLight").gameObject.SetActive(false);
            }
        }
Exemplo n.º 2
0
 private void DamageFlash()
 {
     materialTintColor.SetTintColor(new Color(1, 0, 0, 1f));
 }