void Start() { vision = GameObject.Find("Player").GetComponent <VisionManager>(); gameObjRenderer = gameObject.GetComponent <Renderer>(); isEnabled = false; elapsedTime = 0.0f; }
// Use this for initialization void Start() { scm = GetComponent <SimulatorCommandsManager>(); robot = scm.robot; uIDD = GetComponent <UniqueIdDistributor>(); vision = robot.GetComponent <VisionManager>(); smell = robot.GetComponent <SmellManager>(); hearing = robot.GetComponent <HearingManager>(); taste = robot.GetComponent <TasteManager>(); touch = robot.GetComponent <TouchManager>(); locationsOnScene = new List <GameObject>(GameObject.FindGameObjectsWithTag(Constants.TAG_KNOWLOCATIONS)); objectsInFildOfVision = new List <GameObject>(); soundsInHearing = new List <GameObject>(); knowObjInHearing = new List <GameObject>(); touchInTouch = new List <GameObject>(); knowObjInTouch = new List <GameObject>(); odorInSmell = new List <GameObject>(); knowObjInSmell = new List <GameObject>(); objectsInTaste = new List <GameObject>(); count = 0; SparqlEndPoint instanceSparql = SparqlEndPoint.getInstance(); // gets the instance for the singleton object instanceSparql.init(host, port); visionQueue = new Queue <GameObject>(); hearKnowQueue = new Queue <GameObject>(); hearUnkQueue = new Queue <GameObject>(); touchUnkQueue = new Queue <GameObject>(); touchKnowQueue = new Queue <GameObject>(); smellUnkQueue = new Queue <GameObject>(); atDateTime = DateTime.Now; Debug.Log("RHS>>> " + this.name + " is ready to receive request of Senses."); }
private void Awake() { // allows this instance to behave like a singleton instance = this; string path = "C:/ObjectDetectionForAR/ObjectDetectionForAR/Assets/Secure/authorizationKey.txt"; StreamReader reader = new StreamReader(path); authorizationKey = reader.ReadToEnd(); }
// Use this for initialization void Start() { avatarVision = GetComponent <VisionManager>(); animator = GetComponent <Animator>(); commandsQueue = new Queue <Command>(); aI = GetComponent <AgentInteraction>(); speech = GetComponent <AgentSpeech>(); locationsList = new List <GameObject>(); Debug.Log("RHS>>> " + this.name + " " + this.GetType() + " is ready."); }
private void OnGesturesTapped(TappedEventArgs obj) { if (ReceiverObject != null) { VisionManager mgr = ReceiverObject.GetComponent <VisionManager>(); if (mgr != null) { mgr.OnTapped(); } //ReceiverObject.SendMessage("OnTapped"); } }
public void IsAreaOpened_ReturnsTrueWhenAreaIsMainPlayersOne() { // arrange var manager = new VisionManager(); var area = new Area(); var player = new Player { Area = area }; // act var result = manager.IsAreaOpened(player, area); // assert Assert.AreEqual(true, result); }
void Start() { locationsOnScene = GameObject.FindGameObjectsWithTag(Constants.TAG_LOCATION); scm = GetComponent <SimulatorCommandsManager>(); vision = scm.robot.GetComponent <VisionManager>(); height = cam.pixelHeight; width = cam.pixelWidth; gameObjects = new HashSet <GameObject>(); text = component.GetComponent <Text>(); text.text = ""; foreach (GameObject item in locationsOnScene) { //dropObjects.options.Add(new Dropdown.OptionData() { text = item.name }); } }
void Start() { tr = this.GetComponent <Transform>(); meshRenderer = this.GetComponent <MeshRenderer>(); playerTr = GameObject.Find("Player").GetComponent <Transform>(); vision = GameObject.Find("Player").GetComponent <VisionManager>(); cameras = new Dictionary <VisionType.e_VisionType, List <Material> >(); cameras[VisionType.e_VisionType.RED] = redVisionCameras; cameras[VisionType.e_VisionType.GREEN] = greenVisionCameras; cameras[VisionType.e_VisionType.BLUE] = blueVisionCameras; TPs = new Dictionary <VisionType.e_VisionType, List <Transform> >(); TPs[VisionType.e_VisionType.RED] = redVisionTPs; TPs[VisionType.e_VisionType.GREEN] = greenVisionTPs; TPs[VisionType.e_VisionType.BLUE] = blueVisionTPs; }
public Session(World world, Building[] allBuildingPrototypes, Research root) { World = world; AllBuildingPrototypes = allBuildingPrototypes; PeopleManager = new PeopleManager(World); ArmiesManager = new ArmiesManager(); VisionManager = new VisionManager(); Clocks = new Clocks(World, PeopleManager, ArmiesManager); RootResearch = root; World.OnPlayerCreate += p => { Clocks.AddTimeObject(p); }; }
// Use this for initialization222 void Start() { robotVision = robot.GetComponent <VisionManager>(); robotSmell = robot.GetComponent <SmellManager>(); robotHearing = robot.GetComponent <HearingManager>(); robotTaste = robot.GetComponent <TasteManager>(); robotTouch = robot.GetComponent <TouchManager>(); locationsOnScene = new List <GameObject>(GameObject.FindGameObjectsWithTag(Constants.TAG_KNOWLOCATIONS)); commandsQueue = new Queue <Command>(); aI = robot.GetComponent <AgentInteraction>(); aM = robot.GetComponent <AgentMovement>(); hM = robot.GetComponent <AgentHeadMovement>(); sp = robot.GetComponent <AgentSpeech>(); locationsList = new List <GameObject>(locationsOnScene); Debug.Log("RHS>>> " + this.name + " ready."); }
void Start() { vision = GameObject.Find("Player").GetComponent <VisionManager>(); oculus = GameObject.FindObjectOfType <OVRPlayerController>(); animator = GetComponentInParent <Animator>(); playerInActivationZone = false; notActivatedYet = true; if (platformColor == VisionType.e_VisionType.RED) { shakingAxis = 1; } else if (platformColor == VisionType.e_VisionType.GREEN) { shakingAxis = 0; } else if (platformColor == VisionType.e_VisionType.BLUE) { shakingAxis = 1; } }
public void IsVisible_ReturnsTrueIfCellIsInVisionRangeOfBuilding() { // arrange var manager = new VisionManager(); var player = Mock.Of <Player>(); var world = new Mock <World>(); world .Setup(w => w.GetBuilding(It.IsAny <Vector>())) .Returns((Vector v) => v == new Vector(0, 0) ? new Building { Owner = player } : null); // act var result = manager.IsVisible(world.Object, player, new Vector(2, 2)); // assert Assert.IsTrue(result); }
private void Update() { if (!HasLoaded) { LoadManager.Update(); return; } MapData.Update(); VisionManager.Update(); DebugMenu.GlobalUpdate(); RegionManager.Update(); #region DEBUG Remove me if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.Mouse0)) { MapData.SetWallTile(Camera.main.ScreenToWorldPoint(Input.mousePosition), WallType.AllTypes[0].ID); } #endregion }
void Start() { scm = simulatorManager.GetComponent <SimulatorCommandsManager>(); sm = simulatorManager.GetComponent <SensesManager>(); vision = scm.robot.GetComponent <VisionManager>(); smell = scm.robot.GetComponent <SmellManager>(); hearing = scm.robot.GetComponent <HearingManager>(); taste = scm.robot.GetComponent <TasteManager>(); touch = scm.robot.GetComponent <TouchManager>(); robotHProp = scm.robot.GetComponent <HearingProperties>(); uid = scm.GetComponent <UniqueIdDistributor>(); height = robotCamera.pixelHeight; width = robotCamera.pixelWidth; textVision = visionComponent.GetComponent <Text>(); textSmell = smellComponent.GetComponent <Text>(); textHearing = hearingComponent.GetComponent <Text>(); textTaste = tasteComponent.GetComponent <Text>(); textTouch = touchComponent.GetComponent <Text>(); textSpeech = speechComponent.GetComponent <Text>(); commandTextField = statusPanel.Find("CommandText").GetComponent <Text>(); statusTextField = statusPanel.Find("StatusText").GetComponent <Text>(); textTaste.text = ""; textVision.text = ""; textSmell.text = ""; textHearing.text = ""; textTouch.text = ""; textSpeech.text = ""; if (timePanel != null) { playButton = timePanel.Find("PlayButton").GetComponent <UnityEngine.UI.Button>(); pauseButton = timePanel.Find("PauseButton").GetComponent <UnityEngine.UI.Button>(); stopButton = timePanel.Find("StopButton").GetComponent <UnityEngine.UI.Button>(); //stopButton.interactable = false; pauseSimulation(); } Debug.Log("RHS>>> " + this.name + " is ready."); }
protected override void OnDead() { base.OnDead(); VisionManager.RemoveVisibleEntity(this); }
protected override void Awake() { base.Awake(); VisionManager.AddVisibleEntity(this); }
private void Awake() { // allows this instance to behave like a singleton instance = this; Instantiate(TipsPanel, new Vector3(0, 0, 0), new Quaternion(0, 0, 1.6f, 0)); }
private void Awake() { // allows this instance to behave like a singleton instance = this; }
void Start() { idListOfRot = 0; robotVision = transform.GetComponent <VisionManager>(); Debug.Log("RHS>>> " + this.name + " is ready to receive Head Movement Commands."); }
void Start() { vision = GameObject.Find("Player").GetComponent <VisionManager>(); particleSystem = GetComponent <ParticleSystem>(); }
private void Awake() { instance = this; }
public void GetVision_ReturnsBuildingsInVision() { // arrange var buildingMocks = new[] { Mock.Of <Building>(b => b.Position == new Vector(0, 0)), Mock.Of <Building>(b => b.Position == new Vector(1, 4)), Mock.Of <Building>(b => b.Position == new Vector(1, 0)), Mock.Of <Building>(b => b.Position == new Vector(2, 0)), Mock.Of <Building>(b => b.Position == new Vector(0, 4)), }; var buildingsTable = new[, ] { { buildingMocks[0], null, null, null, buildingMocks[4], null, }, { buildingMocks[2], null, null, null, buildingMocks[1], null, }, { buildingMocks[3], null, null, null, null, null, }, { null, null, null, null, null, null, }, { null, null, null, null, null, null, }, { null, null, null, null, null, null, }, }; var worldMock = new Mock <World>(); worldMock .Setup(w => w.GetBuilding(It.IsAny <Vector>())) .Returns((Vector v) => buildingsTable[v.X, v.Y]); worldMock .SetupGet(w => w.Size) .Returns(() => new Vector( buildingsTable.GetLength(0), buildingsTable.GetLength(1))); var player = Mock.Of <Player>(p => p.OwnBuildings == new List <Building> { buildingMocks[0], buildingMocks[1] }); var manager = new VisionManager { VisionDefaultRange = 1 }; // act var result = manager.GetVision(worldMock.Object, player); // assert var expectedBuildingsTable = new[, ] { { buildingMocks[0], null, null, null, buildingMocks[4], null, }, { buildingMocks[2], null, null, null, buildingMocks[1], null, }, { null, null, null, null, null, null, }, }; for (var x = 0; x < expectedBuildingsTable.GetLength(0); x++) { for (var y = 0; y < expectedBuildingsTable.GetLength(1); y++) { Assert.AreEqual(expectedBuildingsTable[x, y], result.Buildings[x, y]); } } Assert.AreEqual(new Vector(0, 0), result.Position); }
private void Awake() { // allows this instance to behave like a singleton instance = this; m_Image = GetComponent <Image>(); }
void Awake() { vm = GameObject.FindObjectOfType <VisionManager>(); StartCoroutine("Co_AnimateBackground"); }
virtual protected void Awake() { vm = GameObject.FindObjectOfType <VisionManager>(); }
private void Awake() { ConsoleOut.SendText("VisionManager Awake"); // allows this instance to behave like a singleton instance = this; }
private void OnEnable() { script = target as VisionManager; }