private void SetUpDistanceDetector() { _distanceDetector = gameObject.AddComponent <DistanceDetector>(); _distanceDetector.DetectionDistance = interactReach; _distanceDetector.targetTag = interactableTag; _distanceDetector.OnColliderOutsideRadius += UnHighlightInteractable; }
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); }
private void Awake() { _distanceDetector = gameObject.AddComponent <DistanceDetector>(); _distanceDetector.targetTag = "Grabbable"; _distanceDetector.DetectionDistance = grabbingDistance; _distanceDetector.OnColliderInsideRadius += ColliderNear; }
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>(); }
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(); }