Пример #1
0
 public ControllerInterface(int team, bool usingRemote, WiimoteReceiver reciever = null)
 {
     //this.team = team;
     //this.reciever = reciever;
     if (!usingRemote) {
         if (team == 1) {
             player1 = new Keyboard_player1 ();
         } else {
             player2 = new Keyboard_player2 ();
         }
     } else {
         if (reciever != null) {
             do {
                 if(team == 1 && reciever.wiimotes.ContainsKey(team)) {
                     player1 = (Wiimote)reciever.wiimotes [team];
                 } else if (reciever.wiimotes.ContainsKey(team)) {
                     player2 = (Wiimote)reciever.wiimotes[team];
                 }
             } while (!reciever.wiimotes.ContainsKey(team));
         } else if (team == 1) {
             player1 = new Keyboard_player1 ();
         } else {
             player2 = new Keyboard_player2 ();
         }
     }
 }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        receiver = WiimoteReceiver.Instance;
        receiver.connect();
        mainThruster = gameObject.GetComponentInChildren <ParticleSystem> ();

        mainThrusterSource  = gameObject.AddComponent <AudioSource> ();
        topThrusterSource   = gameObject.AddComponent <AudioSource> ();
        leftThrusterSource  = gameObject.AddComponent <AudioSource> ();
        rightThrusterSource = gameObject.AddComponent <AudioSource> ();
        frontThrusterSource = gameObject.AddComponent <AudioSource> ();
        backThrusterSource  = gameObject.AddComponent <AudioSource> ();

        mainThrusterSource.clip = mainThrusterSound;

        topThrusterSource.clip     = sideThrusterSound;
        topThrusterSource.volume   = 0.7f;
        leftThrusterSource.clip    = sideThrusterSound;
        leftThrusterSource.volume  = 0.7f;
        rightThrusterSource.clip   = sideThrusterSound;
        rightThrusterSource.volume = 0.7f;
        frontThrusterSource.clip   = sideThrusterSound;
        frontThrusterSource.volume = 0.7f;
        backThrusterSource.clip    = sideThrusterSound;
        backThrusterSource.volume  = 0.7f;
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        // should initialize TheBrain
        receiver = WiimoteReceiver.Instance;
        receiver.connect();
        //if(TheBrain.GetInstance().LoadedSaveGame()){
        TheBrain.GetInstance().LoadSaveGame(selectedSaveGame);

        /*} else {
         *      print("already loaded");
         * }*/
        this.availableLevels = TheBrain.GetInstance().GetAvailableLevels();
        if (audio == null)
        {
            gameObject.AddComponent(typeof(AudioSource));
        }
    }
Пример #4
0
    void Start()
    {
        ENABLE_WIIMOTE = Wiimote.enableWiiMote ();

        // Initialize wiimote receiver
        // TODO(Douglas): Make this work for multiple controllers (if needed)
        ci = ControllerInterface.Instance;
        if (ENABLE_WIIMOTE) {
            receiver = WiimoteReceiver.Instance;
            receiver.connect ();
            while (true) {
                if (receiver.wiimotes.ContainsKey (1)) {
                    ci.setController (1, receiver.wiimotes [1]);
                    break;
                }
            }
        }
    }
 public ControllerInterface(int team, bool usingRemote, WiimoteReceiver reciever = null)
 {
     //this.team = team;
     //this.reciever = reciever;
     if (!usingRemote)
     {
         if (team == 1)
         {
             player1 = new Keyboard_player1();
         }
         else
         {
             player2 = new Keyboard_player2();
         }
     }
     else
     {
         if (reciever != null)
         {
             do
             {
                 if (team == 1 && reciever.wiimotes.ContainsKey(team))
                 {
                     player1 = (Wiimote)reciever.wiimotes [team];
                 }
                 else if (reciever.wiimotes.ContainsKey(team))
                 {
                     player2 = (Wiimote)reciever.wiimotes[team];
                 }
             } while (!reciever.wiimotes.ContainsKey(team));
         }
         else if (team == 1)
         {
             player1 = new Keyboard_player1();
         }
         else
         {
             player2 = new Keyboard_player2();
         }
     }
 }
Пример #6
0
    void Start()
    {
        ENABLE_WIIMOTE = Wiimote.enableWiiMote();

        // Initialize wiimote receiver
        // TODO(Douglas): Make this work for multiple controllers (if needed)
        ci = ControllerInterface.Instance;
        if (ENABLE_WIIMOTE)
        {
            receiver = WiimoteReceiver.Instance;
            receiver.connect();
            while (true)
            {
                if (receiver.wiimotes.ContainsKey(1))
                {
                    ci.setController(1, receiver.wiimotes [1]);
                    break;
                }
            }
        }
    }
Пример #7
0
 // Use this for initialization
 void Start()
 {
     receiver = WiimoteReceiver.Instance;
     receiver.connect();
     initPosition = transform.rotation;
 }
Пример #8
0
 // Use this for initialization
 void Start()
 {
     receiver = WiimoteReceiver.Instance;
     receiver.connect();
     initPosition = transform.rotation;
 }
Пример #9
0
 // Use this for initialization
 void Start()
 {
     receiver = WiimoteReceiver.Instance;
     receiver.connect ();
 }
Пример #10
0
 // Use this for initialization
 void Start()
 {
     receiver = WiimoteReceiver.Instance;
     receiver.connect();
 }
Пример #11
0
 // Use this for initialization
 void Start()
 {
     // should initialize TheBrain
     receiver = WiimoteReceiver.Instance;
     receiver.connect ();
     //if(TheBrain.GetInstance().LoadedSaveGame()){
         TheBrain.GetInstance ().LoadSaveGame (selectedSaveGame);
     /*} else {
         print("already loaded");
     }*/
     this.availableLevels = TheBrain.GetInstance ().GetAvailableLevels ();
     if(audio == null) {
         gameObject.AddComponent(typeof(AudioSource));
     }
 }
Пример #12
0
    // Use this for initialization
    void Start()
    {
        receiver = WiimoteReceiver.Instance;
        receiver.connect ();
        mainThruster = gameObject.GetComponentInChildren<ParticleSystem> ();

        mainThrusterSource = gameObject.AddComponent<AudioSource> ();
        topThrusterSource = gameObject.AddComponent<AudioSource> ();
        leftThrusterSource = gameObject.AddComponent<AudioSource> ();
        rightThrusterSource = gameObject.AddComponent<AudioSource> ();
        frontThrusterSource = gameObject.AddComponent<AudioSource> ();
        backThrusterSource = gameObject.AddComponent<AudioSource> ();

        mainThrusterSource.clip = mainThrusterSound;

        topThrusterSource.clip = sideThrusterSound;
        topThrusterSource.volume = 0.7f;
        leftThrusterSource.clip = sideThrusterSound;
        leftThrusterSource.volume = 0.7f;
        rightThrusterSource.clip = sideThrusterSound;
        rightThrusterSource.volume = 0.7f;
        frontThrusterSource.clip = sideThrusterSound;
        frontThrusterSource.volume = 0.7f;
        backThrusterSource.clip = sideThrusterSound;
        backThrusterSource.volume = 0.7f;
    }
Пример #13
0
    // Use this for initialization
    void Start()
    {
        receiver = WiimoteReceiver.Instance;
        receiver.connect();
        initPosition = transform.rotation;

        Debug.Log("Reciever Obj: "+receiver);
        Debug.Log("WiiMotes: " + receiver.wiimotes);
        foreach(var obj in receiver.wiimotes)
        {
            Debug.Log(obj.ToString());
        }
    }