Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     hub = GameObject.Find("hub").GetComponent<Hub>();
     target = hub.player.transform;
     transform.position = target.transform.position  - offset;
     transform.LookAt(target.position);
 }
 public void Start()
 {
     hub = GameObject.Find ("hub").GetComponent<Hub> ();
             latice = hub.latice;
             turnZones = new List<List<Quaternion>> ();
             zoneController = hub.zoneController;
 }
Esempio n. 3
0
 public void Start()
 {
     hub = GameObject.Find("hub").GetComponent<Hub>();
     line = GetComponent<LineRenderer>();
         qTo = goTarget.transform.localRotation;
     goTarget = GameObject.Find("Player").gameObject;
 }
 public bool DeleteHub(Hub hub)
 {
     if (hub == null) return false;
     _unitOfWork.HubRepository.Delete(hub);
     _unitOfWork.Save();
     return true;
 }
 public void Start()
 {
     hub = GameObject.Find("hub").GetComponent<Hub>();
     if (hub.latice.Active) {
         hub.latice.AddObjectToLatice (this.gameObject);
     }
 }
Esempio n. 6
0
		static void Main(string[] args)
		{
			try
			{
				using (var hub = new Hub("com.example.hello-myo"))
				{
					Console.WriteLine("Attempting to find a Myo...");
					IMyo myo = hub.WaitForMyo(TimeSpan.FromSeconds(10));
					if (myo == null)
						throw new TimeoutException("Unable to find a Myo!");

					Console.WriteLine("Connected to a Myo armband!\n");

					hub.MyoUnpaired += OnUnpair;

					myo.PoseChanged += OnPoseChanged;
					myo.OrientationDataAcquired += OnOrientationData;
					myo.RecognizedArm += OnRecognizedArm;
					myo.LostArm += OnLostArm;
					
					while (true)
					{
						hub.Run(TimeSpan.FromMilliseconds(1000 / 20));
						PrintDisplay( );
					}
				}
			}
			catch (Exception e)
			{
				Console.WriteLine("Error: {0}", e.Message);
				Console.WriteLine("Press any key to continue.");
				Console.ReadKey();
			}
		}
Esempio n. 7
0
    // Use this for initialization
    void Start()
    {
        hub = GameObject.FindWithTag("Hub").GetComponent<Hub>();
        gameSpeed = hub.gameSpeed;
        if(transform.gameObject.name == "ImprovedFlame(Clone)")
        {
            health = 50;
            maxhealth = 50;
            damage = 0.25f;
        }
        else if (transform.gameObject.name == "GreaterFlame(Clone)")
        {
            health = 100;
            maxhealth = 100;
            damage = 0.5f;
        }
        else
        {
            health = 5;
            maxhealth = 5;
            damage = 0.25f;
        }
        FindChild("FlameBody").transform.Rotate(Vector3.right, 60);
        StartCoroutine("DamageBuilding");
	}
    // Use this for initialization
    void Start()
    {
        hub = GameObject.Find("hub").GetComponent<Hub>();
        Asteroids = new List<GameObject>();
        if(!square){
            for (int x = 0; x < Num_Asteroids; x++) {
                Asteroids.Add(SpawnAsteroid(x.ToString()));
            }
        }else{
            Num_Asteroids*=2;
            Num_Asteroids++;
            int arenaSize = hub.latice.ArenaSize;
            int spaceing = (int)(2*arenaSize/Num_Asteroids+1);
            for(int i = 3 ; i < Num_Asteroids-2;i++){
                for(int j = 3 ; j < Num_Asteroids-2;j++){
                    for(int k = 3 ; k < Num_Asteroids-2;k++){
                        if(i!=0 && k!=0&&j!=0){
                        GameObject cube = Instantiate(hub.asteroid) as GameObject;
                        cube.transform.localScale = new Vector3(AsteroidSize,AsteroidSize,AsteroidSize);
                        //cube.rigidbody.mass=AsteroidSize*10;
                            cube.rigidbody.mass=AsteroidSize;
                            cube.name = "Asteroid"+i+j;

                        cube.transform.position = new Vector3(-arenaSize + spaceing*i,-arenaSize + spaceing*k,-arenaSize + spaceing*j)*0.9f;

                        }
                    }
                }
            }
        }
    }
    public void Start()
    {
        hub = GameObject.Find("hub").GetComponent<Hub>();
        MasterZoneList = new List<List<Quaternion>>();
        for(int i = 0; i<= latice._max_Iterations;i++){
            MasterZoneList.Add(new List<Quaternion>());
            MasterFreshness.Add (0);
        }

        for(int x = -latice._max_Iterations; x <= latice._max_Iterations; x++){
            for(int y = -latice._max_Iterations; y <= latice._max_Iterations; y++){
                for(int z = -latice._max_Iterations; z <= latice._max_Iterations; z++){
                    if(Mathf.Max (Mathf.Abs (x),Mathf.Abs (y),Mathf.Abs (z)) > 0){
                        MasterZoneList[Mathf.Max (Mathf.Abs (x),Mathf.Abs (y),Mathf.Abs (z))].Add (new Quaternion(x,y,z,(Mathf.Max (Mathf.Abs (x),Mathf.Abs (y),Mathf.Abs (z)))));
                    }
                }
            }
        }

            for(int i = 1 ; i < MasterZoneList.Count;i++){

                    MasterFreshness[i]=Time.frameCount;
                    MasterZoneList[i] = MasterZoneList[i].OrderBy(x=> Vector3.Angle(new Vector3(x.x,x.y,x.z), hub.LaticeBox.transform.InverseTransformDirection(transform.forward))).ToList();
                }
    }
    void Start()
    {
        hub = GameObject.Find("hub").GetComponent<Hub>();

        Looper =  GetComponent<Looper>();

        startZone = hub.player.GetComponent<Looper>().LoopCounter;
        GameObject Projection = new GameObject ();
        Clone_Props = Projection.AddComponent<CloneProperties>();
        Projection.AddComponent <MeshRenderer> ();
        Projection.renderer.material = renderer.material;
        Mesh mesh = GetComponent<MeshFilter> ().mesh;
        Projection.AddComponent<MeshFilter> ().mesh = mesh;
        renderer.enabled=false;;
        Projection.transform.localScale = transform.localScale;
        Projection.name = this.gameObject.name + "_Projection";
        Clone_Props.Original = transform;
        Clone_Props.self = Projection;
        renderer.enabled=false;
        Vector3 loop = Looper.LoopCounter;
        if(Clone_Props!=null){
            Vector3 Offset = loop  - (hub.player.GetComponent<Looper>().LoopCounter-startZone);
            Clone_Props.self.transform.position = hub.LaticeBox.transform.localToWorldMatrix.MultiplyPoint (Offset + hub.LaticeBox.transform.InverseTransformPoint (transform.position));
        }
    }
Esempio n. 11
0
    /*****************************************/


    // Use this for initialization
    void Start() {
        agent = gameObject.GetComponent<PerceptionInterface>();
        hub = GameObject.FindWithTag("Hub").GetComponent<Hub>();
        _firefighters = new List<GameObject>();
        gameSpeed = hub.gameSpeed;
        StartCoroutine(test(2f));
	}
Esempio n. 12
0
 void Start()
 {
     hub = GameObject.Find("hub").GetComponent<Hub>();
     if (hub.latice.Active) {
     }
     Destroy (gameObject, 60f);
     audio.Play();
 }
        public void When_updating_existing_topic()
        {
            var topicUrl = "http://localhost/topic1";
            var hub = new Hub(new FakeSubscriptionVerifier(true), new FakeFeedProvider(null));
            hub.NewSubscriberSynchronous(topicUrl, "", "verifytoken");

            hub.Update(topicUrl);
        }
Esempio n. 14
0
        public bool Initialize(IGenesisApplication app)
        {
            if (_hub == null)
                _hub = new Hub();

            _hub.RegisterApplication(app);

            return true;
        }
Esempio n. 15
0
 public Factory(Settings.IProvider settingsProvider, Hub.Authentication.IProvider hubAuthenticationProvider, Hub.Endpoint.IFactory endpointFactory, Messages.IFactory messageFactory, Messages.IMediator messageMediator, IAsyncHelper asyncHelper)
 {
     _settingsProvider = settingsProvider;
     _hubAuthenticationProvider = hubAuthenticationProvider;
     _endpointFactory = endpointFactory;
     _messageFactory = messageFactory;
     _messageMediator = messageMediator;
     _asyncHelper = asyncHelper;
 }
Esempio n. 16
0
	// Use this for initialization
    void Start()
    {
        hub = GameObject.FindWithTag("Hub").GetComponent<Hub>();
		completed = 0;
        building = Instantiate(Resources.Load("Prefab/building_placeholder"), new Vector3(transform.position.x, transform.position.y-32.0f, transform.position.z), transform.rotation) as GameObject; 
		building.transform.parent = transform;
        building.transform.Rotate(building.transform.right, -90, Space.World);
        building.GetComponentInChildren<Renderer>().enabled = false;
	}
Esempio n. 17
0
        public Endpoint(Hub.IFactory hubFactory, Registration.IFactory registrationFactory)
        {
            _debug = new ObservableStreamWriter();

            _hubFactory = hubFactory;
            _registrationFactory = registrationFactory;

            _registrations = new Registration.Collection();
        }
        public void When_a_publisher_registers_a_new_topic()
        {
            var hubTopic = "http://localhost:8080/topic1"; //the url of the topic
            var hub = new Hub(new FakeSubscriptionVerifier(true), new FakeFeedProvider(null));

            hub.NewTopic(hubTopic);

            Assert.That(hub.GetTopics(), Has.Count.EqualTo(1));
            Assert.That(hub.GetTopics(), Contains.Item(hubTopic));
        }
Esempio n. 19
0
	void Start()
	{
        prefabSimple = Resources.Load("Prefab/Flame") as GameObject;
        prefabImproved = Resources.Load("Prefab/ImprovedFlame") as GameObject;
        prefabGreater = Resources.Load("Prefab/GreaterFlame") as GameObject;
        hub = GameObject.FindWithTag("Hub").GetComponent<Hub>();
        gameSpeed = hub.gameSpeed;
        int randomizer = Random.Range(300/gameSpeed, 600/gameSpeed);
        Invoke("generateFires", randomizer);
	}
        public void When_client_subscribes_for_a_non_existant_topic()
        {
            var topicUrl = "http://localhost:8080/topic1";
            var callBackUrl = "http://host/callback";
            var verifyToken = "verifytoken";
            var hub = new Hub(new FakeSubscriptionVerifier(true), new FakeFeedProvider(null));

            hub.NewTopic(topicUrl);
            Assert.Throws<KeyNotFoundException>(() => hub.NewSubscriberSynchronous("wrongtopic", callBackUrl, verifyToken));
        }
Esempio n. 21
0
	// Use this for initialization
	void Start () {
        speed = 0.25f;
        hub = GameObject.FindWithTag("Hub").GetComponent<Hub>();
        gameSpeed = hub.gameSpeed;
        if (!File.Exists("Report.txt"))
        {
            Debug.Log("Creating File");
            File.Create("Report.txt");
        }
	}
        public void Publishes_to_simple_subscriber()
        {
            var aggregator = new Hub();

            var handled = false;
            aggregator.Subscribe<StringEvent>(se => { handled = true; });

            var sent = aggregator.Publish(new StringEvent("Foo"));
            Assert.IsTrue(sent);
            Assert.IsTrue(handled);
        }
Esempio n. 23
0
 void Start()
 {
     hub = GameObject.Find ("hub").GetComponent<Hub>();
     if(transform.parent!=null) target= transform.parent;
     thisTransform = transform;
     if (useMainCamera)
         cam = Camera.main;
     else
         cam = cameraToUse;
     camTransform = cam.transform;
 }
Esempio n. 24
0
    /****************************************/

    public void Start()
    {
        //Initialize some objects
        barrelEnd = FindChild("BarrelEnd");
		buildingJetprefab = (GameObject)Resources.Load("Prefab/Build Jet");

        hub = GameObject.FindWithTag("Hub").GetComponent<Hub>();
        gameSpeed = hub.gameSpeed;
		buildJetLifeTime = buildingJetprefab.particleSystem.startLifetime;
		move = GetComponent<BuilderMove>();
    }
        public void Publishes_to_handler()
        {
            var aggregator = new Hub();

            var handler = new StringEventHandler();    
            aggregator.Subscribe(handler);

            var sent = aggregator.Publish(new StringEvent("Foo"));
            Assert.IsTrue(sent);
            Assert.IsTrue(handler.Handled);
        }
        public void When_client_subscribes_for_the_first_time()
        {
            var topicUrl = "http://localhost:8080/topic1";
            var callBackUrl = "http://host/callback";
            var verifyToken = "verifytoken";
            var hub = new Hub(new FakeSubscriptionVerifier(true), new FakeFeedProvider(null));

            hub.NewTopic(topicUrl);
            hub.NewSubscriberSynchronous(topicUrl, callBackUrl, verifyToken);

            CollectionAssert.Contains(hub.Subscribers(), new Subscriber(callBackUrl, true));
        }
Esempio n. 27
0
	// Use this for initialization
	void Start () {
        hub = GameObject.FindWithTag("Hub").GetComponent<Hub>();
        gameSpeed = hub.gameSpeed;
        if (transform.parent.tag == "Builder")
        {
            agent = transform.parent.GetComponent<Builder>();
        }
        else if (transform.parent.tag == "FireFighter")
        {
            agent = transform.parent.GetComponent<PerceptionInterface>();
        }
	}
 public Guid CreateAccount(Hub.Models.User user)
 {
     user.Password = CreateMD5HashCode(user.Password);
     user.RegisterTime = DateTime.Now;
     user.Status = 1;
     using (var db = new ExtensionFrameworkContext())
     {
         db.Users.Add(user);
         db.SaveChanges();
     }
     return user.UserID;
 }
Esempio n. 29
0
    /****************************************/

    void Start()
    {
        //Initialize some objects
        barrelEnd = FindChild("BarrelEnd");
        waterJetprefab = (GameObject)Resources.Load("Prefab/Water Jet");

        hub = GameObject.FindWithTag("Hub").GetComponent<Hub>();
        gameSpeed = hub.gameSpeed;
        waterJetLifeTime = waterJetprefab.particleSystem.startLifetime;
        move = GetComponent<ReactiveFireFighterMove>();
        fireParticipants = new List<ReactiveFireFighter>();
    }
Esempio n. 30
0
 public static void OnReconnected(Hub hub)
 {
     string[] groups;
     _groups.TryGetValue(hub.Context.ConnectionId, out groups);
     if (groups != null)
     {
         foreach (var key in groups)
         {
             hub.Groups.Add(hub.Context.ConnectionId, key);
         }
     }
 }
Esempio n. 31
0
 public void OpenMap()
 {
     Hub.Publish(EventConstants.OPEN_MAP);
 }
Esempio n. 32
0
 public void Shoot()
 {
     Hub.Publish(EventConstants.FIRE);
 }
Esempio n. 33
0
 public void Kaboom()
 {
     Hub.Publish(EventConstants.KABOOM);
 }
Esempio n. 34
0
 // Token: 0x060025D3 RID: 9683 RVA: 0x000BA89E File Offset: 0x000B8C9E
 private void Rejoined(Hub hub, MethodCallMessage methodCall)
 {
     this.messages.Add(string.Format("{0} reconnected at {1}", methodCall.Arguments[0], methodCall.Arguments[1]));
 }
Esempio n. 35
0
 // Token: 0x060025D4 RID: 9684 RVA: 0x000BA8C5 File Offset: 0x000B8CC5
 private void Left(Hub hub, MethodCallMessage methodCall)
 {
     this.messages.Add(string.Format("{0} left at {1}", methodCall.Arguments[0], methodCall.Arguments[1]));
 }
Esempio n. 36
0
 // Token: 0x060025D5 RID: 9685 RVA: 0x000BA8EC File Offset: 0x000B8CEC
 private void Invoked(Hub hub, MethodCallMessage methodCall)
 {
     this.messages.Add(string.Format("{0} invoked hub method at {1}", methodCall.Arguments[0], methodCall.Arguments[1]));
 }
Esempio n. 37
0
 public void Pause()
 {
     Hub.Publish(EventConstants.PAUSE);
 }