Esempio n. 1
0
    public bool is_attacking = false; //used to control collision window

    private void Start()
    {
        next_attack         = 0;
        my_gamepad          = GetComponent <PlayerGamepad> ();
        camera_anchor       = GameObject.Find("Camera Anchor");
        player_weapon       = GameObject.Find("PlayerWeapon").transform;
        weapon              = GameObject.Find("WeaponPivot");
        forward             = transform.TransformDirection(Vector3.forward);
        something_too_close = false;
    }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        invulnerable = false;
        invulCounter = 0;

        Debug.Log(invulCounter);
        anim = GetComponent<Animator>();
        player = GameObject.Find("Player");
        //ps = (PlayerScript)player.GetComponent(typeof(PlayerScript));
        ps = (PlayerGamepad)player.GetComponent(typeof(PlayerGamepad));
    }
Esempio n. 3
0
    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player") && !isTurning)
        {
            playerObject  = other.transform;
            player        = playerObject.GetComponent <PlayerMachine>();
            camera        = player.gameManager.mainCamera.GetComponent <CameraController>();
            input         = player.gameManager.playerGamepad;
            startRotation = playerObject.rotation.eulerAngles;

            isTurning = true;
            StartCoroutine(TurnPlayer(targetRotation, false));
        }
    }
Esempio n. 4
0
    private void Awake()
    {
        my_combat  = this.GetComponentInParent <Combat> ();
        playerGO   = GameObject.Find("Player");
        player_pad = playerGO.GetComponent <PlayerGamepad>();


        if (PH == null)
        {
            PH = this;
        }


        // ---------------
        //James Added Here
        // ---------------
        cam_script = GameObject.Find("Camera Anchor").GetComponent <NewDynamicCameraBehavior>();
    }
    private void Awake()
    {
        battleAreas   = GameObject.FindGameObjectsWithTag("battleArea");
        allEnemies    = GameObject.FindGameObjectsWithTag("Enemy"); // Finds all objects in the scene with the tag "enemy"
        EnemySpawnLoc = new Vector3 [allEnemies.Length];

        for (int i = 0; i < allEnemies.Length; i++)              //go through all enemies currently on the map at the start of the game
        {
            EnemySpawnLoc[i] = allEnemies[i].transform.position; //Set a list of Vectors "EnemySpawnLoc" to a list of the enemy's positions at the start of the map so it can be saved for respawning the enemy
            //print(EnemySpawnLoc[i]);
            //print(allEnemies[i]);
        }
        ThePlayer = GameObject.FindGameObjectWithTag("Player"); //Set ThePlayer to the Player asset within the scene



        player_gamepad = ThePlayer.GetComponent <PlayerGamepad>(); //Get the reference to the player's gamepad.
    }
Esempio n. 6
0
 private void Awake()
 {
     player_pad = GameObject.Find("Player").GetComponent <PlayerGamepad>();
 }