示例#1
0
    void Update()
    {
        if (printDrive)
        {
            if (printDrive.transform.localPosition != desiredLocation)
            {
                printDrive.transform.localPosition = Vector3.MoveTowards(printDrive.transform.localPosition, desiredLocation, insertionSpeed * Time.deltaTime);
            }
            else if (!driveConnected)
            {
                ConnectDrive();
            }

            if (desiredLocation != Vector3.zero && printDrive.transform.localPosition == desiredLocation)
            {
                Destroy(printDrive.gameObject);
                printDrive = null;
                if (blueprint)
                {
                    gameObject.layer = LayerMask.GetMask("Default");
                    Destroy(blueprint);
                    Destroy(this);
                }
                else
                {
                    FindObjectOfType <WeaponSlot>().SwitchWeapons();
                }
            }
        }
    }
示例#2
0
    public void Unlock(PrintDrive drive)
    {
        if (!unlocked)
        {
            PartPrinterData.instance.UnlockModule(moduleType, moduleTier);
            drive.ShowBlueprint(moduleType, moduleTier);

            unlocked = true;
        }
    }
示例#3
0
    public void Use()
    {
        if (!printDrive)
        {
            printDrive = Instantiate(PartPrinterData.instance.printDrivePrefab, transform.position + transform.up / 2f, transform.rotation, transform).GetComponent <PrintDrive>();
            printDrive.AssignPort(this);

            if (!blueprint)
            {
                FindObjectOfType <WeaponSlot>().UnequipAll();
            }
            desiredLocation = Vector3.zero;
        }
    }