Ejemplo n.º 1
0
    //public AbilityHyperDash abilityHyperDash;

    // Use this for initialization
    void Start()
    {
        //Physics.gravity = new Vector3 (0, 0, -9.81f);
        anim                  = GetComponent <Animator> ();
        basicMovement         = GetComponent <AbilityBasicMovement> ();
        attackAbility         = GetComponent <AttackAbility> ();
        shieldAbility         = GetComponent <AbilityShield> ();
        dodgeAbility          = GetComponent <AbilityDodgeRoll> ();
        sprintAttackAbility   = GetComponent <AbilitySprintAttack> ();
        chargedAttackAbility  = GetComponent <AbilityChargedAttack> ();
        warpStrikeAbility     = GetComponent <AbilityWarpStrike>();
        grabAbility           = GetComponent <AbilityGrab> ();
        flinchState           = GetComponent <PlayerStateFlinch> ();
        fallState             = GetComponent <AbilityFall> ();
        interactState         = GetComponent <AbilityInteract> ();
        dialogueState         = GetComponent <AbilityDialogue> ();
        hurtInfo              = GetComponent <HurtInfoReceiver> ();
        playerHealthComponent = GetComponent <PlayerHealthComponent>();
        //abilityHyperDash = GetComponent<AbilityHyperDash> ();

        //If Player doesn't exist yet
        if (!playerExists)
        {
            playerExists = true;
            DontDestroyOnLoad(transform.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        //Starting state for player
        playerState = PlayerState.Default;
    }
 // Use this for initialization
 void Start()
 {
     this.timer            = 0f;
     this.playerBody       = GetComponent <Rigidbody2D>();
     this.playerCollider   = GetComponent <BoxCollider2D>();
     this.chargedAttack    = GetComponent <AbilityChargedAttack>();
     this.DirectionHandler = new FourDirectionSystem();
     this.playerAttackInfo = GetComponent <AttackInfoContainer>();
     this.spriteRenderer   = GetComponent <SpriteRenderer>();
     this.playerAnim       = GetComponent <Animator>();
     this.warpState        = WarpState.Setup;
 }