Exemplo n.º 1
0
    private void Start()
    {
        enemiesControllerScript = FindObjectOfType <enemiesController>();
        am = FindObjectOfType <AudioManager>();

        controller       = GetComponent <CharacterController>();
        Cursor.lockState = CursorLockMode.Locked;
        animator         = GetComponent <Animator>();
        playerJson t = JsonUtility.FromJson <playerJson>(new JSONDemo("demo.json").getJson());

        transform.position = t.position;
        Quaternion thetas = Quaternion.Euler(t.rotation.x, t.rotation.y, t.rotation.z);

        transform.rotation   = thetas;
        transform.localScale = t.scale;
    }
Exemplo n.º 2
0
    private void Start()
    {
        moveSpeed               = 0;
        walkSpeed               = 2;
        groundCheckDistance     = 0.25f;
        groundMask              = LayerMask.GetMask("level1Ground");
        gravity                 = -9.81f;
        mouseSensetivity        = 100;
        enemiesControllerScript = FindObjectOfType <enemiesController>();
        am = FindObjectOfType <AudioManager>();

        controller       = GetComponent <CharacterController>();
        Cursor.lockState = CursorLockMode.Locked;
        animator         = GetComponent <Animator>();
        playerJson t = JsonUtility.FromJson <playerJson>(new JSONDemo("demo.json").getJson());
        //transform.position = t.position;
        Quaternion thetas = Quaternion.Euler(t.rotation.x, t.rotation.y, t.rotation.z);

        //transform.rotation = thetas;
        //transform.localScale = t.scale;
    }