Ejemplo n.º 1
0
    public void setTheParent(Transform newParent)
    {
        //cameraPos.y = 8;
        //cameraPos.x = newParent.forward.x + 3;
        //cameraPos.z = newParent.forward.z * -10;


        transform.SetPositionAndRotation(cameraPos, newParent.rotation);

        transform.Rotate(0, -30, 0);//
        originalRotation = transform.localRotation;
        parent           = newParent.gameObject;
        transform.SetParent(newParent);

        //transform.localPosition = new Vector3(1.5f, 2f, -1f);//
        transform.localPosition = new Vector3(1.5f, 2f, -1f);

        pc        = parent.GetComponent <playerController> ();
        pbc       = parent.GetComponent <playerBlasterController>();
        gc        = parent.GetComponentInChildren <GameController>();
        hasPlayer = true;
        pregameCanvas.SetActive(false);
    }