Beispiel #1
0
    public Client(GameController game)
    {
        this.game = game;
        this.player = GameObject.Find ("Player");

        /* dan
        this.lightController = ((LightController)GameObject.FindObjectOfType(typeof(LightController)));
        this.enemies = (Enemy[])GameObject.FindObjectsOfType(typeof(Enemy));
         */

        this.playerAvatar = GameObject.Find("AvatarMainPlayer");
        this.playerEAvatar = GameObject.Find("AvatarEnemyPlayer");

        if (!Config.Instance.IsStandalone)
        {	//CaveClient
            disableControl();
            disableAllRigidBodys();
        }
        else
        {	//GameClient version
            this.observer = (NetworkObserver)GameObject.FindObjectOfType(typeof(NetworkObserver));
            this.wiiController = (WiiController)GameObject.FindObjectOfType(typeof(WiiController));
            this.kinectController = (KinectController)GameObject.FindObjectOfType(typeof(KinectController));
            this.cameraRotationTransform = ((KinectController)GameObject.FindObjectOfType(typeof(KinectController))).transform;
        }
    }
Beispiel #2
0
    private void InitNavigation()
    {
        avatarConnector = new AvatarAdapterConnector(this);

        if (Config.Instance.UseWii)
        {
            wiiController = GetComponentInChildren <WiiController> ();

            //wiiTurnMediator = new SimpleWiiTurnNavigationMediator ( wiiController.WiiMote, avatarConnector );
            // RedirectToFrontTurnMediator benutzt Radianten. Da es den selben Callback setTurnVelocity() (siehe unten)
            // nutzt, muss das hier auch in Radiant sein.
            //wiiTurnMediator.setTargetTurnVelocity ( defaultTurnVelocityDegPerSec*Mathf.Deg2Rad );

            //wiiWalkMediator = new SimpleWiiWalkNavigationMediator ( wiiController.WiiMote, avatarConnector );
            // wiiWalkMediator.setTargetWalkVelocity ( defaultWalkVelocityMeterPerSec );
        }

        if (Config.Instance.UseKinect)
        {
            kinectController = GetComponentInChildren <KinectController> ();

            wipWalkMediator = new WalkingInPlaceNavigationMediator(kinectController.Kinect, avatarConnector);

            redirectToFrontTurnMediator = new RedirectToFrontNavigationMediator(kinectController.Kinect, avatarConnector);
        }

        this.ToggleNav();
    }
Beispiel #3
0
    public Client(GameController game)
    {
        this.game   = game;
        this.player = GameObject.Find("Player");



        /* dan
         * this.lightController = ((LightController)GameObject.FindObjectOfType(typeof(LightController)));
         * this.enemies = (Enemy[])GameObject.FindObjectsOfType(typeof(Enemy));
         */

        this.playerAvatar  = GameObject.Find("AvatarMainPlayer");
        this.playerEAvatar = GameObject.Find("AvatarEnemyPlayer");

        if (!Config.Instance.IsStandalone)
        {               //CaveClient
            disableControl();
            disableAllRigidBodys();
        }
        else
        {               //GameClient version
            this.observer                = (NetworkObserver)GameObject.FindObjectOfType(typeof(NetworkObserver));
            this.wiiController           = (WiiController)GameObject.FindObjectOfType(typeof(WiiController));
            this.kinectController        = (KinectController)GameObject.FindObjectOfType(typeof(KinectController));
            this.cameraRotationTransform = ((KinectController)GameObject.FindObjectOfType(typeof(KinectController))).transform;
        }
    }
Beispiel #4
0
 /*Gets the instance if the wii Controller and checks if the wii is used*/
 void Start()
 {
     wii = WiiController.Instance;
     if (wii != null)
     {
         wiiInUse = wii.useWii;
     }
 }
Beispiel #5
0
 void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(gameObject);
     }
     Instance = this;
     DontDestroyOnLoad(this.gameObject);
 }
Beispiel #6
0
	// Use this for initialization
	void Start () {	
		timeToLog=true;
		player = GameObject.Find ("Player");
		InvokeRepeating ("logPlayer", 1f, 2f);

		wincollision = GetComponent<WinCollision> ();
		breathtimer = GetComponent<BreathTimer> ();
		logged = false;
		wiicontroller = GetComponent<WiiController> ();
	}
            private void Awake()
            {
                cavePlayerController = GetComponent <CavePlayerController>();
                kinectController     = GetComponent <KinectController>();
                wiiController        = GetComponent <WiiController>();

                if (cavePlayerController.testMode)
                {
                    kinectController.enabled = false;
                    wiiController.enabled    = false;
                }
            }
	void Start(){
		wiicontroller = GetComponent<WiiController> ();
		simplecontroller = GetComponent<SimpleController> ();
		wiidblcontroller = GetComponent<WiiDoubleCtrl> ();
		mouselookmod = gameObject.GetComponentInChildren<MouseLookMod> ();
		thrustersound = GameObject.Find("Thrusters").GetComponent<ThrusterSound>();
		totTime = timer;


		logdead = false;

		//InvokeRepeating ("logPlayer", 1f, 1f);
		//dead = false;
		log = GetComponent<Log> ();
	}
Beispiel #9
0
    void Start()
    {
        // Get and store a reference to our LineRenderer component
        laserLine = GetComponent <LineRenderer>();

        //rich = GetComponent<Rigidbody>();  // GetGameObject<>
        player = GetComponentInParent <CharacterController>();


        wii = WiiController.Instance;
        if (wii != null)
        {
            wiiInUse = wii.useWii;
        }
    }
    //private NetworkObserver observer;
    /// <summary>
    /// Start this instance.
    /// alle Bewegungseingaben werden hier behandelt (WASD, oder WII)2
    /// </summary>
    void Start()
    {
        wiiController = WiiController.Instance;
        kinect        = GameObject.FindObjectOfType <KinectController> ();
        if (kinect != null)
        {
            Debug.Log("Kinect found");
            useKinect = kinect.useKinect;
        }


        //this.InitNavigation();
        Debug.Log("searching player");
        player = GameObject.Find("Player");
        Debug.Log(player.ToString());

        playerAvatar = GameObject.Find("AvatarMainPlayer");
        //this.observer = (NetworkObserver)GameObject.FindObjectOfType(typeof(NetworkObserver));
    }
        private void WiiControllerFound(string devicePath, ControllerType controllerType)
        {
            WiiController wiiController = null;

            switch (controllerType)
            {
            case ControllerType.WiiBalanceBoard:
                wiiController = new BalanceBoard();
                break;

            default:
                throw new WiiControllerException("Not supported ControllerType!");
            }
            //wiiController.OpenWiiControllerDeviceHandle(devicePath);
            if (wiiController != null)
            {
                collection.Add(wiiController);
            }
        }
	//

	// Use this for initialization
	void Start () {
		boardtext = scoreboard.GetComponent<TextMesh> ();
		wiicontroller = GetComponent<WiiController> ();
		breathtimer = GetComponent<BreathTimer> ();


		//Load all saved highscores and save to HighScoresList
		int j = 1;
		while(PlayerPrefs.HasKey("HighScore"+j) && j<=numberOfHighScores){
			Scores temp = new Scores();
			temp.score = PlayerPrefs.GetInt("HighScore"+j);
			//temp.name = j.ToString();
			temp.name = "";
			HighScoreList.Add(temp);
			j++;
		}
		logwin = false;
		//print ("start... length of highScoreList: " + HighScoreList.Count);
		//logsession = false;
		//7InvokeRepeating ("logPlayer", 1f, 1f);
	}
Beispiel #13
0
    //private GameObject player = null;
    //private GameObject playerAvatar = null;

    public Server(GameController game, bool isStandalone)
    {
        this.observer = (NetworkObserver)GameObject.FindObjectOfType(typeof(NetworkObserver));
        /* dan this.shootController = ((ShootController)GameObject.FindObjectOfType(typeof(ShootController))); */
        this.kinectController        = (KinectController)GameObject.FindObjectOfType(typeof(KinectController));
        this.cameraRotationTransform = ((KinectController)GameObject.FindObjectOfType(typeof(KinectController))).transform;
        this.wiiController           = (WiiController)GameObject.FindObjectOfType(typeof(WiiController));
        /* dan this.lightController = ((LightController)GameObject.FindObjectOfType(typeof(LightController))); */
        this.game         = game;
        this.isStandalone = isStandalone;

        /* dan
         * this.enemies = (Enemy[])GameObject.FindObjectsOfType(typeof(Enemy));
         * this.doors = (DoorTrigger[])GameObject.FindObjectsOfType(typeof(DoorTrigger));
         *
         * this.balls = new List<GameObject>();
         * this.numberOfBalls = (Config.Instance.IsStandalone) ? shootController.maxNumberOfBallsStandalone : shootController.maxNumberOfBalls;
         *
         */
        this.playerEAvatar = GameObject.Find("AvatarEnemyPlayer");
    }
Beispiel #14
0
    //private GameObject player = null;
    //private GameObject playerAvatar = null;
    public Server( GameController game, bool isStandalone )
    {
        this.observer = (NetworkObserver) GameObject.FindObjectOfType ( typeof(NetworkObserver) );
        /* dan this.shootController = ((ShootController)GameObject.FindObjectOfType(typeof(ShootController))); */
        this.kinectController = (KinectController) GameObject.FindObjectOfType ( typeof(KinectController) );
        this.cameraRotationTransform = ( (KinectController) GameObject.FindObjectOfType ( typeof(KinectController) ) ).transform;
        this.wiiController = (WiiController) GameObject.FindObjectOfType ( typeof(WiiController) );
        /* dan this.lightController = ((LightController)GameObject.FindObjectOfType(typeof(LightController))); */
        this.game = game;
        this.isStandalone = isStandalone;

        /* dan
         this.enemies = (Enemy[])GameObject.FindObjectsOfType(typeof(Enemy));
         this.doors = (DoorTrigger[])GameObject.FindObjectsOfType(typeof(DoorTrigger));

         this.balls = new List<GameObject>();
         this.numberOfBalls = (Config.Instance.IsStandalone) ? shootController.maxNumberOfBallsStandalone : shootController.maxNumberOfBalls;

         */
        this.playerEAvatar = GameObject.Find ( "AvatarEnemyPlayer" );
    }
Beispiel #15
0
    void Start()
    {
        GameObject kinect = GameObject.Find("KinectController");

        if (kinect != null)
        {
            //this.networkObserver = (NetworkObserver)GameObject.FindObjectOfType(typeof(NetworkObserver));
            __wiiController = WiiController.Instance;

            __kinectController = KinectController.Instance;

            for (int i = 0; i < 20; i++)
            {
                __joints [i] = Instantiate(SkeletonJointOriginal, Vector3.zero, Quaternion.identity) as GameObject;
                __joints [i].transform.parent = this.transform;
                __joints [i].name             = "SkeletonJoint" + i;
                __joints [i].GetComponent <Renderer> ().enabled = __enabled;
            }
        }
        else
        {
            kinectConected = false;
        }
    }
Beispiel #16
0
    void Start()
    {
        DateTime now=DateTime.UtcNow;

        playerId="subject-"+now.ToString("yyMMddHHmm");
        initialPos=transform.position;
        grapDetector = GetComponent<GrapDetector> ();
        ikControl=GetComponent<IKController>();
        grapDetector.onObjectEnter+=onObjectDetectEnter;
        grapDetector.onObjectLeave+=onObjectDetectLeave;
        select=GameObject.Find("SceneLogic").GetComponent<SelectController>();
        kinectModelController = GetComponent<KinectModelControllerV2> ();
        playerAni=GetComponent<PlayerAnimation>();
        bool isKinectInited= KinectSensor.IsInitialized;

        monoInput=GetComponent<MonoController>();
        wiiInput=GetComponent<WiiController>();

        if(controlType==ControlType.mono){
            monoInput.enabled=true;
            wiiInput.enabled=false;
            grapDetector.target = corsor;

            main.depth=10;
            //qr.gameObject.SetActive(false);
        }if(controlType==ControlType.stereo){
        //			if(GameObject.Find ("SceneLogic").GetComponent<ClienTest>().isServer){
        //				monoInput.enabled=true;
        //				wiiInput.enabled=false;
        //			}else
        //			{
        //				monoInput.enabled=true;
        //				wiiInput.enabled=true;
        //			}
            grapDetector.target = hand;
            main.depth=-50;

        }
    }
Beispiel #17
0
 void Start()
 {
     observer = (NetworkObserver) GameObject.FindObjectOfType ( typeof(NetworkObserver) );
     wiiController = (WiiController) GameObject.FindObjectOfType ( typeof(WiiController) );
 }
	// Use this for initialization
	void Start () {
		wiictrl = GetComponent<WiiController> ();
		wiidblctrl = GetComponent<WiiDoubleCtrl> ();
	}
Beispiel #19
0
    private void InitNavigation()
    {
        avatarConnector = new AvatarAdapterConnector ( this );

        if ( Config.Instance.UseWii )
        {
            wiiController = GetComponentInChildren<WiiController> ();

            //wiiTurnMediator = new SimpleWiiTurnNavigationMediator ( wiiController.WiiMote, avatarConnector );
            // RedirectToFrontTurnMediator benutzt Radianten. Da es den selben Callback setTurnVelocity() (siehe unten)
            // nutzt, muss das hier auch in Radiant sein.
            //wiiTurnMediator.setTargetTurnVelocity ( defaultTurnVelocityDegPerSec*Mathf.Deg2Rad );

            //wiiWalkMediator = new SimpleWiiWalkNavigationMediator ( wiiController.WiiMote, avatarConnector );
           // wiiWalkMediator.setTargetWalkVelocity ( defaultWalkVelocityMeterPerSec );
        }

        if ( Config.Instance.UseKinect )
        {
            kinectController = GetComponentInChildren<KinectController> ();

            wipWalkMediator = new WalkingInPlaceNavigationMediator ( kinectController.Kinect, avatarConnector );

            redirectToFrontTurnMediator = new RedirectToFrontNavigationMediator ( kinectController.Kinect, avatarConnector );
        }

        this.ToggleNav ();
    }
Beispiel #20
0
 void Start()
 {
     observer      = (NetworkObserver)GameObject.FindObjectOfType(typeof(NetworkObserver));
     wiiController = (WiiController)GameObject.FindObjectOfType(typeof(WiiController));
 }
Beispiel #21
0
 void Awake()
 {
     Instance = this;
 }