void Start() { OVRTouchpad.Create(); OVRTouchpad.TouchHandler += HandleTouchHandler; lights = FindObjectOfType <LightsOut>(); charMove = GetComponent <CharacterMovement1>(); }
private void InitializeMap() { if (InitializeMapDone) return; InitializeMapDone = true; stage.scaleMode = StageScaleMode.NO_SCALE; Map = new LightsOut(); Map.NetworkClick += Messages.Click; Map.NetworkClick += delegate { DecreaseClickCountdown(true); }; Map.GameResetByLocalPlayer += delegate { ResetClickCountdown(Map.Level); SendMap(); }; var LevelCompleteCount = 0; Map.LevelComplete += IsLocalPlayer => { if (IsLocalPlayer) { LevelCompleteCount++; if (LevelCompleteCount < 3) ShowMessage((3 - LevelCompleteCount) + " more games to the next award"); else if (LevelCompleteCount == 3) { ShowMessage("Congrats! You have completed three games!"); Messages.AwardCompletedThree(); } else if (LevelCompleteCount < 10) ShowMessage((10 - LevelCompleteCount) + " more games to the next award"); else if (LevelCompleteCount == 10) { ShowMessage("Congrats! You have completed ten games!"); Messages.AwardCompletedTen(); } AddScore(Map.Level * LevelCompleteCount); } else AddScore(2); }; var MyColor = 0xffffff.Random().ToInt32(); Map.mouseMove += e => { Messages.MouseMove(e.stageX.ToInt32(), e.stageY.ToInt32(), MyColor); }; Map.AttachTo(this); ResetClickCountdown(Map.Level); }
private void InitializeMap() { if (InitializeMapDone) { return; } InitializeMapDone = true; stage.scaleMode = StageScaleMode.NO_SCALE; Map = new LightsOut(); Map.NetworkClick += Messages.Click; Map.NetworkClick += delegate { DecreaseClickCountdown(true); }; Map.GameResetByLocalPlayer += delegate { ResetClickCountdown(Map.Level); SendMap(); }; var LevelCompleteCount = 0; Map.LevelComplete += IsLocalPlayer => { if (IsLocalPlayer) { LevelCompleteCount++; if (LevelCompleteCount < 3) { ShowMessage((3 - LevelCompleteCount) + " more games to the next award"); } else if (LevelCompleteCount == 3) { ShowMessage("Congrats! You have completed three games!"); Messages.AwardCompletedThree(); } else if (LevelCompleteCount < 10) { ShowMessage((10 - LevelCompleteCount) + " more games to the next award"); } else if (LevelCompleteCount == 10) { ShowMessage("Congrats! You have completed ten games!"); Messages.AwardCompletedTen(); } AddScore(Map.Level * LevelCompleteCount); } else { AddScore(2); } }; var MyColor = 0xffffff.Random().ToInt32(); Map.mouseMove += e => { Messages.MouseMove(e.stageX.ToInt32(), e.stageY.ToInt32(), MyColor); }; Map.AttachTo(this); ResetClickCountdown(Map.Level); }