Ejemplo n.º 1
0
 public void DoAnAnterrogation(GameObject policePlayer, GameObject otherPlayer)
 {
     anterrogationSound.Play();
     policeP = policePlayer;
     otherP  = otherPlayer;
     policePlayer.transform.position = policePlace.position;
     policePlayer.transform.rotation = policePlace.rotation;
     policePlayer.GetComponent <PlayerMovement>().enabled      = false;
     policePlayer.GetComponent <CharacterController>().enabled = false;
     policePlayer.GetComponent <PlayerAnterrogationBehaviour>().ChangeCam(myCam, 11);
     otherPlayer.transform.position = otherPlace.transform.position;
     otherPlayer.transform.rotation = otherPlace.transform.rotation;
     otherPlayer.GetComponent <PlayerMovement>().enabled      = false;
     otherPlayer.GetComponent <CharacterController>().enabled = false;
     otherPlayer.GetComponent <PlayerAnterrogationBehaviour>().ChangeCam(myCam, 11);
     ableToAnterrogate = false;
     manager.RpcRemoveFunds(30);
     startAnterrogation = true;
 }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (funds == null)
        {
            funds = FindObjectOfType <FundsManager>();
        }

        onObject.SetActive(isOn);
        offObject.SetActive(!isOn);
        camView.SetActive(isOn);
        tvStatic.SetActive(!isOn);
        if (isOn)
        {
            myButton.sprite = onButton;
            myAnim.enabled  = true;
            if (timer <= 0)
            {
                funds.RpcRemoveFunds(myCost);
                timer = myRate;
            }
            else
            {
                timer -= Time.deltaTime;
            }
        }
        else
        {
            myAnim.enabled  = false;
            myButton.sprite = offButton;
        }

        if (funds.funds < myRate)
        {
            RpcTurnOnOff(false);
        }
    }