Exemple #1
0
    // Start is called before the first frame update
    protected override void Start()
    {
        base.Start();
        oldHandPos = primaryHand.transform.position;
        velocity   = primaryHand.GetComponent <VelocityCalculation>();

        steamVRObjects = GameObject.Find("SteamVRObjects").transform;

        initialized = false;
        StatusTextController.Instance.UpdateUserActionRequest("Stretch out arms!");
    }
Exemple #2
0
    // Start is called before the first frame update
    protected override void Start()
    {
        primaryHand = TaskController.Instance.GetPrimaryHand();
        velocity    = primaryHand.GetComponent <VelocityCalculation>();

        pickupAction.AddOnStateDownListener(PickupObject, primaryHand.handType);
        pickupAction.AddOnStateUpListener(PickupButtonReleased, primaryHand.handType);
        if (secondHandScale)
        {
            pickupAction.AddOnChangeListener(FunctionToCall, primaryHand.otherHand.handType);
        }

        renderedRay = primaryHand.transform.Find("Ray").GetComponent <LineRenderer>();
        renderedRay.gameObject.SetActive(true);

        // ray is rendered in local space so the start position is always the position of the ray object
        renderedRay.SetPosition(0, Vector3.zero);

        SetNewHandPositionsAndRotations();
    }