예제 #1
0
 void Start()
 {
     vision          = GameObject.Find("Player").GetComponent <VisionManager>();
     gameObjRenderer = gameObject.GetComponent <Renderer>();
     isEnabled       = false;
     elapsedTime     = 0.0f;
 }
예제 #2
0
    // 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.");
    }
예제 #3
0
    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();
    }
예제 #4
0
    // 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.");
    }
예제 #5
0
    private void OnGesturesTapped(TappedEventArgs obj)
    {
        if (ReceiverObject != null)
        {
            VisionManager mgr = ReceiverObject.GetComponent <VisionManager>();

            if (mgr != null)
            {
                mgr.OnTapped();
            }

            //ReceiverObject.SendMessage("OnTapped");
        }
    }
예제 #6
0
        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);
        }
예제 #7
0
    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 });
        }
    }
예제 #8
0
    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;
    }
예제 #9
0
        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);
            };
        }
예제 #10
0
    // 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.");
    }
예제 #11
0
 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;
     }
 }
예제 #12
0
        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);
        }
예제 #13
0
    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
    }
예제 #14
0
    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);
    }
예제 #17
0
 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));
 }
예제 #18
0
 private void Awake()
 {
     // allows this instance to behave like a singleton
     instance = this;
 }
예제 #19
0
 void Start()
 {
     idListOfRot = 0;
     robotVision = transform.GetComponent <VisionManager>();
     Debug.Log("RHS>>> " + this.name + " is ready to receive Head Movement Commands.");
 }
예제 #20
0
 void Start()
 {
     vision         = GameObject.Find("Player").GetComponent <VisionManager>();
     particleSystem = GetComponent <ParticleSystem>();
 }
예제 #21
0
 private void Awake()
 {
     instance = this;
 }
예제 #22
0
        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);
        }
예제 #23
0
 private void Awake()
 {
     // allows this instance to behave like a singleton
     instance = this;
     m_Image  = GetComponent <Image>();
 }
예제 #24
0
 void Awake()
 {
     vm = GameObject.FindObjectOfType <VisionManager>();
     StartCoroutine("Co_AnimateBackground");
 }
예제 #25
0
 virtual protected void Awake()
 {
     vm = GameObject.FindObjectOfType <VisionManager>();
 }
예제 #26
0
 private void Awake()
 {
     ConsoleOut.SendText("VisionManager Awake");
     // allows this instance to behave like a singleton
     instance = this;
 }
예제 #27
0
 private void OnEnable()
 {
     script = target as VisionManager;
 }