void Update()
    {
        ShipPlatform currentShipPlatform = shipSelectionController.GetCurrentShipPlatform();
        Vector3      destinyPos          = currentShipPlatform.transform.position + initialOffset;

        transform.position = Vector3.SmoothDamp(transform.position, destinyPos, ref smoothDampCurrentVelocity, 0.4f);

        Quaternion destinyRot = GameObject.Find("ShipSelection/NavPoint").transform.rotation; // Quaternion.LookRotation(currentShipPlatform.transform.position - transform.position, Vector3.up);

        transform.rotation = Quaternion.Slerp(transform.rotation, destinyRot, Time.deltaTime * lookAtShipPlatformRotationSpeed);
    }
示例#2
0
    void Update()
    {
        ShipPlatform currentShipPlatform = shipSelectionController.GetCurrentShipPlatform();

        nameText.text = currentShipPlatform.GetName();

        speedStatBar.fillAmount = Mathf.Lerp(speedStatBar.fillAmount,
                                             currentShipPlatform.GetSpeed(), Time.deltaTime * fillBarSpeed);

        controlStatBar.fillAmount = Mathf.Lerp(controlStatBar.fillAmount,
                                               currentShipPlatform.GetControl(), Time.deltaTime * fillBarSpeed);

        resilienceStatBar.fillAmount = Mathf.Lerp(resilienceStatBar.fillAmount,
                                                  currentShipPlatform.GetResilience(), Time.deltaTime * fillBarSpeed);
    }
示例#3
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            GoToPreviousShip();
        }
        else if (Input.GetKeyDown(KeyCode.D))
        {
            GoToNextShip();
        }

        for (int i = 0; i < shipPlatforms.Length; ++i)
        {
            ShipPlatform sp = shipPlatforms[i];
            sp.GetComponent <PermanentRotation>().SetRotationEnabled(i == currentShipIndex);
        }
    }