コード例 #1
0
ファイル: Ascii.cs プロジェクト: KeumarSIG/IndieGame
        private void Update()
        {
            if (Application.isPlaying == false)
            return;

              if (Application.isWebPlayer == false && (Input.GetKeyUp(KeyCode.Escape) == true ||
            (musicClip != null && this.gameObject.GetComponent<AudioSource>().time > Time.realtimeSinceStartup)))
            Application.Quit();

              if (Input.GetKeyUp(KeyCode.Alpha1) == true || Input.GetKeyUp(KeyCode.Keypad1) == true)
              {
            Charset = AsciiCharset.Courier_8x12_94;
            timeToChange = 0.0f;
              }
              else if (Input.GetKeyUp(KeyCode.Alpha2) == true || Input.GetKeyUp(KeyCode.Keypad2) == true)
              {
            Charset = AsciiCharset.Lucida_5x8_94;
            timeToChange = 0.0f;
              }
              else if (Input.GetKeyUp(KeyCode.Alpha3) == true || Input.GetKeyUp(KeyCode.Keypad3) == true)
              {
            Charset = AsciiCharset.TimesNewRoman_11x15_4;
            timeToChange = 0.0f;
              }

              if (timeToChange > 0.0f)
              {
            timeMode -= Time.deltaTime;
            if (timeMode <= 0.0f)
            {
              Charset = (Charset == AsciiCharset.Lucida_5x8_94 ? Charset = AsciiCharset.Courier_8x12_94 : (Charset == AsciiCharset.Courier_8x12_94 ? Charset = AsciiCharset.TimesNewRoman_11x15_4 : Charset = AsciiCharset.Lucida_5x8_94));

              timeMode = timeToChange;
            }
              }
        }
コード例 #2
0
ファイル: Ascii.cs プロジェクト: KeumarSIG/IndieGame
        /// <summary>
        /// Sets charset.
        /// </summary>
        public void SetCharset(AsciiCharset charset, string texturePath, int fontCount)
        {
            this.charset = charset;

              fontTexture = Resources.Load<Texture>(texturePath);
              if (fontTexture != null)
            this.fontCount = fontCount;
              else
              {
            Debug.LogError(string.Format("Texture '{0}' not found!", texturePath));

            this.enabled = false;
              }
        }