示例#1
0
    private float distance = 0;       //相机和目标的距离
                                      //private float height = 1f;       //相机和目标的高度
                                      //private float heightDamping = 1;
                                      // Vector3 offsetPosition;

    // Use this for initialization
    void Start()
    {
        target   = GameObject.FindGameObjectWithTag("Player").transform;
        mc       = target.gameObject.GetComponent <moveController>();
        distance = Vector3.Distance(new Vector3(0, 0, target.position.z), new Vector3(0, 0, transform.position.z));

        //offsetPosition = target.position - transform.position;
    }
示例#2
0
    void catchKeyUp()
    {
        if (Input.GetKey("space") && block == 1)
        {
            Time.timeScale   = 1;
            imagem.enabled   = false;
            textoKey.enabled = false;
            catche           = false;
            block            = -1;

            SpriteRenderer sprite = GetComponent <SpriteRenderer> ();
            sprite.enabled = false;
            moveController chaves = player.GetComponent <moveController> ();
            chaves.SetKeyFinal(true);
        }
    }