public override void OnEnter()
 {
     game.refs.managers.ui.currentState = UIManager.UIState.NULL;
     cam.ChangeCameraState(CameraManager.CameraState.FREE);
     game.Referee.StopPlayerMovement();
     cam.transalateWithFade(Vector3.zero, Quaternion.identity, 0f, 1f, 1f, 1.5f,
                            (/* OnFinish */) => {
         //please, kill after usage x)
         game.refs.managers.ui.currentState = UIManager.UIState.GameUI;
         cam.WiningPointsCutSceneComponent.StartScene(() => { }, team);
         //cam.game.Referee.EnablePlayerMovement();
         //cam.ChangeCameraState(CameraManager.CameraState.FOLLOWING);
         //cam.game.Referee.StartPlacement();
         CameraFade.wannaDie();
     }, (/* OnFade */) => {
         cam.zoom = 1;                     //TODO cam settings
         cam.game.Referee.StartPlacement();
         this.cam.CameraRotatingAroundComponent.StartEndlessRotation(
             game.refs.positions.rotationCenter,
             new Vector3(0, 1, 0),
             game.refs.positions.fieldCenter,
             game.refs.positions.cameraFirstPosition,
             cam.game.settings.GameStates.MainState.IntroState.rotationSpeed / 100);
     }
                            );
 }
Пример #2
0
    public override void OnEnter()
    {
        base.OnEnter();
        cam.setTarget(null);
        game.Ball.ActivateFairyTrail();
        cam.LoadParameters(game.settings.GameStates.MainState.PlayingState.GameActionState.TouchingSgtate.TouchCamSettings);
        cam.ChangeCameraState(CameraManager.CameraState.FREE);

        Transform cameraPlaceHolder = game.refs.placeHolders.touchPlacement.FindChild("CameraPlaceHolder");

        game.refs.transitionsTexts.ballOut.SetActive(true);

        game.Ball.collider.enabled = false;
        Timer.AddTimer(2, () => {
            cam.transalateToWithFade(cameraPlaceHolder.position, cameraPlaceHolder.rotation, 0f, 1f, 1f, 0.3f,
                                     (/* OnFinish */) => {
                CameraFade.wannaDie();
            }, (/* OnFade */) => {
                game.refs.managers.ui.currentState = UIManager.UIState.TouchUI;

                game.refs.transitionsTexts.ballOut.SetActive(false);
                cam.CancelNextFlip = true;
                game.Referee.PlacePlayersForTouch();
                game.Ball.collider.enabled = true;
            }
                                     );

            this.game.northTeam.OnTouch();
            this.game.southTeam.OnTouch();
        });
    }
Пример #3
0
    public override bool OnBallOnGround(bool onGround)
    {
        if (!onGround)
        {
            return(false);
        }

        Debug.Log("ConversionFly::OnBallOnGround");

        game.Referee.StopPlayerMovement();
        cam.transalateWithFade(Vector3.zero, Quaternion.identity, 0f, 1f, 1f, 2.5f,
                               (/* OnFinish */) => {
            //please, kill after usage x)
            CameraFade.wannaDie();
            cam.game.Referee.EnablePlayerMovement();
        }, (/* OnFade */) => {
            //cam.ChangeCameraState(CameraManager.CameraState.FREE);
            this.game.OnResumeSignal(game.Referee.FreezeAfterConversion);
            cam.zoom = 1;                     //TODO cam settings
            game.refs.managers.conversion.OnLimit();
            cam.game.Referee.StartPlacement();
        }
                               );
        return(true);
    }
Пример #4
0
    public override bool OnBallOut()
    {
        Debug.Log("OUT");

        game.Ball.collider.enabled = false;

        //game.refs.transitionsTexts.ballOut.SetActive(true);
        Timer.AddTimer(1, () =>
        {
            game.Referee.StopPlayerMovement();
            cam.transalateWithFade(Vector3.zero, Quaternion.identity, 0f, 1f, 1f, 0.7f,
                                   (/* OnFinish */) => {
                //please, kill after usage x)
                CameraFade.wannaDie();
                cam.game.Referee.EnablePlayerMovement();
            }, (/* OnFade */) => {
                //cam.ChangeCameraState(CameraManager.CameraState.FREE);
                cam.zoom = 1;             //TODO cam settings
                //game.refs.transitionsTexts.ballOut.SetActive(false);
                cam.game.Referee.UnitToGiveBallTo = game.Ball.Team.opponent[2];
                cam.game.Referee.StartPlacement();
                game.Ball.collider.enabled = true;
            }
                                   );
        });

        return(true);
    }
Пример #5
0
    // On entre dans l'état de fin
    public override void OnEnter()
    {
        base.OnEnter();

        game.refs.transitionsTexts.timeOut.SetActive(true);
        game.refs.CameraAudio["timesUp"].clip = game.refs.sounds.TimesUp;
        game.refs.CameraAudio["timesUp"].Play();

        Timer.AddTimer(2, () => {
            cam.transalateWithFade(Vector3.zero, Quaternion.identity, 0, 1f, 1f, 1.5f,
                                   (/* OnFinish */) => {
                CameraFade.wannaDie();
            }, (/* OnFade */) => {
                game.refs.transitionsTexts.timeOut.SetActive(false);
                cam.zoom = 1;
                this.cam.CameraRotatingAroundComponent.StartEndlessRotation(
                    game.refs.positions.rotationCenter,
                    new Vector3(0, 1, 0),
                    game.refs.positions.fieldCenter,
                    game.refs.positions.cameraFirstPosition,
                    cam.game.settings.GameStates.MainState.IntroState.rotationSpeed / 100
                    );

                game.refs.managers.ui.currentState = UIManager.UIState.EndUI;
            }
                                   );
        });
    }
 public override void OnLeave()
 {
     cam.transalateWithFade(Vector3.zero, Quaternion.identity, 0f, 1f, 1f, 1.5f,
                            (/* OnFinish */) => {
         //please, kill after usage
         CameraFade.wannaDie();
     }, (/* OnFade */) => {
         cam.ChangeCameraState(CameraManager.CameraState.FOLLOWING);
         cam.game.Referee.StartPlacement();
     }
                            );
 }
Пример #7
0
    public override void OnLeave()
    {
        cam.MinfollowOffset = offset;

        cam.transalateWithFade(Vector3.zero, Quaternion.identity, 1, 1, 1, 1,
                               (/* OnFinish*/) => {
            CameraFade.wannaDie();
        },
                               (/*OnFade*/) => {
            cam.setTarget(game.refs.managers.scrum.GetWinner().transform);
            game.refs.managers.ui.currentState = UIManager.UIState.NULL;
            game.Referee.ScrumAfter();
        });
    }
Пример #8
0
 public override void OnLeave()
 {
     cam.CameraRotatingAroundComponent.StopRotation();
     cam.setTarget(cam.game.Ball.Owner.transform);
     cam.transalateWithFade(Vector3.zero, Quaternion.identity, 0f, 1f, 1f, 1.5f,
                            (/* OnFinish */) => {
         CameraFade.wannaDie();
     }, (/* OnFade */) => {
         cam.flipForTeam(this.game.Ball.Owner.Team, () => {
             cam.ChangeCameraState(CameraManager.CameraState.FOLLOWING);
         });
         cam.ChangeCameraState(CameraManager.CameraState.FOLLOWING);
         game.refs.managers.ui.currentState = UIManager.UIState.GameUI;
     }
                            );
 }
Пример #9
0
    private void EditCamera()
    {
        camera_edited = true;

        cam.setTarget(null);
        cam.ChangeCameraState(CameraManager.CameraState.FREE);

        Transform cameraPlaceHolder = GameObject.Find("TransfoPlacement").transform.FindChild("ShootPlayer").
                                      FindChild("CameraPlaceHolder");

        GameObject Goal = null;

        if (cam.flipedForTeam == cam.game.southTeam)
        {
            Goal = GameObject.Find("but_maori");
            cameraPlaceHolder.LookAt(Goal.transform);
        }
        if (cam.flipedForTeam == cam.game.northTeam)
        {
            Goal = GameObject.Find("but_jap");
            cameraPlaceHolder.LookAt(Goal.transform);
        }

        cam.transalateWithFade(Vector3.zero, cameraPlaceHolder.rotation, 0f, 1f, 1f, 1f,
                               (/* OnFinish */) => {
            CameraFade.wannaDie();
        }, (/* OnFade */) => {
            cam.game.Referee.PlacePlayersForTransfo();

            Vector3 GoalToPlayer = cam.game.Ball.Owner.transform.position - Goal.transform.position;
            Vector3 GoalToCam    = cameraPlaceHolder.transform.position - Goal.transform.position;
            Vector3 Proj         = Vector3.Project(GoalToCam, GoalToPlayer);
            float saveY          = cameraPlaceHolder.transform.position.y;
            Vector3 dest         = new Vector3(Proj.x + Goal.transform.position.x, saveY, Proj.z + Goal.transform.position.z);

            Camera.mainCamera.transform.position = dest;
            Camera.mainCamera.transform.LookAt(Goal.transform);
            cam.game.Referee.EnableTransformation();
        }
                               );
    }
Пример #10
0
    public override bool OnConversion(But but)
    {
        Debug.Log("Conversion");

        game.Ball.collider.enabled = false;
        game.Ball.OnConversion(true);

        //Camera Time
        cam.transalateToWithFade(Vector3.zero, Quaternion.identity, 0f, 1f, 1f, 1.5f,
                                 (/* OnFinish */) => {
            //please, kill after usage x)
            CameraFade.wannaDie();
        }, (/* OnFade */) => {
            game.Ball.OnConversion(false);
            cam.setTarget(game.Ball.Team[2].transform);
            game.Referee.OnDropTransformed(but);
            game.Ball.collider.enabled = true;
        }
                                 );

        return(true);
    }