public IEnumerator Spawn()
    {
        //if pointer held down & number of available parts greater than 0
        if (pointerDown == true && partsInInventory > 0)
        {
            VRDraggable vr = Instantiate(objectToSpawn, spawnPosition, transform.localRotation);
            vr.gameObject.GetComponent <TooltipController>().toolTipDisplayText = toolTipDisplayText;
            vr.gameObject.GetComponent <TooltipController>().toolTipText        = gameObject.GetComponent <SpawnerTooltipController>().toolTipText;
            vr.gameObject.GetComponent <TooltipController>().parentPartSpawner  = gameObject;
            vr.controller     = controller;
            vr.rot            = gameObject.transform.rotation.eulerAngles.z;
            vr.gameObject.tag = "Lock@SimStart";
            partsInInventory  = partsInInventory - 1;
        }

        if (pointerDown == false)
        {
        }

        yield return(null);
    }
示例#2
0
    public IEnumerator Spawn()
    {
        if (pointerDown == true)
        {
            Debug.Log("start spawn");
            VRDraggable vr = Instantiate(objectToSpawn, spawnPosition, transform.localRotation);
            vr.gameObject.GetComponent <TooltipController>().toolTipDisplayText = toolTipDisplayText;
            vr.gameObject.GetComponent <TooltipController>().toolTipText        = gameObject.GetComponent <SpawnerTooltipController>().toolTipText;
            vr.gameObject.GetComponent <TooltipController>().parentPartSpawner  = gameObject;
            vr.controller     = controller;
            vr.rot            = gameObject.transform.rotation.eulerAngles.z;
            vr.gameObject.tag = "Lock@SimStart";
            newPartSpawned    = true;
        }

        if (pointerDown == false)
        {
        }

        yield return(null);
    }