Example #1
0
 private void OnPlayerReady(PlayerDevice player)
 {
     //Debug.Log("Player " + player.id + " ready");
     if(AllPlayersReady())
     {
         InputSignals.StartGame.Dispatch();
     }
 }
Example #2
0
    public void BotaoEncerrar()
    {
        pausePanel.SetActive(false);
        warningPanel.SetActive(false);

        Time.timeScale = 1;

        PlayerDevice.EndSession();
    }
Example #3
0
    public void StartDemo()
    {
        VRSettings.enabled = true;

        PlayerDevice.deviceStatus = DeviceStatus.inSession;

        PlayerDevice.SetNewID(deviceID.text);
        PlayerDevice.FindUserOnDB(demoUserID.ToString());

        Initiate.FadeDefault("VR_Intro");
    }
Example #4
0
    public void ClientConnected()
    {
        PlayerDevice.SetNewID(GameObject.FindObjectOfType <StartClient> ().deviceID.text);

        RegisterHandler();

        PlayerDevice.deviceStatus = DeviceStatus.idle;

        Initiate.FadeDefault("VR_Idle");

        VRSettings.enabled = true;
    }
	public void Activate(PlayerDevice device)
	{
		gameObject.SetActive(true);
		Debug.Log("new device: " + device);

		Main main = Main.GetInstance();
		int i = 0;
		Debug.Log(main.playerDevices.Count);



	}
Example #6
0
    // Use this for initialization
    void Awake()
    {
        // ensure singleton
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);

        deviceStatus = DeviceStatus.disconnected;
    }
Example #7
0
    void ReceiveNewUser(NetworkMessage msg)
    {
        if (PlayerDevice.deviceStatus == DeviceStatus.idle)
        {
            string[] s_msg = msg.ReadMessage <StringMessage> ().value.Split('_');

            if (s_msg [0] == PlayerDevice.deviceID)
            {
                PlayerDevice.FindUserAndStartSession(s_msg [1]);
            }
            else
            {
                // not this client requested
            }
        }
    }
	public void SetDevice( PlayerDevice device )
	{
		this.device = device;
		unitstats = gameObject.GetComponent<UnitStats>();
		movement = gameObject.GetComponent<Movement>();
		skeletonAnimation = gameObject.GetComponentInChildren<SkeletonAnimation>();
		skeletonAnimation.state.Event += Event;
		skeletonAnimation.UpdateBones += UpdateBones;
		skeletonAnimation.state.End += End;
		head = gameObject.GetComponentInChildren<SkeletonAnimation>().skeleton.FindBone("head");
		hip = gameObject.GetComponentInChildren<SkeletonAnimation>().skeleton.FindBone("body");
		weaponmanager = gameObject.GetComponentInChildren<WeaponManager>();
		meleemanager = gameObject.GetComponentInChildren<MeleeManager>(); 
		GameObject gameGameObject = GameObject.FindGameObjectWithTag( "Level" );
		level = gameGameObject.GetComponent<LevelInfo>(); 
	}
Example #9
0
 void BackToIdle()
 {
     PlayerDevice.EndSession();
     Initiate.FadeDefault("VR_Idle");
 }
Example #10
0
    IEnumerator FinishSession(float waitingTime)
    {
        yield return(new WaitForSeconds(waitingTime));

        PlayerDevice.EndSession();
    }
Example #11
0
        static void Main(string[] args)
        {
            List <Electronics>       listOfElectronicDevices = new List <Electronics>();
            LinkedList <Electronics> listOfDevicesInNetWork  = new LinkedList <Electronics>();
            LapTop acer = new LapTop("Acer", 500, 8, 2.1);

            listOfElectronicDevices.Add(acer);
            LapTop msi = new LapTop("MSI", 650, 16, 2.9);

            listOfElectronicDevices.Add(msi);
            Console.WriteLine(acer.laptop + " 1:\n" + acer.ToString());
            Console.WriteLine(msi.laptop + " 2:\n" + msi.ToString());

            Server intel = new Server("Intel", 200, 120, 8);

            listOfElectronicDevices.Add(intel);
            Server amd = new Server("AMD", 300, 140, 12);

            listOfElectronicDevices.Add(amd);
            Console.WriteLine(intel.server + " 1:\n" + intel.ToString());
            Console.WriteLine(amd.server + " 2:\n" + amd.ToString());

            PlasmTV samsung = new PlasmTV("Samsung", 300, 32, "1920x1080");

            listOfElectronicDevices.Add(samsung);
            PlasmTV lg = new PlasmTV("LG", 500, 50, "3840x2160");

            listOfElectronicDevices.Add(lg);
            Console.WriteLine(samsung.plazmTV + " 1:\n" + samsung.ToString());
            Console.WriteLine(lg.plazmTV + " 2:\n" + lg.ToString());

            LEDTV sharp = new LEDTV("Sharp", 350, 40, 60);

            listOfElectronicDevices.Add(sharp);
            LEDTV xiaomi = new LEDTV("Xiaomi", 700, 65, 75);

            listOfElectronicDevices.Add(xiaomi);
            Console.WriteLine(sharp.ledTV + " 1:\n" + sharp.ToString());
            Console.WriteLine(xiaomi.ledTV + " 2:\n" + xiaomi.ToString());

            PlayerDevice sony = new PlayerDevice("Sony", 350, "MP3, AVC");

            listOfElectronicDevices.Add(sony);
            PlayerDevice panasonic = new PlayerDevice("Panasonic", 700, "MP3, Flac");

            listOfElectronicDevices.Add(panasonic);
            Console.WriteLine(sony.player + " 1:\n" + sony.ToString());
            Console.WriteLine(panasonic.player + " 2:\n" + panasonic.ToString());

            Console.WriteLine(sony.GetGeneralPower());
            Console.WriteLine(acer.GetGeneralMemory());

            Generator generator = new Generator("Generator", 3000);

            Console.WriteLine(generator.GetAvailablePower());
            Console.WriteLine(generator.GetAvailablePower());

            generator.AllDevicesInNetWork(ref listOfDevicesInNetWork);
            MainProgram(listOfElectronicDevices, ref listOfDevicesInNetWork, generator);

            Console.ReadLine();
        }