Esempio n. 1
0
    private float runAnimSpeed             = 1.00f; // The speed of the running animation

    private void Awake()
    {
        // Gathering the components from the player
        myRigidBody2D       = GetComponent <Rigidbody2D> ();
        regularGravityScale = myRigidBody2D.gravityScale;
        mySpriteRenderer    = GetComponent <SpriteRenderer> ();
        myAnimator          = GetComponent <Animator> ();
        myParticleSystem    = GetComponent <ParticleSystem> ();
        playerSFXHandler    = GetComponent <PlayerSFXHandler> ();

        if (mainCamHandler == null)
        {
            mainCamHandler = Camera.main.GetComponent <CamHandler> ();
        }

//		startPos = transform.position;
        spawnPoint = transform.position;

        // Set the player's material to darkMaterial if it's the player house or the cave levels and it's not the Multicolor costume
        if ((SceneManager.GetActiveScene().buildIndex == 4 || SceneManager.GetActiveScene().buildIndex == 6))
        {
            mySpriteRenderer.material = darkMaterial;
        }

        // Set the SFX volume when the player is instantiated
        foreach (AudioSource audio in GetComponents <AudioSource> ())
        {
            audio.volume = PlayerPrefs.GetFloat("SFXVol", 0.5f);
        }
    }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     //Input should only be accepted locally - the PlayerSync script will handle moving the players across the network
     enabled = networkView.isMine;
     //Assign the components
     ch   = GetComponent <CHandler>();
     camh = GetComponentInChildren <CamHandler>();
     gm   = GameManager.Instance;
 }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     //Input should only be accepted locally - the PlayerSync script will handle moving the players across the network
     enabled = GetComponent<NetworkView>().isMine;
     //Assign the components
     ch = GetComponent<CHandler>();
     camh = GetComponentInChildren<CamHandler>();
     gm = GameManager.Instance;
 }
Esempio n. 4
0
        public CharSelector()
        {
            _camera = new CamHandler();

            RAGE.Game.Graphics.GetScreenResolution(ref ScreenResX, ref ScreenResY);
            RAGE.Game.Graphics.GetActiveScreenResolution(ref ScreenX, ref ScreenY);

            Events.Tick += Render;

            Events.Add(Shared.Events.ServerToClient.Character.InitCharSelector, OnInitCharSelector);
            Events.Add(Shared.Events.ServerToClient.Character.EndCharSelector, OnEndCharSelector);
            Events.Add(Shared.Events.ServerToClient.Character.RenderCharacterList, OnRenderCharacterList);

            // Temp testing events
            Events.Add("selectchar", SelectChar);
            Events.Add("playchar", SpawnChar);
        }
Esempio n. 5
0
        public Authentication()
        {
            Camera = new CamHandler();

            #region SERVER_TO_CLIENT
            Events.Add(Shared.Events.ServerToClient.Authentication.SetLoginScreen, OnSetLoginScreen);
            Events.Add(Shared.Events.ServerToClient.Authentication.DisplayError, OnDisplayError);
            Events.Add(Shared.Events.ServerToClient.Authentication.RegistrationSuccess, OnRegistrationSuccess);
            Events.Add(Shared.Events.ServerToClient.Authentication.Show2FAbyEmailAddress, OnShow2FAbyEmailAddress);
            Events.Add(Shared.Events.ServerToClient.Authentication.Show2FAbyGoogleAuth, OnShow2FAbyGoogleAuth);
            Events.Add(Shared.Events.ServerToClient.Authentication.ShowInitialEmailVerification, OnShowInitialEmailVerification);
            Events.Add(Shared.Events.ServerToClient.Authentication.ShowChangeEmailAddress, OnShowChangeEmailAddress);
            Events.Add(Shared.Events.ServerToClient.Authentication.ShowLoginPage, OnShowLoginPage);
            Events.Add(Shared.Events.ServerToClient.Authentication.ShowQRCode, OnShowQRCode);
            Events.Add(Shared.Events.ServerToClient.Authentication.ShowQRCodeEnabled, OnShowQRCodeEnabled);
            #endregion

            #region CEF_TO_CLIENT
            // From multiple pages
            Events.Add("onBackToLogin", OnBackToLogin);
            Events.Add("onResendMail", OnResendMail);
            // From register.html
            Events.Add("onSubmitRegister", OnSubmitRegister);
            // From login.html
            Events.Add("onSubmitLogin", OnSubmitLogin);
            // From forgot.html
            Events.Add("onSubmitForgetPass", OnSubmitForgetPass);
            // From verifyemail.html
            Events.Add("onSubmitEmailToken", OnSubmitEmailToken);
            // From verifygoogleauth.html
            Events.Add("onSubmitGoogleAuthCode", OnSubmitGoogleAuthCode);
            // From newpass.html
            Events.Add("onSubmitNewPass", OnSubmitNewPass);
            // From verifyemailfirst.html
            Events.Add("onSubmitFirstEmailToken", OnSubmitFirstEmailToken);
            // From changemail.html
            Events.Add("onSubmitNewEmail", OnSubmitNewEmail);
            // From enabledgoogleauth.html
            Events.Add("onCloseWindow", OnCloseWindow);
            Events.Add("onSubmitEnableGoogleAuthCode", onSubmitEnableGoogleAuthCode);
            #endregion
        }
Esempio n. 6
0
        public CharCreator()
        {
            _camera = new CamHandler();

            // TEMP commands
            Events.Add("createchar", OnInitCharCreation);

            // Server Events
            Events.Add(Shared.Events.ServerToClient.Character.StartCustomization, OnStartCustomization);
            Events.Add(Shared.Events.ServerToClient.Character.ResetCharCreation, ResetCharCreation);
            Events.Add(Shared.Events.ServerToClient.Character.DisplayCharError, DisplayError);
            Events.Add(Shared.Events.ServerToClient.Character.SuccessCharCreation, OnSuccessCharCreation);

            // CEF
            Events.Add("SubmitInitialCharData", SubmitInitialCharData); // Step 1
            Events.Add("UpdateHeadOverlay", OnUpdateHeadOverlay);       // Step 2
            Events.Add("UpdateFaceFeature", OnUpdateFaceFeature);       // Step 3
            Events.Add("UpdateExtras", OnUpdateExtras);                 // Step 4
            Events.Add("UpdateHeadBlend", OnUpdateHeadBlend);           // Step 5
            Events.Add("SubmitNewCharacter", OnSubmitNewCharacter);     // Step 5

            Events.Add("SubmitCancel", OnQuitCharCreation);
        }