Пример #1
0
    // Update is called once per frame
    void Update()
    {
        if (lookAt)
        {
            this.transform.LookAt(playerT.position);
        }

        targetDirection    = (transform.position - planetT.position).normalized;
        transform.rotation = Quaternion.FromToRotation(transform.up, targetDirection) * transform.rotation;

        if (playerCol == true)
        {
            if (Input.GetKeyUp(KeyCode.E) && triggersIn == 2)
            {
                if (tpToBase)
                {
                    planetGravityBody.setFoundRidi(true);
                    firstSight = false;
                    countdown  = true;
                    calcText();
                    dialogue.checkConditions(2, numText);
                    foundRidi = true;
                }
            }
        }
        if (countdown)
        {
            timer -= Time.deltaTime;
            if (timer < 0 && tpToBase)
            {
                countdown             = false;
                tpToBase              = false;
                hastped               = true;
                transform.position    = new Vector3(-21.8f, 400.6f, -6.4f);
                transform.eulerAngles = new Vector3(-5.58f, -266.5f, -1.74f);
                gameObject.GetComponent <SphereCollider>().radius = 5;
            }
        }
    }