Exemplo n.º 1
0
    void Start()
    {
        fieldOfView = cam.fieldOfView;

        Data.Instance.events.StartMultiplayerRace += StartMultiplayerRace;
        Data.Instance.events.OnChangeMood         += OnChangeMood;
        Data.Instance.events.OnVersusTeamWon      += OnVersusTeamWon;
        Data.Instance.events.OncharacterCheer     += OncharacterCheer;
        if (Data.Instance.playMode != Data.PlayModes.SURVIVAL)
        {
            Data.Instance.events.OnProjectilStartSnappingTarget += OnProjectilStartSnappingTarget;
            Data.Instance.events.OnCameraZoomTo += OnCameraZoomTo;
        }
        Data.Instance.events.OnGameOver += OnGameOver;

        //Data.Instance.events.OnGameStart += OnGameStart;
        if (!Data.Instance.isAndroid)
        {
            Component rpp = Data.Instance.videogamesData.GetActualVideogameData().retroPixelPro;
            retroPixelPro        = CopyComponent(rpp, cam.gameObject) as RetroPixelPro;
            retroPixelPro.dither = 0;
            pixelSize            = 1;
        }

        charactersManager = Game.Instance.GetComponent <CharactersManager>();

        _Y_correction = 2;
        if (!Data.Instance.isReplay)
        {
            // Data.Instance.events.OnBossActive(true);
            //anim.Play ("cameraIntro");
            newPos.y       = 4.5f;
            cam.sensorSize = new Vector2(6, cam.sensorSize.y);

            transform.localEulerAngles     = new Vector3(3, 0, 0);
            transform.localPosition        = new Vector3(0, 11, 0);
            cam.transform.localEulerAngles = new Vector3(26, 0, 0);
            cam.transform.localPosition    = new Vector3(0, 0, -15);
        }
        else
        {
            cam.sensorSize          = new Vector2(18, cam.sensorSize.y);
            state                   = states.START;
            transform.localPosition = new Vector3(0, 2, -1.5f);
            newPos.y                = 0;
        }

        if (Data.Instance.isAndroid)
        {
            maxCamSensor            = 8f;
            transform.localPosition = new Vector3(0, 0, -1.5f);
        }
    }
Exemplo n.º 2
0
    private void Awake()
    {
        isAndroid        = Data.Instance.isAndroid;
        initialPixelSize = Data.Instance.pixelSize;
        sensorSizeValue  = sensorSizeValueInitial;
        cam.enabled      = false;
        Data.Instance.events.OnAvatarCrash        += OnAvatarCrash;
        Data.Instance.events.StartMultiplayerRace += StartMultiplayerRace;
        Data.Instance.events.OnChangeMood         += OnChangeMood;
        Data.Instance.events.OnVersusTeamWon      += OnVersusTeamWon;
        Data.Instance.events.OnMissionComplete    += OnMissionComplete;
        Data.Instance.events.OnStartGameScene     += OnStartGameScene;
        //if (Data.Instance.playMode != Data.PlayModes.SURVIVAL)
        //{
        //    Data.Instance.events.OnProjectilStartSnappingTarget += OnProjectilStartSnappingTarget;
        //    Data.Instance.events.OnCameraZoomTo += OnCameraZoomTo;
        //}
        Data.Instance.events.OnGameOver += OnGameOver;
        pixelSize = 10;

        vignette = GetComponentInChildren <FinalVignetteCommandBuffer>();

        if (Data.Instance.useRetroPixelPro)
        {
            Component rpp = Data.Instance.videogamesData.GetActualVideogameData().retroPixelPro;
            retroPixelPro           = CopyComponent(rpp, cam.gameObject) as RetroPixelPro;
            retroPixelPro.pixelSize = initialPixelSize;
            SetPixels(30);

            if (isAndroid)
            {
                vignette.VignetteInnerValueDistance = 0;
                vignette.VignetteOuterValueDistance = 0.99f;
            }
        }
        else
        {
            Destroy(vignette);
        }
    }