Esempio n. 1
0
    void Update()
    {
        var closeness = Warp.closenessFactor(transform.position, Facts.portalDisplayDistance);

        if (closeness == 0.0f)
        {
            portalTransform.gameObject.SetActive(false);

            return;
        }

        portalTransform.gameObject.SetActive(true);

        meshTransform.localScale           = Vector3.Lerp(minimumScale, maximumScale, closeness);
        meshTransform.transform.position   = WorldSphere.projectPoint(transform.position);
        cameraTransform.transform.position = Warp.warp(portalTransform.position, 0.0f);

        cameraTransform.transform.LookAt(DistanceFromCenter.center, Facts.up);
        meshTransform.transform.LookAt(DistanceFromCenter.center, Facts.up);

        meshTransform.Rotate(new Vector3(1.0f, 0.0f, 0.0f), 90.0f);
    }