Exemple #1
0
    IEnumerator ActivateSword()
    {
        yield return(new WaitForSeconds(0.2f));

        SwordCollider.SetActive(true);
        yield return(new WaitForSeconds(0.4f));

        SwordCollider.SetActive(false);
    }
Exemple #2
0
 void Start()
 {
     localScale           = transform.localScale;
     scaleTo              = new Vector3(0, localScale.y, localScale.z);
     transform.localScale = scaleTo;
     Rotate();
     sc = GetComponent <SwordCollider>();
     StartCoroutine(GrowerNotShower());
 }
 // Use this for initialization
 void Start()
 {
     //playerInfo = GetComponent<PlayerInfoContainer> ();
     movementInfo       = GetComponent <AbilityBasicMovement> ();
     playerAttackInfo   = GetComponent <AttackInfoContainer> ();
     swordCollider      = GameObject.Find("Sword Collider Down").GetComponent <SwordCollider> ();    //Down
     swordColliderUp    = GameObject.Find("Sword Collider Up").GetComponent <SwordCollider> ();
     swordColliderLeft  = GameObject.Find("Sword Collider Left").GetComponent <SwordCollider> ();
     swordColliderRight = GameObject.Find("Sword Collider Right").GetComponent <SwordCollider> ();
     playerBody         = GetComponent <Rigidbody2D> ();
     DirectionHandler   = new FourDirectionSystem();
     playerAnimator     = GetComponent <Animator> ();
 }
    //NOTE: Will need to add additional collider references for sprint attacks
    // and for the chain attacks if they end up being different

    void Start()
    {
        playerAttackInfo = GetComponent <AttackInfoContainer>();
        swordCollider    = GameObject.Find("Sword Collider Down").GetComponent <SwordCollider>(); //Down
        swordColliderUp  = GameObject.Find("Sword Collider Up").GetComponent <SwordCollider>();
        if (swordColliderUp == null)
        {
            Debug.Log("NULL UP ");
        }
        swordColliderLeft  = GameObject.Find("Sword Collider Left").GetComponent <SwordCollider>();
        swordColliderRight = GameObject.Find("Sword Collider Right").GetComponent <SwordCollider>();

        playerBody = GetComponent <Rigidbody2D>();
        //orientationSystem = GetComponent<OrientationSystem>();
        DirectionHandler = new FourDirectionSystem();
        playerAnimator   = GetComponent <Animator>();
        movementInfo     = GetComponent <AbilityBasicMovement>();
        comboCount       = 0;
        bufferInput      = false;
        chargeAttack     = false;
    }
Exemple #5
0
    public override void Action(GameObject user, Ability ability)
    {
        Animator anim = user.GetComponent <Animator>();

        anim.SetTrigger("isAttacking");

        Vector2 direction = PlayerInformation.Direction;

        Vector3 swordHitPosition = new Vector3(user.transform.position.x, user.transform.position.y, 0);

        Vector3 position = new Vector3(swordHitPosition.x + (direction.x * range), swordHitPosition.y + (direction.y * range), 0);

        GameObject sword = GameObject.Instantiate(prefab, position, Quaternion.identity) as GameObject;

        sword.transform.parent = user.transform;

        SwordCollider swordCol = sword.GetComponent <SwordCollider>();

        swordCol.User = user;
        swordCol.Action(ability);
    }
Exemple #6
0
    // Use this for initialization
    void Start()
    {
        playerAttackInfo = GetComponent <AttackInfoContainer> ();
        //playerOrientation = GetComponent<PlayerOrientation> ();
        movementInfo   = GetComponent <AbilityBasicMovement> ();
        playerBody     = GetComponent <Rigidbody2D> ();
        spriteRenderer = GetComponent <SpriteRenderer> ();
        animator       = GetComponent <Animator> ();
        //orientationSystem = GetComponent<OrientationSystem> ();
        DirectionHandler  = new FourDirectionSystem();
        chargeAttackState = ChargeAttackState.Setup;

        colliderUp    = GameObject.Find("cAttack Collider Up").GetComponent <SwordCollider> ();
        colliderDown  = GameObject.Find("cAttack Collider Down").GetComponent <SwordCollider> ();
        colliderLeft  = GameObject.Find("cAttack Collider Left").GetComponent <SwordCollider> ();
        colliderRight = GameObject.Find("cAttack Collider Right").GetComponent <SwordCollider> ();

        colliderUp.DisableCollider();
        colliderDown.DisableCollider();
        colliderRight.DisableCollider();
        colliderLeft.DisableCollider();
    }