Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Assets.Library.Spood.Lib.Interfaces;
- using UnityEngine;
- using UnityEngine.Experimental.U2D;
- using UnityEngine.UIElements;
- using Zenject;
- namespace Assets.Spood.Behaviours.Views
- {
- public class BackgroundNightMode : MonoBehaviour
- {
- private IBackground _background;
- private bool _isNight = false;
- [Inject]
- void Construct(DiContainer container)
- {
- _background = container.ResolveId<IBackground>(Constants.Background.MountainBackgroundId);
- }
- // Update is called once per frame
- void Update()
- {
- if (Input.GetMouseButtonUp((int) MouseButton.LeftMouse))
- {
- if (_isNight)
- {
- _background.GameObject.GetComponent<SpriteShapeRenderer>().color = Color.white;
- _isNight = false;
- }
- else
- {
- _background.GameObject.GetComponent<SpriteShapeRenderer>().color = Color.gray;
- _isNight = true;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement