Пример #1
0
    public void Awake()
    {
        State = new controllerState();

        _stats.curAbility = 1;
        _stats.loadAbilities();
        _velocity    = _normalizedForce = new Vector2(0.0f, 0.0f);
        _transform   = transform;
        _boxCollider = GetComponent <BoxCollider2D>();

        var colliderWidth = _boxCollider.size.x - (2 * skinWidth);

        _horizontalDistanceBetweenRays = colliderWidth / (totalRays - 1);

        var colliderHeight = _boxCollider.size.y - (2 * skinWidth);

        _verticalDistanceBetweenRays = colliderHeight / (totalRays - 1);
    }