Ejemplo n.º 1
0
    void Start()
    {
        //almostdead = true;
        rb  = GetComponent <Rigidbody2D>();
        box = GetComponent <BoxCollider2D>();
        almostDeadCircle = GetComponentInChildren <CircleCollider2D>();
        screenshake      = Camera.main.GetComponent <Screenshake>();
        defSprScale      = sprite.localScale;
        defaultScale     = pivot.transform.localScale;
        ammoText         = GetComponentInChildren <TextMesh>();
        camera           = Camera.main.gameObject;
        reticleScale     = reticle.GetComponent <Animation>();
//		Debug.Log(InputManager.Devices);
        //player1 = InputManager.Devices[playerId];


        foreach (GameObject g in GameObject.FindGameObjectsWithTag("Player"))
        {
            PlayerMovementController p = g.GetComponent <PlayerMovementController>();
//			Debug.Log(p.playerId);
            if (p.playerId != this.playerId)
            {
                otherPlayer = p;
            }
        }

        player = ReInput.players.GetPlayer(playerId);
        PlayerTuning tuning = Resources.Load <PlayerTuning>("MyTune");

        runAccel        = tuning.runAccel;
        runMaxSpeed     = tuning.runMaxSpeed;
        groundDrag      = tuning.groundDrag;
        airAccel        = tuning.airAccel;
        airMaxSpeed     = tuning.airMaxSpeed;
        jumpSpd         = tuning.jumpSpd;
        gravity         = tuning.gravity;
        bonusGravity    = tuning.bonusGravity;
        jumpChargeTimer = tuning.jumpChargeTimer;
        jumpChargeMax   = tuning.jumpChargeMax;
        kick            = tuning.kick;
        wallFriction    = tuning.wallFriction;
        maxMana         = tuning.maxMana;
        timeManaDrain   = tuning.timeManaDrain;
        manaGain        = tuning.manaGain;
        bulletCooldown  = tuning.bulletCooldown;
        invulnMaxFrames = tuning.invulnMaxFrames;
        health          = tuning.health;
        GameMaster.me.updateUI();
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "_FINAL_menu")
        {
            menuMusic = GameObject.Find("MenuMusic").GetComponent <AudioSource>();
            musicVol  = menuMusic.volume * 100;
            setMusicVolume();
        }
        tuning         = Resources.Load <PlayerTuning>("MyTune");
        healthVal.text = "" + tuning.health;
        healthIndex    = 2;
        managerPrefab  = Resources.Load <GameObject>("MANAGERS");

        resolutions  = Screen.resolutions;
        resText      = GetComponent <TextMeshProUGUI>();
        resText.text = Screen.currentResolution.width + " x " + Screen.currentResolution.height;
        isFullscreen = Screen.fullScreen;

        if (isFullscreen)
        {
            fullscreenText.text = "YES";
        }
        else
        {
            fullscreenText.text = "NO";
        }

        List <string> options = new List <string>();

        int currentResolutionIndex = 0;

        for (int i = 0; i < resolutions.Length; i++)
        {
            string option = resolutions[i].width + " x " + resolutions[i].height;
            options.Add(option);

            if ((resolutions[i].width == Screen.currentResolution.width) && (resolutions[i].height == Screen.currentResolution.height))
            {
                currentResolutionIndex = i;
            }
        }

        // resolutionDropdown.AddOptions(options);
        // resolutionDropdown.value = currentResolutionIndex;
        // resolutionDropdown.RefreshShownValue();
    }