Ejemplo n.º 1
0
    //sets defaults when game loaded
    void Awake()
    {
        SSM = GetComponent<ShootServerManager>();

        //sets mouse cursor to lock and hide
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible = (false);
        CursorLockedVar = (true);

        SetDefaults();
    }
Ejemplo n.º 2
0
    public bool automaticReload = false; //setting that the player reloads automatically if his gun is empty and he tries to shoot

    void Start()
    {
        player = GetComponent<Player>();
        SSM = GetComponent<ShootServerManager>();

        crossHairManager = GameObject.FindGameObjectWithTag("CrosshairManager").GetComponent<CrosshairManager>();

        if (cam == null) // if no camera error
        {
            Debug.LogError("PlayerShoot: No camera referrenced!");
            this.enabled = false;
        }

        ammo = GameObject.Find("AmmoCounter").GetComponent<Text>();
        //player.setMaxAmmo(ammo);
    }