コード例 #1
0
    public void DeactivateCorrespondingCollider(FourDirections dir)
    {
        switch (dir)
        {
        case FourDirections.North:
            //Debug.Log ("North");
            //Activate RightUp collider and animation
            colliderUp.DisableCollider();
            break;

        case FourDirections.East:
            //Debug.Log ("East");
            colliderRight.DisableCollider();
            break;

        case FourDirections.South:
            //Debug.Log ("South");
            colliderDown.DisableCollider();
            break;

        case FourDirections.West:
            //Debug.Log ("West");
            colliderLeft.DisableCollider();
            break;
        }
    }
コード例 #2
0
    private void DeactivateCorrespondingCollider(FourDirections dir)
    {
        switch (dir)
        {
        case FourDirections.North:
            Debug.Log("RIGHT UP");
            swordColliderUp.DisableCollider();
            break;

        case FourDirections.East:
            Debug.Log("UP LEFT");
            swordColliderRight.DisableCollider();
            break;

        case FourDirections.South:
            Debug.Log("LEFT DOWN");
            swordCollider.DisableCollider();
            break;

        case FourDirections.West:
            Debug.Log("DOWN RIGHT");
            swordColliderLeft.DisableCollider();
            break;
        }
    }
コード例 #3
0
    private void DeactivateCorrespondingCollider(FourDirections direction)
    {
        switch (direction)
        {
        case FourDirections.North:
            //Debug.Log ("North");
            swordColliderUp.DisableCollider();
            break;

        case FourDirections.East:
            //Debug.Log ("East");
            swordColliderRight.DisableCollider();
            break;

        case FourDirections.South:
            //Debug.Log ("South");
            swordCollider.DisableCollider();
            break;

        case FourDirections.West:
            //Debug.Log ("West");
            swordColliderLeft.DisableCollider();
            break;
        }
    }
コード例 #4
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();
    }