// Update is called once per frame void Update () { if (this.curDrawController == null) { this.curTimeSlow = 0; //this.slowingTime = false; Time.timeScale = 1.0f; } else { this.curTimeSlow += Time.deltaTime; float slowAmount = Mathf.Lerp (maxTimeSlow, 1.0f, curTimeSlow / timeSlowLength); Time.timeScale = slowAmount; } if (Input.GetMouseButtonUp (1) && this.curDrawController == null) { Vector3 mousePos = Camera.main.ScreenToWorldPoint (Input.mousePosition); mousePos.z = 0; GameObject newCircle = Instantiate (this.circlePrefab); newCircle.transform.position = mousePos; this.curDrawController = newCircle.GetComponentInChildren<DrawOnTextureController> (); StartCoroutine (this.PlayDrawingSound ()); //this.slowingTime = true; } }
// Use this for initialization void Start () { this.targetCircle = transform.Find ("Sprite_TargetCircle").gameObject.GetComponent<SpriteRenderer>(); this.drawingSurface = transform.Find ("Sprite_DrawingSurface").gameObject.GetComponent<DrawOnTextureController>(); this.circleEffect = this.GetComponent<CircleEffectController> (); }