// Use this for initialization void Start() { W = this.GetComponent <play_Wrapper> (); Mv = this.GetComponent <MoveTypeSc> (); tc = GameObject.Find("TitleController").GetComponent <TitleController> (); //初期化処理 p = true; for (int i = 0; i < 40; i++) { clone[i] = null; survival [i] = true; actor[i, 2] = 0; } for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { stage [i, j] = -1; } } fs = false; role = -1; //立場の初期値は観戦者 t = 0f; player = -1; exit = false; fader = GameObject.Find("FadeController").GetComponent <Fade> (); fader.Fade_p = true; }
public void Index_ReturnsCorrectView_True() { TitleController controller = new TitleController(); ActionResult indexView = controller.Index(); Assert.IsInstanceOfType(indexView, typeof(ViewResult)); }
public void Show_ReturnsCorrectView_True() { TitleController controller = new TitleController(); ActionResult thanksView = controller.Show(1); Assert.IsInstanceOfType(thanksView, typeof(ViewResult)); }
// Use this for initialization void Start() { wp = GameObject.Find("Play_GameController").GetComponent <play_Wrapper> (); gc = GameObject.Find("Play_GameController").GetComponent <Play_GameController> (); tc = GameObject.Find("TitleController").GetComponent <TitleController> (); sp = this.GetComponent <SpriteRenderer> (); turn_p = -1; }
private void Awake() { titleController = FindObjectOfType <TitleController>(); cinematicController = FindObjectOfType <CinematicController>(); gameplayController = FindObjectOfType <GameplayController>(); deathController = FindObjectOfType <DeathController>(); resultsController = FindObjectOfType <ResultsController>(); }
// Use this for initialization void Start() { wp = GameObject.Find ("Play_GameController").GetComponent<play_Wrapper> (); gc = GameObject.Find ("Play_GameController").GetComponent<Play_GameController> (); tc = GameObject.Find ("TitleController").GetComponent<TitleController> (); sp = this.GetComponent<SpriteRenderer> (); turn_p = -1; }
public static void Main(string[] args) { Console.OutputEncoding = UTF8Encoding.UTF8; TitleController = new ProgramUtils().TitleController; // new ProgramUtils(); new GameController().Start(TitleController.Name, TitleController.UserColor); }
public override void LoadedScene() { GameObject gb = Instantiate(title) as GameObject; TitleController t = gb.AddComponent <TitleController> (); t.OnEnterKeyDown = () => { SceneProcessManager.Instance.LoadNextScene(); }; }
// Use this for initialization void Start() { tc = GameObject.Find("TitleController").GetComponent <TitleController> (); gc = this.GetComponent <Play_GameController> (); turn = 0; turn_p = -1; names [0] = "マッチング中..."; names [1] = "マッチング中..."; }
public void GetAllFilterByCurrent_Test() { // Arrange var mockService = new Mock <ITitleService>(); var controller = new TitleController(mockService.Object); // Act IQueryable <TitleModel> response = controller.GetAll(); Assert.AreEqual(response.Where(x => x.IsCurrent).Count(), response.Count()); }
public void Details() { // Arrange TitleController controller = new TitleController(); // Act ViewResult result = controller.Details(610) as ViewResult; // Assert Assert.IsNotNull(result); }
private IEnumerator Access() { Dictionary <string, string> dic = new Dictionary <string, string>(); // goldをscoreとして取得 dic.Add("id", ShowRankingScript.PlayerId().ToString()); //インプットフィールドからidの取得 dic.Add("name", TitleController.PlayerName()); //タイトルシーンで入力した名前 dic.Add("score", CharacterControlScript.Gold().ToString()); // goldをscoreとして取得); StartCoroutine(Post(ServerAddress, dic)); // POST yield return(0); }
public void SearchForTitles() { // Arrange TitleController controller = new TitleController(); // Act ViewResult result = controller.SearchForTitles("Casablanca") as ViewResult; // Assert Assert.IsNotNull(result); }
void Awake() { if (!i) { i = this; } else { Debug.LogError(this + " : THERE ARE MULTIPLE INSTANCES OF THIS SCRIPT"); Destroy(this); } }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } StartMenu(); }
public void GetById_NotFound_Test() { // Arrange var mockService = new Mock <ITitleService>(); var controller = new TitleController(mockService.Object); // Act IHttpActionResult actionResult = controller.GetById(-1); // Assert Assert.IsInstanceOfType(actionResult, typeof(NotFoundResult)); }
public void GetAll_Test() { // Arrange var mockService = new Mock <ITitleService>(); var controller = new TitleController(mockService.Object); // Act IQueryable <TitleModel> response = controller.GetAll(); // Assert Assert.IsNotNull(response); }
private IEnumerator Access() { WWWForm form = new WWWForm(); // データ送信準備 WWW www = new WWW(url, form); //実際にサーバに接続。データを取得している yield return(StartCoroutine(CheckTimeOut(www, 3f))); //TimeOutSecond = 3s; if (www.error != null) { Debug.Log("HttpPost NG: " + www.error); //そもそも接続ができていないとき } else if (www.isDone) { string json = www.text; // JSONデータは最初は配列から始まるので、Deserialize(デコード)した直後にリストへキャスト IList dataList = (IList)Json.Deserialize(json); // リストの内容はオブジェクトなので、辞書型の変数に一つ一つ代入しながら、処理 foreach (IDictionary scores in dataList) { // name,dataは文字列なので、文字列型へキャストしてから変数へ格納 // id,scoreは整数型だが、intとかlongに変換できないからstringにしてる string id = (string)scores["id"]; string name = (string)scores["name"]; string score = (string)scores["score"]; nameStr += name + "\n"; //表示するために名前をランキング順に改行して足していってる scoreStr += score + "\n"; //表示するためにスコアををランキング順に改行して足していってる if (name == TitleController.PlayerName()) //ランキングの中に現在の名前と同じものがいたらそのidを取得 { playerId = int.Parse(id); savedScore = int.Parse(score); Debug.Log(playerId); } lastScore = int.Parse(score); // 一番低いスコアの値を取得 } Debug.Log(lastScore); if (lastScore < CharacterControlScript.Gold()) // 現在のスコアがランキング最下位より大きかったとき { if (playerId == 0) { addScoreButton.SetActive(true); } else if (playerId != 0 && CharacterControlScript.Gold() > savedScore) { updateScoreButton.SetActive(true); } } //送られてきたデータをテキストに反映 rankingBoardName.GetComponent <Text>().text = nameStr; rankingBoardScore.GetComponent <Text>().text = scoreStr; } }
private IEnumerator Access() { Dictionary <string, string> dic = new Dictionary <string, string>(); score = CharacterControlScript.Gold(); // goldをscoreとして取得 //dic.Add("name", inputName.GetComponent<Text>().text); //インプットフィールドからidの取得 dic.Add("name", TitleController.PlayerName()); //タイトルシーンで入力した名前 dic.Add("score", score.ToString()); // goldをscoreとして取得); StartCoroutine(Post(ServerAddress, dic)); // POST yield return(0); }
void Awake() { if (inctence == null) { inctence = this; animator = gameObject.GetComponent <Animator>(); canvasGroup = gameObject.GetComponentInChildren <CanvasGroup>(); sfx = gameObject.GetComponent <AudioSource>(); } else if (inctence != this) { Destroy(this.gameObject); } }
private void Awake() { creditsPanel.SetActive(false); howToPanel.SetActive(false); if (instance != null) { Destroy(gameObject); } else { instance = this; GameObject.DontDestroyOnLoad(gameObject); } }
public void Delete_Test() { // Arrange var mockService = new Mock <ITitleService>(); var controller = new TitleController(mockService.Object); int id = 10; int userId = 1; // Act IHttpActionResult actionResult = controller.Delete(id, userId); // Assert Assert.IsInstanceOfType(actionResult, typeof(OkResult)); }
public void CreateTest() { var optionsBuilder = new DbContextOptionsBuilder <HarperCollinsWebApiDbContext>(); optionsBuilder.UseSqlServer(ConnectionString); var _myContext = new HarperCollinsWebApiDbContext(optionsBuilder.Options); _myController = new SaleOrderController(_myContext); CustomerController _myCustomerController = new CustomerController(_myContext); TitleController _myTitleController = new TitleController(_myContext); var myCustomer = _myCustomerController.GetCustomers().FirstOrDefault(); var myTitle = _myTitleController.GetTitles().FirstOrDefault(); var myMaxSalesOrder = _myController.GetSaleOrders().OrderByDescending(so => so.Id).FirstOrDefault(); Assert.NotNull(myCustomer); Assert.NotNull(myTitle); Assert.NotNull(myMaxSalesOrder); int myQuantity = 999; var myCustomerId = myCustomer.Id; var myTitleId = myTitle.Id; var myMaxSalesOrderId = myMaxSalesOrder.Id; var todaysDate = DateTime.Now; Assert.NotEqual(0, myCustomerId); Assert.NotEqual(0, myTitleId); Assert.NotEqual(0, myMaxSalesOrderId); SaleOrder mySaleOrder = new SaleOrder { CustomerId = myCustomerId, TitleId = myTitleId, ReleaseDate = todaysDate.Date, Quantity = myQuantity, IsActive = true }; _myController.PostSaleOrder(mySaleOrder).Wait(); var mySalesOrder = _myController.GetSaleOrders(mySaleOrder.CustomerId, mySaleOrder.TitleId, mySaleOrder.ReleaseDate.ToShortDateString()).OrderByDescending(so => so.Id).FirstOrDefault(); Assert.NotNull(mySalesOrder); Assert.Equal(myQuantity, mySalesOrder.Quantity); Assert.True(mySalesOrder.Id > myMaxSalesOrderId); }
void Awake() { streak = 0; _previousTrigger = 0; _playerState = PlayerState.Inactive; _inputController = InputController.Instance; _rhythmController = RhythmController.Instance; _worldController = WorldController.Instance; _soundManager = SoundManager.Instance; _config = Config.Instance; _scoreController = ScoreController.Instance; _menuController = MenuController.Instance; _titleController = TitleController.Instance; feedbackAnim = GameObject.Find ("Feedbacks/Feedback" + index).GetComponent<Animator>(); }
public void Post_Test() { // Arrange var mockService = new Mock <ITitleService>(); var controller = new TitleController(mockService.Object); TitleModel model = GetDemoItem(true); int userId = 1; // Act IHttpActionResult actionResult = controller.Post(model, userId); var createdResult = actionResult as OkNegotiatedContentResult <int>; // Assert Assert.IsNotNull(createdResult); //Assert.AreEqual("DefaultApi", createdResult.RouteName); Assert.IsTrue(createdResult.Content >= 0); }
public void Put_Test() { // Arrange var mockService = new Mock <ITitleService>(); var controller = new TitleController(mockService.Object); TitleModel model = GetDemoItem(false); int userId = 1; // Act IHttpActionResult actionResult = controller.Put(model, userId); var contentResult = actionResult as NegotiatedContentResult <TitleModel>; // Assert Assert.IsNotNull(contentResult); Assert.AreEqual(HttpStatusCode.Accepted, contentResult.StatusCode); Assert.IsNotNull(contentResult.Content); Assert.AreEqual(model.Id, contentResult.Content.Id); }
// Start is called before the first frame update void Start() { // Sets up things i want to change based on title, prolly need to be required animator_P1 = GetComponent <Animator>(); body_P1 = GetComponent <Rigidbody2D>(); titleController = GetComponent <TitleController>(); if (OnLandEvent == null) { OnLandEvent = new UnityEvent(); } if (OnJumpEvent == null) { OnJumpEvent = new BoolEvent(); } if (OnCrouchEvent == null) { OnCrouchEvent = new BoolEvent(); } }
public void GetById_Test() { int id = 1; // Arrange var mockService = new Mock <ITitleService>(); mockService.Setup(x => x.GetById(id)) .Returns(new TitleModel { Id = id }); var controller = new TitleController(mockService.Object); // Act IHttpActionResult actionResult = controller.GetById(id); var contentResult = actionResult as OkNegotiatedContentResult <TitleModel>; // Assert Assert.IsNotNull(contentResult); Assert.IsNotNull(contentResult.Content); Assert.AreEqual(id, contentResult.Content.Id); }
void Start() { gc = this.GetComponent <Play_GameController> (); tc = GameObject.Find("TitleController").GetComponent <TitleController> (); }
// Use this for initialization void Start() { // Setup Bluetooth if (Application.platform == RuntimePlatform.Android){ Debug.Log ("=============EFM HERE=============="); jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); activity = jc.GetStatic<AndroidJavaObject>("currentActivity"); Debug.Log ("=============ONE=============="); jo = new AndroidJavaObject("SimpleAndroidBluetoothCommunication"); Debug.Log ("=============TWO=============="); Debug.Log("=============SUCCESS: " + jo.Call<string> ("setupAdapter")); Debug.Log("=============ADAPTER STATUS: " + jo.Call<string> ("adapterOn")); int numberPairedDevices = jo.Call<int>("getPairedDevices"); Debug.Log ("=============NUMBER PAIRED DEVICES: " + numberPairedDevices.ToString()); for (int i = 0; i < numberPairedDevices; i++) { Debug.Log ("=============DEVICE " + i.ToString() + " INFO: " + jo.Call<string> ("getPairedDeviceInfo", i)); } string connected = jo.Call<string> ("startCommunication"); Debug.Log ("=============CONNECTION SUCCESS: " + connected); StartCoroutine(MessageReliever(RelieverNormal)); } // Handle Variables TitleScript = Title.GetComponent<TitleController>(); EndScript = End.GetComponent<TitleController> (); EndScript.setAlpha (0); StaticScript = Static.GetComponent<StaticController>(); ClaraGhostScript = ClaraGhost.GetComponent<GhostlyPosition>(); HankerchiefScript = Hankerchief.GetComponent<GhostlyPositionAndSound>(); Sounds = this.GetComponents<AudioSource>(); PickUp.onClick.AddListener(pickup); Slider.maxValue = Past; Slider.minValue = Present; Slider.wholeNumbers = false; Slider.value = Present; Slider.onValueChanged.AddListener(TimeTravel); Interface.gameObject.SetActive (false); AllGhostlyScripts = new GhostlyPositionAndSound[AllSelectableObjects.Length]; for (int i = 0; i < AllSelectableObjects.Length; i++) { AllGhostlyScripts[i] = AllSelectableObjects[i].GetComponent<GhostlyPositionAndSound>(); } for(int i = 0; i < PresentGhostlyObjects.Length; i++){ PresentGhostlyObjects[i].SetActive(true); } for(int i = 0; i < TimeTravelGhostlyObjects.Length; i++){ TimeTravelGhostlyObjects[i].SetActive(false); } for(int i = 0; i < PastGhostlyObjects.Length; i++){ PastGhostlyObjects[i].SetActive(false); } if (GameState == 0) { Sounds [TitleSoundIndex].volume = TitleVolume; Sounds [TitleSoundIndex].Play (); TitleScript.setAlpha (NoTouchAlpha); StaticScript.setAlpha (0); } else if (GameState == 5) { Interface.gameObject.SetActive (true); Debug.Log(Interface.gameObject.activeSelf); Sounds[SuccessSoundIndex].Play(); StartCoroutine(SetupClara()); } }
void Start() { tc = GameObject.Find ("TitleController").GetComponent<TitleController> (); p = true; }
void Update() { playerNameText.GetComponent <Text>().text = "Name: " + TitleController.PlayerName(); goldAmount.GetComponent <Text>().text = "Gold: " + score.ToString(); }
void Start() { tc = GameObject.Find("TitleController").GetComponent <TitleController> (); p = true; }
void Start() { gc = this.GetComponent<Play_GameController> (); tc = GameObject.Find ("TitleController").GetComponent<TitleController> (); }
// Use this for initialization void Start() { tc = GameObject.Find ("TitleController").GetComponent<TitleController> (); i = this.GetComponent<InputField> (); }
// Use this for initialization void Start() { tc = GameObject.Find ("TitleController").GetComponent<TitleController> (); gc = this.GetComponent<Play_GameController> (); turn = 0; turn_p = -1; names [0] = "マッチング中..."; names [1] = "マッチング中..."; }
// Use this for initialization void Start() { W = this.GetComponent<play_Wrapper> (); Mv = this.GetComponent<MoveTypeSc> (); tc = GameObject.Find ("TitleController").GetComponent<TitleController> (); //初期化処理 p = true; for (int i=0; i<40; i++) { clone[i] = null; survival [i] = true; actor[i,2] = 0; } for (int i=0; i<9; i++) for (int j=0; j<9; j++) stage [i, j] = -1; fs = false; role = -1; //立場の初期値は観戦者 t = 0f; player = -1; exit = false; fader = GameObject.Find ("FadeController").GetComponent<Fade> (); fader.Fade_p = true; }
// Use this for initialization void Start() { tc = GameObject.Find("TitleController").GetComponent <TitleController> (); i = this.GetComponent <InputField> (); }