Beispiel #1
0
        void Awake()
        {
            handState = HandState.NoAction;

            leapManager        = (GameObject.Find("LeapManager") as GameObject).GetComponent(typeof(LeapManager)) as LeapManager;
            cueStickController = (GameObject.Find("CueStickTip") as GameObject).GetComponent(typeof(CueStickController)) as CueStickController;

            leapManager.leapController.EnableGesture(Gesture.GestureType.TYPE_SWIPE);
            leapManager.leapController.Config.SetFloat("Gesture.Swipe.MinLength", 200.0f);
            leapManager.leapController.Config.SetFloat("Gesture.Swipe.MinVelocity", 750f);
            leapManager.leapController.Config.Save();

            gameStates.Add(GameState.CameraAutoAdjust);
            gameStates.Add(GameState.CameraManualAdjust);
            gameStates.Add(GameState.Aiming);
            gameStates.Add(GameState.AfterShot);
            gameStates.Add(GameState.TurnEnd);



            viewAdjustmentStateIcon = (GameObject.Find("ViewAdjustmentStateIcon") as GameObject).GetComponent(typeof(RawImage)) as RawImage;
            aimingStateIcon         = (GameObject.Find("AimingStateIcon") as GameObject).GetComponent(typeof(RawImage)) as RawImage;
            swipeActionIcon         = (GameObject.Find("SwipeActionIcon") as GameObject).GetComponent(typeof(RawImage)) as RawImage;

            playerTurn = (GameObject.Find("PlayerTurn") as GameObject).GetComponent(typeof(Text)) as Text;
            cueBall    = GameObject.FindGameObjectWithTag("cueBall");

            cueBall     = GameObject.FindGameObjectWithTag("cueBall");
            camera      = GameObject.FindGameObjectWithTag("PlayerCamera");
            ballsParent = GameObject.FindGameObjectWithTag("balls");
            foreach (Transform ball in ballsParent.transform)
            {
                balls.Add(ball.gameObject);
            }
        }
Beispiel #2
0
				void Awake ()
				{	
						handState = HandState.NoAction;
						
						leapManager = (GameObject.Find ("LeapManager") as GameObject).GetComponent (typeof(LeapManager)) as LeapManager;
						cueStickController = (GameObject.Find ("CueStickTip") as GameObject).GetComponent (typeof(CueStickController)) as CueStickController;

						leapManager.leapController.EnableGesture (Gesture.GestureType.TYPE_SWIPE);
						leapManager.leapController.Config.SetFloat ("Gesture.Swipe.MinLength", 200.0f);
						leapManager.leapController.Config.SetFloat ("Gesture.Swipe.MinVelocity", 750f);
						leapManager.leapController.Config.Save ();

						gameStates.Add (GameState.CameraAutoAdjust);
						gameStates.Add (GameState.CameraManualAdjust);
						gameStates.Add (GameState.Aiming);
						gameStates.Add (GameState.AfterShot);
						gameStates.Add (GameState.TurnEnd);

						

						viewAdjustmentStateIcon = (GameObject.Find ("ViewAdjustmentStateIcon") as GameObject).GetComponent (typeof(RawImage)) as RawImage; 
						aimingStateIcon = (GameObject.Find ("AimingStateIcon") as GameObject).GetComponent (typeof(RawImage)) as RawImage; 
						swipeActionIcon = (GameObject.Find ("SwipeActionIcon") as GameObject).GetComponent (typeof(RawImage)) as RawImage;

						playerTurn = (GameObject.Find ("PlayerTurn") as GameObject).GetComponent (typeof(Text)) as Text; 
						cueBall = GameObject.FindGameObjectWithTag ("cueBall");

						cueBall = GameObject.FindGameObjectWithTag ("cueBall");
						camera = GameObject.FindGameObjectWithTag ("PlayerCamera");
						ballsParent = GameObject.FindGameObjectWithTag ("balls");
						foreach (Transform ball in ballsParent.transform) {
								balls.Add (ball.gameObject);				
						}
				}