Exemple #1
0
        protected virtual void Awake()
        {
            _render = GetComponent <SpriteRenderer>();

            _originCheckedSprite = _render.sprite;

            _detector = new TouchDetector(checkCollider);
            _detector.OnTouchEvent += OnTouchEvent;
        }
Exemple #2
0
        void Awake()
        {
            _collider = GetComponent <BoxCollider2D>();
            _detector = new TouchDetector(_collider);
            _boxScope = Vector2DUtils.GetBoxCollider2DScope(_collider);
            _vertical = Mathf.Abs(_boxScope [1].y - _boxScope [0].y) > Mathf.Abs(_boxScope [1].x - _boxScope [0].x);

            _detector.OnTouchEvent += OnTouchEvent;
        }