Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class LaserEyes
- {
- [SerializedField] private TetrisGrid _tetrisGrid;
- private ParticalSystem _particalSystem;
- onEnebled
- {
- _tetrisGrid.LeninEyesSwitched += OnLeninEyesSwitched;
- }
- onDisabled
- {
- _tetrisGrid.LeninEyesSwitched -= OnLeninEyesSwitched ;
- }
- Start
- {
- _particalSystem = GetComponent<ParticalSystem>();
- }
- OnLeninSwitched (bool switched)
- {
- if(switched)
- _particalSystem.Play();
- else
- _particalSystem.Stop();
- }
- }
- class TetrisGrid
- {
- private ControllableFigure _controllableFigure;
- onEnebled
- {
- _controllableFigure.LeftBorderCrossed += OnLeftBorderCrossed;
- }
- onDisabled
- {
- _controllableFigure.LeftBorderCrossed -= OnLeftBorderCrossed;
- }
- ...
- StartFigure
- {
- var figure = ...
- ...
- _controllableFigure = figure;
- }
- ...
- OnleftBorderCrossed(bool crossed)
- {
- Invoke?.LeninEyesSwitched(crossed)
- }
- }
- class ContorollableFigure
- {
- ...
- {
- Invoke?.LeftBorderCrossed(bool);
- }
- ...
- }
Add Comment
Please, Sign In to add comment