Ejemplo n.º 1
0
    void Start()
    {
        flaskBaseLocation = GameObject.Find("FlaskBaseLocation");
        gameLantern       = GameObject.FindGameObjectWithTag("VRFlask");
        VRFlaskScript     = gameLantern.GetComponent <VRFlask>();
        moveVRFlask       = gameLantern.GetComponent <MoveVRFlask>();

        lanternRB                 = gameLantern.GetComponent <Rigidbody>();
        lanternCollider           = gameLantern.GetComponent <BoxCollider>();
        lanternCollider.enabled   = true;
        lanternCollider.isTrigger = true;
        cameraHolder              = transform.parent.parent.parent.Find("CameraHolder").gameObject;
        if (holdLantern)
        {
            lanternRB.useGravity  = false;
            lanternRB.isKinematic = true;
            lanternRB.velocity    = Vector3.zero;
        }
        else
        {
            lanternRB.useGravity  = true;
            lanternRB.isKinematic = false;
            lanternRB.velocity    = Vector3.zero;
        }
    }
Ejemplo n.º 2
0
    private void Start()
    {
        inputs          = GetComponent <VRHandInputs>();
        networkVRPlayer = transform.parent.GetComponent <NetworkVRPlayer>();
        m_Pointer       = Instantiate(m_Pointer);
        VRFlask         = GameObject.FindGameObjectWithTag("VRFlask");
        VRFlaskScript   = VRFlask.GetComponent <VRFlask>();
        moveVRFlask     = VRFlask.GetComponent <MoveVRFlask>();
        flaskRB         = VRFlask.GetComponent <Rigidbody>();
        scaler          = GetComponentInParent <VRPlayerScale>();

        //move to flask at beginning
        MoveInFlask();
    }