private Game game; // Game (reference) void OnEnable() { if (this.game == null || this.settings == null) { this.game = Game.instance; this.settings = game.settings.GameStates .MainState .PlayingState .GameActionState .ScrumingState; if (this.game == null) { throw new UnityException("[scrumController] : I need a game to work !"); } } if (this.ScrumBloc == null) { GameObject o = GameObject.Find("SCRUM"); if (o == null) { o = new GameObject("SCRUM"); } this.ScrumBloc = o.GetComponent <ScrumBloc>(); } ScrumBloc.transform.position = InitialPosition; ScrumBloc.smoothPosition = true; this.currentPosition = 0; // Current score. this.TimeRemaining = this.settings.MaximumDuration; // Decreased by time after if chrono launched. this.ChronoLaunched = false; // Launched at first smash. this.CurrentWinner = 0; // Changed at first smash. this.SuperLoading = 0; // Super Loading this.MalusNorth = -1; this.MalusSouth = -1; }
public override void OnEnter() { base.OnEnter(); ScrumingStateSettings settings = game.settings.GameStates.MainState.PlayingState.GameActionState.ScrumingState; game.Referee.ScrumCinematicMovement(); game.refs.transitionsTexts.scrum.SetActive(true); cam.transalateWithFade(Vector3.zero, Quaternion.identity, 2, 1, 1, 1, (/* OnFinish*/) => { game.refs.managers.ui.currentState = UIManager.UIState.ScrumUI; game.Referee.NowScrum(); }, (/*OnFade*/) => { game.refs.transitionsTexts.scrum.SetActive(false); offset = cam.MinfollowOffset; cam.setTarget(this.game.refs.gameObjects.ScrumBloc.transform); cam.MinfollowOffset = settings.offsetCamera; game.Referee.ScrumSwitchToBloc(); }); }
void OnEnable() { if (this.game == null || this.settings == null) { this.game = Game.instance; this.settings = game.settings.GameStates .MainState .PlayingState .GameActionState .ScrumingState; if (this.game == null) { throw new UnityException("[scrumController] : I need a game to work !"); } } if (this.ScrumBloc == null) { GameObject o = GameObject.Find("SCRUM"); if(o == null) o = new GameObject("SCRUM"); this.ScrumBloc = o.GetComponent<ScrumBloc>(); } ScrumBloc.transform.position = InitialPosition; ScrumBloc.smoothPosition = true; this.currentPosition = 0; // Current score. this.TimeRemaining = this.settings.MaximumDuration; // Decreased by time after if chrono launched. this.ChronoLaunched = false; // Launched at first smash. this.CurrentWinner = 0; // Changed at first smash. this.SuperLoading = 0; // Super Loading this.MalusNorth = -1; this.MalusSouth = -1; }