Exemplo n.º 1
0
    /*
     * void RotatePlayer()
     * {
     *  Vector3 vec = transform.eulerAngles;
     *  vec.y += Input.GetAxis("Horizontal") * Time.deltaTime * 360;
     *  transform.eulerAngles = vec;
     * }
     */
    // Update is called once per frame
    void Update()
    {
        telaraña = Telaraña.instance;

        main = ScrollWheel.instance;

        //RotatePlayer();
        PlayerMovement();

        manos = main.GetComponent <ScrollWheel>().manos;

        restarEs = ObjetoEscarabajo.GetComponent <ObjetoEscarabajo>().restarEscara;

        Lento = telaraña.GetComponent <Telaraña>().lento;

        restarMuni = arma.GetComponent <Arma>().restarMuni;

        /*
         * Ray cameraRay = mainCamera.ScreenPointToRay(Input.mousePosition);
         * Plane groundPlane = new Plane(Vector3.up, Vector3.zero);
         * float rayLength;
         * if(groundPlane.Raycast(cameraRay, out rayLength))
         * {
         *  Vector3 pointToLook = cameraRay.GetPoint(rayLength);
         *  Debug.DrawLine(cameraRay.origin, pointToLook, Color.blue);
         *
         *  transform.LookAt(new Vector3(pointToLook.x, transform.position.y, pointToLook.z));
         * }
         */

        jump();

        if (restarEs == true)
        {
            restarEscarabajo();
        }

        if (Lento == true)
        {
            speed = 5f;
        }
        else
        {
            speed = 10f;
        }

        if (restarMuni == true)
        {
            municion = municion - 1;
        }
        else
        {
        }
    }
Exemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
 }