private void checkTouchOld(Vector3 pos) { Vector3 wp = Camera.main.ScreenToWorldPoint(pos); Vector2 touchPos = new Vector2(wp.x, wp.y); var hit = Physics2D.OverlapPoint(touchPos); if (hit) { string sealCode = hit.GetComponent <SealClick> ().getSealCode(); player.GetComponent <Player> ().castSeal(); //Debug.Log ("got code " + sealCode); currentCast = currentCast + sealCode; Jutsu jutsu = player.GetComponent <Player> ().isCastSuccessful(currentCast); if (jutsu != null) { jutsuStage = false; castingJutsu = jutsu; //jutsu.playSound (); if (jutsu.newBestTime(elapsedTime)) { recordText.text = "New Best Time: " + System.Math.Round(elapsedTime, 2); recordText.enabled = true; } else { recordText.enabled = false; } } //Debug.Log(hit.transform.gameObject.name); //Debug.Log ("DOWNZZZ" + sealNum); } }
public IActionResult Jutsu(Jutsu jutsu) { if (ModelState.IsValid) { scroll.Create(jutsu); return(Redirect("/")); } else { ViewBag.Ninjas = scroll.Ninjas; ViewBag.Jutsus = scroll.Jutsus; ViewBag.AllNinjas = scroll.Ninjas .Include(n => n.KnownJutsu); return(View("Index")); } }
private void checkTouch(Vector3 pos) { Vector3 wp = Camera.main.ScreenToWorldPoint(pos); Vector2 touchPos = new Vector2(wp.x, wp.y); var hit = Physics2D.OverlapPoint(touchPos); if (hit) { Animator gem = hit.GetComponent <Animator> (); gem.SetTrigger("explode"); gem.SetInteger("color", Int32.Parse(hit.GetComponent <SealClick> ().getSealCode())); Destroy(hit.gameObject, gem.GetCurrentAnimatorStateInfo(0).length + 0f); string sealCode = hit.GetComponent <SealClick> ().getSealCode(); player.GetComponent <Player> ().castSeal(); //Debug.Log ("got code " + sealCode); currentCast = currentCast + sealCode; Jutsu jutsu = player.GetComponent <Player> ().isCastSuccessful(currentCast); if (jutsu != null) { jutsuStage = false; castingJutsu = jutsu; //jutsu.playSound (); if (jutsu.newBestTime(elapsedTime)) { recordText.text = "New Best Time: " + System.Math.Round(elapsedTime, 2); recordText.enabled = true; } else { recordText.enabled = false; } } //Debug.Log(hit.transform.gameObject.name); //Debug.Log ("DOWNZZZ" + sealNum); } }
// Update is called once per frame void Update() { updateBars(); if (jutsuStage) { if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer) { if (Input.touchCount > 0) { if (Input.GetTouch(0).phase == TouchPhase.Began) { checkTouch(Input.GetTouch(0).position); } } } else if (Application.platform == RuntimePlatform.WindowsEditor) { if (Input.GetMouseButtonDown(0)) { checkTouch(Input.mousePosition); } } } if (castingJutsu != null) { castingJutsuTimer += Time.deltaTime; if (castingJutsuTimer >= castingJutsu.getActiveTimer()) { Enemy enemyScript = enemy.GetComponent <Enemy> (); enemyScript.takeDamage(); castingJutsu = null; restartRound(); } } }
void Start() { animator = GetComponent <Animator>(); jutsus = new Jutsu[1]; jutsus [0] = new Jutsu(1, "HoMoRt", "Chidori", 2f); }