private void Start() { FunctionTimer.Create(() => { entranceDoorAnims.SetColor(DoorAnims.ColorName.Green); }, 3.0f); FunctionTimer.Create(() => { entranceDoorAnims.OpenDoor(); }, 3.5f); CinematicBars.Show_Static(150f, .01f); FunctionTimer.Create(() => { CinematicBars.Show_Static(0f, .5f); }, 3f); }
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); } }