Beispiel #1
0
    public override void endChannel()
    {
        base.endChannel();


        if (checkTarget())
        {
            teleportToPos(target);
        }
        else
        {
            playerInformation.gameObject.GetComponent <PlayerScript>().controller.Move(Vector3.right * ((playerInformation.facingRight) ? 5 : -5));
        }



        //Instantiates the hitbox and modifies it to the players location
        Transform newHitBox = Instantiate(hitbox.transform) as Transform;

        SwordHitBoxController swordHitBox = newHitBox.gameObject.GetComponent <SwordHitBoxController>();

        swordHitBox.ownerTag           = this.transform.parent.gameObject.tag;
        swordHitBox.transform.position = playerInformation.transform.position;
        swordHitBox.playerInformation  = playerInformation;

        //Checks the player location for directional instantiation.
        if (playerInformation.facingRight)
        {
            Vector3 playerScale = newHitBox.transform.localScale;
            playerScale.x        = playerScale.x * -1;
            newHitBox.localScale = playerScale;
        }
    }
Beispiel #2
0
    public override void endChannel()
    {
        base.endChannel();
        //Instantiates the hitbox and modifies it to the players location
        Transform newHitBox = Instantiate(hitbox.transform) as Transform;

        SwordHitBoxController swordHitBox = newHitBox.gameObject.GetComponent <SwordHitBoxController>();

        swordHitBox.ownerTag           = this.transform.parent.gameObject.tag;
        swordHitBox.transform.position = playerInformation.transform.position;
        swordHitBox.playerInformation  = playerInformation;

        //Checks the player location for directional instantiation.
        if (playerInformation.facingRight)
        {
            Vector3 playerScale = newHitBox.transform.localScale;
            playerScale.x        = playerScale.x * -1;
            newHitBox.localScale = playerScale;
        }
    }