Exemple #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.setFoundAlvin(true);
                    firstSight = false;
                    countdown  = true;
                    calcText();
                    dialogue.checkConditions(1, numText);
                    foundAlvin = true;
                }
            }
        }
        if (countdown)
        {
            timer -= Time.deltaTime;
            if (timer < 0 && tpToBase)
            {
                countdown             = false;
                tpToBase              = false;
                hastped               = true;
                transform.position    = new Vector3(-52.8f, 372.4f, -78.7f);
                transform.eulerAngles = new Vector3(-13.54f, -29.445f, 24.596f);
                gameObject.GetComponent <SphereCollider>().radius = 5;
            }
        }
    }