示例#1
0
 private void SetUpDistanceDetector()
 {
     _distanceDetector = gameObject.AddComponent <DistanceDetector>();
     _distanceDetector.DetectionDistance        = interactReach;
     _distanceDetector.targetTag                = interactableTag;
     _distanceDetector.OnColliderOutsideRadius += UnHighlightInteractable;
 }
示例#2
0
 public SensorManager()
 {
     central   = new DistanceDetector(PortMap.infraredL1, DistanceDetector.SharpSensorType.GP2Y0A21YK);
     wall      = new DistanceDetector(PortMap.infraredS2, DistanceDetector.SharpSensorType.GP2D120);
     wall_back = new DistanceDetector(PortMap.infraredS1, DistanceDetector.SharpSensorType.GP2D120);
     right     = new DistanceDetector(PortMap.infraredL2, DistanceDetector.SharpSensorType.GP2Y0A21YK);
 }
示例#3
0
        private void Awake()
        {
            _distanceDetector                   = gameObject.AddComponent <DistanceDetector>();
            _distanceDetector.targetTag         = "Grabbable";
            _distanceDetector.DetectionDistance = grabbingDistance;

            _distanceDetector.OnColliderInsideRadius += ColliderNear;
        }
示例#4
0
        void Awake()
        {
            singleton = this;
            config.Setup();
            UpdateRenderPoint(Vector3.zero);

            detector = GetComponent <DistanceDetector>();
            detector.onEscape.AddListener(() => UpdateRenderPoint(detector.TargetPosition()));
        }
        // Unity methods

        void Awake()
        {
            singleton = this;
            config.Setup();
            dataPreloader        = new DataPreloader(radius + cacheRadius, chunkSize, Vector3.zero);
            minimapDataPreloader = new MinimapDataPreloader();
            UpdateRenderPoint(Vector3.zero);

            detector = GetComponent <DistanceDetector>();
        }
示例#6
0
        private void Awake()
        {
            _enemy = GetComponent <AEnemy>();

            _enemy.OnDie     += OnDie;
            RigidBody         = GetComponent <Rigidbody2D>();
            Player            = FindObjectOfType <APlayer>().transform;
            _distanceDetector = gameObject.AddComponent <DistanceDetector>();
            _distanceDetector.DetectionDistance = visionRange;
            _distanceDetector.targetTag         = "Player";

            StateMachine = new StateMachine();

            Mover = new Mover(spriteRenderer, RigidBody, Stats.Speed);
            SetUpStates();
        }