Inheritance: exSpriteBase
コード例 #1
0
ファイル: Button.cs プロジェクト: e-sport/threekindom
    public void SetButtonState(ButtonState s)
    {
        state = s;

        if (fontScript == null)
        {
            fontScript = GetComponent <exSpriteFont>();
        }

        if (!enabled)
        {
            return;
        }

        if (state == ButtonState.Normal || state == ButtonState.Leave || state == ButtonState.Clicked)
        {
            fontScript.botColor = new Color(1, 1, 1, 1);
            fontScript.topColor = new Color(1, 1, 1, 1);
        }
        else if (state == ButtonState.Down || state == ButtonState.Pressed)
        {
            fontScript.botColor = new Color(1, 0, 0, 1);
            fontScript.topColor = new Color(1, 0, 0, 1);
        }
    }
コード例 #2
0
ファイル: Button.cs プロジェクト: e-sport/threekindom
 // Use this for initialization
 void Start()
 {
     if (fontScript == null)
     {
         fontScript = GetComponent <exSpriteFont>();
     }
 }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     textSprite   = (exSpriteFont)this.gameObject.GetComponent <exSpriteFont>();
     common       = (CommonScript)GameObject.Find("Common").GetComponent <CommonScript>();
     screenWidth  = Screen.width;
     screenHeight = Screen.height;
 }
コード例 #4
0
ファイル: exSpriteFontEditor.cs プロジェクト: exdev/ex2d-v1
 ///////////////////////////////////////////////////////////////////////////////
 // functions
 ///////////////////////////////////////////////////////////////////////////////
 // ------------------------------------------------------------------
 // Desc:
 // ------------------------------------------------------------------
 protected new void OnEnable()
 {
     base.OnEnable();
     if ( target != editSpriteFont ) {
         editSpriteFont = target as exSpriteFont;
     }
 }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     textSprite = (exSpriteFont)this.gameObject.GetComponent<exSpriteFont>();
     common = (CommonScript)GameObject.Find("Common").GetComponent<CommonScript>();
     screenWidth = Screen.width;
     screenHeight = Screen.height;
 }
コード例 #6
0
    public void SetMouseDown(bool flag)
    {
        if (font == null)
        {
            font = GetComponent <exSpriteFont>();
        }

        if (!selectEnable)
        {
            return;
        }

        isMouseDown = flag;

        if (isMouseDown)
        {
            font.botColor = new Color(1, 0, 0, 1);
            font.topColor = new Color(1, 0, 0, 1);
        }
        else
        {
            font.botColor = new Color(1, 1, 1, 1);
            font.topColor = new Color(1, 1, 1, 1);
        }
    }
コード例 #7
0
ファイル: MagicShow.cs プロジェクト: e-sport/threekindom
    void OnEnable()
    {
        if (menuAnim == null)
        {
            menuAnim = GetComponent <MenuDisplayAnim>();
        }
        menuAnim.SetAnim(MenuDisplayAnim.AnimType.InsertFromRight);

        gInfo = Informations.Instance.GetGeneralInfo(WarSceneController.rightGeneralIdx);
        for (int i = 0; i < 4; i++)
        {
            if (gInfo.magic[i] != -1)
            {
                magics[i].SetButtonData(i);
                magics[i].SetButtonClickHandler(OnMagicClick);
                exSpriteFont sf = magics[i].GetComponent <exSpriteFont>();
                sf.text = ZhongWen.Instance.GetMagicName(gInfo.magic[i]);
                if (gInfo.manaCur >= MagicManager.Instance.GetMagicDataInfo(gInfo.magic[i]).MP)
                {
                    magics[i].SetButtonEnable(true);
                }
                else
                {
                    magics[i].SetButtonEnable(false);
                }
            }
            else
            {
                magics[i].gameObject.SetActive(false);
            }
        }
    }
コード例 #8
0
    public void SetButtonState(ButtonState s)
    {
        state = s;

        if (fontScript == null)
        {
            fontScript = GetComponent <exSpriteFont>();
        }

        if (state == ButtonState.Normal)
        {
            fontScript.botColor = new Color(1, 1, 1, 1);
            fontScript.topColor = new Color(1, 1, 1, 1);
        }
        else if (state == ButtonState.Down || state == ButtonState.Pressed)
        {
            fontScript.botColor = selectedColor;
            fontScript.topColor = selectedColor;

            if (buttonDownHandler != null)
            {
                buttonDownHandler();
            }
            if (buttonDownHandler1 != null)
            {
                buttonDownHandler1(data);
            }
        }
    }
コード例 #9
0
    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    IEnumerator CleanDebugText()
    {
        yield return(new WaitForEndOfFrame());

#if EX2D
        txtPrint.text = "";

        if (showScreenDebugText)
        {
            debugTextPool.Reset();
            for (int i = 0; i < debugTextPool.initData.Length; ++i)
            {
                GameObject textGO = debugTextPool.initData[i];
                textGO.GetComponent <exSpriteFont>().enabled = false;
            }
        }
#else
        txtPrint = "";

        if (showScreenDebugText)
        {
            debugTextPool.Clear();
        }
#endif
    }
コード例 #10
0
    void Start()
    {
        clipBoardText = GameObject.FindGameObjectWithTag("nextLevel").GetComponent<ClipBoardText>();
        spriteFont = GetComponent<exSpriteFont>();

        spriteFont.text = clipBoardText.getGrade();
    }
コード例 #11
0
 void Start()
 {
     Zeitabgelaufen = GameObject.Find("lbl_Zeitabgelaufen").GetComponent<exSpriteFont>();
     Zeitabgelaufen.enabled = false;
     erfolgreich = GameObject.Find("lbl_Erfolgreich").GetComponent<exSpriteFont>();
     erfolgreich.enabled = false;
 }
コード例 #12
0
    void Start()
    {
        //Object Access
        myTransform = transform;
        spawner = GameObject.FindGameObjectWithTag("Spawner").GetComponent<SpawnObstacles>();
        rCollision = GameObject.FindGameObjectWithTag("Player").GetComponent<RunnerCollision>();
        spriteFont = GetComponent<exSpriteFont>();

        speed = 1200;

        fPercent = 100 - (100 * ( (float)rCollision.getNumGatesHit() / (float)spawner.getNumGatesInLevel() ));
        DisplayGradeLetter();
        //Text to display
        statusText = "Level " + spawner.getLevelCount()
                         +"\nGates: " + spawner.getNumGatesInLevel()
                         +"\nGates Hit: " + rCollision.getNumGatesHit()
                         +"\nGrade:"+"\n"+"\n"+"\n"
                         +"\nTap to Start"
                         +"\n";

        spriteFont.text = statusText;

        //Add to volume control
        if(PlayerPrefs.HasKey("volumeFX"))
        {
            if(GetComponent<AudioSource>() != null)
            {
                AudioSource audio = GetComponent<AudioSource>();
                audio.volume = (float)PlayerPrefs.GetInt("volumeFX")/10;
            }
        }
    }
コード例 #13
0
    ///////////////////////////////////////////////////////////////////////////////
    // functions
    ///////////////////////////////////////////////////////////////////////////////

    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    protected new void OnEnable()
    {
        base.OnEnable();
        if (target != editSpriteFont)
        {
            editSpriteFont = target as exSpriteFont;
        }
    }
コード例 #14
0
    void Start()
    {
        spriteFont = GetComponent<exSpriteFont>();
        gateScoreMulti = 0;
        myRenderer = renderer;

        myRenderer.enabled = false;
    }
コード例 #15
0
ファイル: DamageTextScript.cs プロジェクト: rjayako/omega
 // Use this for initialization
 void Start()
 {
     transform.Translate(new Vector3(0,50,0));
     velocity = new Vector3(50, 500, 0);
     font = (exSpriteFont)GetComponent<exSpriteFont>();
     font.text = damage;
     Destroy(gameObject, 1);
 }
コード例 #16
0
    // ------------------------------------------------------------------
    /// \param _spriteFont the sprite font
    /// build the sprite font
    // ------------------------------------------------------------------

    public static void Build(this exSpriteFont _spriteFont)
    {
#if UNITY_3_4
        bool isPrefab = (EditorUtility.GetPrefabType(_spriteFont) == PrefabType.Prefab);
#else
        bool isPrefab = (PrefabUtility.GetPrefabType(_spriteFont) == PrefabType.Prefab);
#endif

        // when build, alway set dirty
        EditorUtility.SetDirty(_spriteFont);

        if (_spriteFont.fontInfo == null)
        {
            _spriteFont.clippingPlane = null;
            GameObject.DestroyImmediate(_spriteFont.meshFilter.sharedMesh, true);
            _spriteFont.meshFilter.sharedMesh   = null;
            _spriteFont.renderer.sharedMaterial = null;
            return;
        }

        // prefab do not need rebuild mesh
        if (isPrefab == false)
        {
            exClipping clipping = _spriteFont.clippingPlane;
            if (clipping != null)
            {
                clipping.RemovePlane(_spriteFont);
            }

            //
            Mesh newMesh = new Mesh();
            newMesh.hideFlags = HideFlags.DontSave;
            newMesh.Clear();

            // update material
            _spriteFont.renderer.sharedMaterial = _spriteFont.fontInfo.pageInfos[0].material;

            // update mesh
            _spriteFont.ForceUpdateMesh(newMesh);

            //
            GameObject.DestroyImmediate(_spriteFont.meshFilter.sharedMesh, true);   // delete old mesh (to avoid leaking)
            _spriteFont.meshFilter.sharedMesh = newMesh;

            //
            if (clipping != null)
            {
                clipping.AddPlaneInEditor(_spriteFont);
            }
        }

        // update collider
        if (_spriteFont.collisionHelper)
        {
            _spriteFont.collisionHelper.UpdateCollider();
        }
    }
コード例 #17
0
    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    protected new void LateUpdate()
    {
        base.LateUpdate();
        if (spriteFont == null)
        {
            spriteFont = GetComponent <exSpriteFont>();
            if (spriteFont == null)
            {
                Debug.LogError("Can't find exSpriteBorder Component in GameObject " + gameObject.name);
                return;
            }
        }

        //
        if (lastTopColor != spriteFont.topColor)
        {
            lastTopColor            = spriteFont.topColor;
            spriteFont.updateFlags |= exPlane.UpdateFlags.Color;
        }
        if (lastBotColor != spriteFont.botColor)
        {
            lastBotColor            = spriteFont.botColor;
            spriteFont.updateFlags |= exPlane.UpdateFlags.Color;
        }

        //
        if (spriteFont.useOutline)
        {
            if (lastOutlineWidth != spriteFont.outlineWidth)
            {
                lastOutlineWidth        = spriteFont.outlineWidth;
                spriteFont.updateFlags |= exPlane.UpdateFlags.Vertex;
            }
            if (lastOutlineColor != spriteFont.outlineColor)
            {
                lastOutlineColor        = spriteFont.outlineColor;
                spriteFont.updateFlags |= exPlane.UpdateFlags.Color;
            }
        }

        //
        if (spriteFont.useShadow)
        {
            if (lastShadowBias != spriteFont.shadowBias)
            {
                lastShadowBias          = spriteFont.shadowBias;
                spriteFont.updateFlags |= exPlane.UpdateFlags.Vertex;
            }
            if (lastShadowColor != spriteFont.shadowColor)
            {
                lastShadowColor         = spriteFont.shadowColor;
                spriteFont.updateFlags |= exPlane.UpdateFlags.Color;
            }
        }
    }
コード例 #18
0
    void LateUpdate()
    {
        if (isClicked)
        {
            isClicked = false;

            exSpriteFont font = records[index].GetComponent <exSpriteFont>();
            font.botColor = new Color(1, 0, 0, 1);
            font.topColor = new Color(1, 0, 0, 1);
        }
    }
コード例 #19
0
    ///////////////////////////////////////////////////////////////////////////////
    // functions
    ///////////////////////////////////////////////////////////////////////////////

    // ------------------------------------------------------------------ 
    // Desc: 
    // ------------------------------------------------------------------ 

    protected new void Awake () {
        base.Awake();

        spriteFont = GetComponent<exSpriteFont>();
        lastTopColor = spriteFont.topColor; 
        lastBotColor = spriteFont.botColor;
        lastOutlineWidth = spriteFont.outlineWidth;
        lastOutlineColor = spriteFont.outlineColor;
        lastShadowBias = spriteFont.shadowBias;
        lastShadowColor = spriteFont.shadowColor;
    }
コード例 #20
0
    void Start()
    {
        spriteFont = GetComponent<exSpriteFont>();

        for(int i = 1; i < 11; i++)
        {
            score += string.Format("{0,2:00} - {1,-20:00000000000000000000} - {2,5}", i, Highscores.GetName(1, i -1), Highscores.GetScore(1, i-1)) + "\n";
        }

        spriteFont.text = score;
    }
コード例 #21
0
    void OnEnable()
    {
        if (menuAnim == null)
        {
            menuAnim = GetComponent <MenuDisplayAnim>();
        }

        if (font == null)
        {
            font = transform.FindChild("Font").GetComponent <exSpriteFont>();
        }
    }
コード例 #22
0
    ///////////////////////////////////////////////////////////////////////////////
    // functions
    ///////////////////////////////////////////////////////////////////////////////

    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    protected new void Awake()
    {
        base.Awake();

        spriteFont       = GetComponent <exSpriteFont>();
        lastTopColor     = spriteFont.topColor;
        lastBotColor     = spriteFont.botColor;
        lastOutlineWidth = spriteFont.outlineWidth;
        lastOutlineColor = spriteFont.outlineColor;
        lastShadowBias   = spriteFont.shadowBias;
        lastShadowColor  = spriteFont.shadowColor;
    }
コード例 #23
0
    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    void UpdateFPS()
    {
        float timeNow = Time.realtimeSinceStartup;

        fps          = frames / (timeNow - lastInterval);
        frames       = 0;
        lastInterval = timeNow;
#if EX2D
        txtFPS.text = "fps: " + fps.ToString("f2");
#else
        txtFPS = "fps: " + fps.ToString("f2");
#endif
    }
コード例 #24
0
 // Use this for initialization
 void Start()
 {
     spriteFont = GetComponent<exSpriteFont>();
     if(PlayerPrefs.HasKey("volume"))
     {
         if(tag == "VolumeText")
         spriteFont.text = (PlayerPrefs.GetInt("volume") * 10).ToString();
         volume = PlayerPrefs.GetInt("volume");
     }
     if(PlayerPrefs.HasKey("volumeFX"))
     {
         if(tag == "SFXText")
         spriteFont.text = (PlayerPrefs.GetInt("volumeFX")*10).ToString();
         volumeFX = PlayerPrefs.GetInt("volumeFX");
     }
 }
コード例 #25
0
    void OnCancelButton()
    {
        exSpriteFont font = records[index].GetComponent <exSpriteFont>();

        font.botColor = new Color(1, 1, 1, 1);
        font.topColor = new Color(1, 1, 1, 1);

        state = 0;
        index = -1;
        confirmBox.SetActive(false);

        for (int i = 0; i < records.Length; i++)
        {
            records[i].enabled = true;
        }
    }
コード例 #26
0
    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------
    protected new void LateUpdate()
    {
        base.LateUpdate();
        if ( spriteFont == null ) {
            spriteFont = GetComponent<exSpriteFont>();
            if ( spriteFont == null ) {
                Debug.LogError("Can't find exSpriteBorder Component in GameObject " + gameObject.name);
                return;
            }
        }

        //
        if ( lastTopColor != spriteFont.topColor ) {
            lastTopColor = spriteFont.topColor;
            spriteFont.updateFlags |= exPlane.UpdateFlags.Color;
        }
        if ( lastBotColor != spriteFont.botColor ) {
            lastBotColor = spriteFont.botColor;
            spriteFont.updateFlags |= exPlane.UpdateFlags.Color;
        }

        //
        if ( spriteFont.useOutline ) {
            if ( lastOutlineWidth != spriteFont.outlineWidth ) {
                lastOutlineWidth = spriteFont.outlineWidth;
                spriteFont.updateFlags |= exPlane.UpdateFlags.Vertex;
            }
            if ( lastOutlineColor != spriteFont.outlineColor ) {
                lastOutlineColor = spriteFont.outlineColor;
                spriteFont.updateFlags |= exPlane.UpdateFlags.Color;
            }
        }

        //
        if ( spriteFont.useShadow ) {
            if ( lastShadowBias != spriteFont.shadowBias ) {
                lastShadowBias = spriteFont.shadowBias;
                spriteFont.updateFlags |= exPlane.UpdateFlags.Vertex;
            }
            if ( lastShadowColor != spriteFont.shadowColor ) {
                lastShadowColor = spriteFont.shadowColor;
                spriteFont.updateFlags |= exPlane.UpdateFlags.Color;
            }
        }
    }
コード例 #27
0
        public static exSpriteFont NewSpriteFont(GameObject _go, exBitmapFont _font, Color _color, string _text)
        {
            exSpriteFont spriteFont = _go.GetComponent <exSpriteFont>();

            if (spriteFont == null)
            {
                spriteFont = _go.AddComponent <exSpriteFont>();
            }
            if (spriteFont.shader == null)
            {
                spriteFont.shader = Shader.Find("ex2D/Alpha Blended");
            }
            spriteFont.SetFont(_font);
            spriteFont.color = _color;
            spriteFont.text  = _text;

            return(spriteFont);
        }
コード例 #28
0
    public void SetText(string t)
    {
        isShowingText = true;
        state         = 1000;
        textIdx       = 0;
        timeTick      = 0;

        if (font == null)
        {
            font = transform.FindChild("Font").GetComponent <exSpriteFont>();
        }
        font.text = "";

        text = t;
        //text.Replace("  ", "");

        Input.ResetInputAxes();
    }
コード例 #29
0
    ///////////////////////////////////////////////////////////////////////////////
    // functions
    ///////////////////////////////////////////////////////////////////////////////

    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

#if EX2D
        txtPrint.text    = "";
        txtPrint.enabled = showScreenPrint_;

        txtFPS.text    = "";
        txtFPS.enabled = showFps_;

        txtLog.text    = "";
        txtLog.enabled = showScreenLog_;

        txtTimeScale.text    = "";
        txtTimeScale.enabled = enableTimeScaleDebug;

        if (showScreenDebugText)
        {
            debugTextPool.Init();
            for (int i = 0; i < debugTextPool.initData.Length; ++i)
            {
                GameObject textGO = debugTextPool.initData[i];
                textGO.transform.parent        = transform;
                textGO.transform.localPosition = Vector3.zero;
                textGO.GetComponent <exSpriteFont>().enabled = false;
            }
        }
#else
        // DISABLE {
        // logTimer = logInterval;
        // } DISABLE end
        txtPrint = "";
        txtFPS   = "";

        if (showScreenDebugText)
        {
            debugTextPool.Clear();
        }
#endif
    }
コード例 #30
0
ファイル: exUIUtility.cs プロジェクト: toth3max/ex2d-v1
    static void CreateLabelObject()
    {
        GameObject labelGO = new GameObject("Label");
        exUILabel  label   = labelGO.AddComponent <exUILabel>();

        // create Font
        GameObject   fontGO = new GameObject("Font");
        exSpriteFont font   = fontGO.AddComponent <exSpriteFont>();

        font.text  = "";
        label.font = font;
        fontGO.transform.parent = labelGO.transform;

        label.width  = 50.0f;
        label.height = 20.0f;

        //
        Selection.activeObject = labelGO;
    }
コード例 #31
0
    // Update is called once per frame
    void Update()
    {
        switch (state)
        {
        case 0:
            if (Misc.GetBack())
            {
                state = 1000;
                savingCtrl.SetAnim(MenuDisplayAnim.AnimType.OutToLeft);
                Invoke("OnReturnMain", 0.2f);
            }
            break;

        case 1:
        {
            if (Misc.GetBack())
            {
                OnCancelButton();
            }
        }
        break;

        case 2:
        {
            if (!isSavingFile)
            {
                state = 0;
                confirmBox.SetActive(false);

                for (int i = 0; i < records.Length; i++)
                {
                    records[i].enabled = true;
                }

                exSpriteFont font = records[index].GetComponent <exSpriteFont>();
                font.botColor = new Color(1, 1, 1, 1);
                font.topColor = new Color(1, 1, 1, 1);
            }
        }
        break;
        }
    }
コード例 #32
0
    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    public static void ScreenPrint(Vector2 _pos, string _text, GUIStyle _style = null)
    {
        if (instance.showScreenDebugText)
        {
#if EX2D
            exSpriteFont debugText = instance.debugTextPool.Request <exSpriteFont>();

            Vector2          screenPos      = debugText.renderCamera.WorldToScreenPoint(_pos);
            exScreenPosition screenPosition = debugText.GetComponent <exScreenPosition>();
            screenPosition.x = screenPos.x;
            screenPosition.y = Screen.height - screenPos.y;

            debugText.text    = _text;
            debugText.enabled = true;
#else
            TextInfo info = new TextInfo(_pos, _text, _style);
            instance.debugTextPool.Add(info);
#endif
        }
    }
コード例 #33
0
    public void SetSelectEnable(bool flag)
    {
        if (font == null)
        {
            font = GetComponent <exSpriteFont>();
        }

        selectEnable = flag;
        isSelected   = false;

        if (selectEnable)
        {
            font.botColor = new Color(1, 1, 1, 1);
            font.topColor = new Color(1, 1, 1, 1);
        }
        else
        {
            font.botColor = new Color(0.5f, 0.5f, 0.5f, 1);
            font.topColor = new Color(0.5f, 0.5f, 0.5f, 1);
        }
    }
コード例 #34
0
    void OnRecordsButton(object data)
    {
        state     = 1;
        isClicked = true;
        index     = (int)data;
        for (int i = 0; i < records.Length; i++)
        {
            records[i].enabled = false;
        }

        exSpriteFont font = records[index].GetComponent <exSpriteFont>();

        if (font.text.Length > 10)
        {
            confirmBox.SetActive(true);
        }
        else
        {
            OnOkButton();
        }
    }
コード例 #35
0
ファイル: Button.cs プロジェクト: e-sport/threekindom
    public void SetButtonEnable(bool flag)
    {
        enabled = flag;

        state = ButtonState.Normal;

        if (fontScript == null)
        {
            fontScript = GetComponent <exSpriteFont>();
        }

        if (enabled)
        {
            fontScript.botColor = new Color(1, 1, 1, 1);
            fontScript.topColor = new Color(1, 1, 1, 1);
        }
        else
        {
            fontScript.botColor = new Color(0.5f, 0.5f, 0.5f, 1);
            fontScript.topColor = new Color(0.5f, 0.5f, 0.5f, 1);
        }
    }
コード例 #36
0
    void Start()
    {
        if(PlayerPrefs.HasKey("volumeFX"))
        {
            if(GetComponent<AudioSource>() != null)
            {
                AudioSource audio = GetComponent<AudioSource>();
                audio.volume = (float)PlayerPrefs.GetInt("volumeFX")/10;
            }
        }

        spawner = GameObject.FindGameObjectWithTag("Spawner").GetComponent<SpawnObstacles>();
        spriteFont = GetComponent<exSpriteFont>();
        statusText = "Level " + spawner.getLevelCount()
                         +"\nGates: " + spawner.getNumGates()
                         +"\nGates Hit: " + "6"
                         +"\nGrade:"+"\n"+"\n"+"\n"
                         +"\nTap to Start"
                         +"\n";

        spriteFont.text = statusText;
    }
コード例 #37
0
ファイル: WSDialogue.cs プロジェクト: e-sport/threekindom
    public void SetDialogue(string t, WarSceneController.WhichSide side)
    {
        gameObject.SetActive(true);
        isShowingText = true;
        text          = t;
        textIdx       = 0;
        timeTick      = Time.realtimeSinceStartup;

        if (font == null)
        {
            font = transform.FindChild("Font").GetComponent <exSpriteFont>();
        }
        font.text = "";

        if (side == WarSceneController.WhichSide.Left)
        {
            transform.localPosition = new Vector3(offset, transform.localPosition.y, transform.localPosition.z);
        }
        else
        {
            transform.localPosition = new Vector3(-offset, transform.localPosition.y, transform.localPosition.z);
        }
    }
コード例 #38
0
    // Use this for initialization
    void Start()
    {
        // Disable rendering of all child items
        foreach (Component component in this.GetComponentsInChildren <Component>())
        {
            if (component.gameObject.renderer != null)
            {
                component.gameObject.renderer.enabled = false;
            }
        }

        fadeTimerStart = 0;
        fadeDone       = true;

        submitButton       = GameObject.Find("SubmitButton").GetComponent <exSprite>();
        submitLabel        = GameObject.Find("SubmitLabel").GetComponent <exSpriteFont>();
        submitButtonActive = false;

        // Disable the submit button to avoid collisions
        submitButton.gameObject.active = false;

        common = (CommonScript)GameObject.Find("Common").GetComponent <CommonScript>();
    }
コード例 #39
0
    void SetupScore()
    {
        // Score
        comboCurrent       = 0;
        comboMax           = 0;
        accuracyTable      = new int[System.Enum.GetNames(typeof(Accuracy)).Length + 1];
        comboText          = (exSpriteFont)GameObject.Find("ComboText").GetComponent <exSpriteFont>();
        comboTextFadeTimer = 0f;
        comboText.text     = "";
        comboText.gameObject.transform.position = new Vector3(0, comboTextY, 0);
        accuracyText          = (exSpriteFont)GameObject.Find("AccuracyText").GetComponent <exSpriteFont>();
        accuracyTextFadeTimer = 0f;
        accuracyText.text     = "";
        accuracyText.gameObject.transform.position = new Vector3(0, accuracyTextY, 0);
        accuracyTimeDiff = 0;
        scoreText        = (exSpriteFont)GameObject.Find("ScoreText").GetComponent <exSpriteFont>();
        scorePercent     = 0f;

        // Game state
        gameStateText      = (exSpriteFont)GameObject.Find("GameStateText").GetComponent <exSpriteFont>();
        gameStateText.text = "Ready";
        gameOver           = false;
    }
コード例 #40
0
    // Use this for initialization
    void Start()
    {
        fade = GameObject.Find("Fade").GetComponent <FadeScript>();
        fade.FadeIn();

        descriptionCloseButton = GameObject.Find("DescriptionCloseButton");
        difficultyLabel        = GameObject.Find("DifficultyLabel").GetComponent <exSpriteFont>();

        difficultyLabel.text = NotesData.DIFFICULTY_LEVEL;

        musicSrc = (AudioSource)this.gameObject.GetComponent <AudioSource>();
        musicSrc.Play();

        for (int i = 0; i < ModeLauncherScript.modesDone.Length; i++)
        {
            string   name   = string.Format("Checkbox_{0}", i + 1);
            exSprite sprite = GameObject.Find(name).GetComponent <exSprite>();
            sprite.renderer.enabled = ModeLauncherScript.modesDone[i];
        }
        if (ModeLauncherScript.descriptionViewed)
        {
            CloseDescription();
        }
    }
コード例 #41
0
ファイル: exUIUtility.cs プロジェクト: toth3max/ex2d-v1
    ///////////////////////////////////////////////////////////////////////////////
    // Button
    ///////////////////////////////////////////////////////////////////////////////

    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------

    static void CreateButtonObject(bool _useSprite)
    {
        // create button object
        GameObject buttonGO = new GameObject("Button");
        exUIButton button   = buttonGO.AddComponent <exUIButton>();

        // create Background
        if (_useSprite)
        {
            GameObject backgroundGO = new GameObject("Background");
            exSprite   background   = backgroundGO.AddComponent <exSprite>();
            button.background             = background;
            backgroundGO.transform.parent = buttonGO.transform;
        }
        else
        {
            GameObject     backgroundGO = new GameObject("Background");
            exSpriteBorder background   = backgroundGO.AddComponent <exSpriteBorder>();
            button.background             = background;
            backgroundGO.transform.parent = buttonGO.transform;
        }

        // create Font
        GameObject   fontGO = new GameObject("Font");
        exSpriteFont font   = fontGO.AddComponent <exSpriteFont>();

        font.text               = "";
        button.font             = font;
        fontGO.transform.parent = buttonGO.transform;

        button.width  = 50.0f;
        button.height = 20.0f;

        //
        Selection.activeObject = buttonGO;
    }
コード例 #42
0
    // Use this for initialization
    void Start()
    {
        spriteFont = GetComponent<exSpriteFont>();
        if(tag == "VolumeText")
        {
            if(PlayerPrefs.HasKey("volume"))
            {
                if(PlayerPrefs.GetInt("volume") > 0)
                {
                    spriteFont.text = "On";
                    volume = 5;
                    PlayerPrefs.SetInt("volume", 5);
                }
                else
                {
                    spriteFont.text = "Off";
                    volume = 0;
                    PlayerPrefs.SetInt("volume", 0);
                }
            }
            else
            {
                spriteFont.text = "On";
                volume = 5;
                PlayerPrefs.SetInt("volume", 5);
            }
        }

        if(tag == "SFXText")
        {
            if(PlayerPrefs.HasKey("volumeFX"))
            {
                if(PlayerPrefs.GetInt("volumeFX") > 0)
                {
                    spriteFont.text = "On";
                    volumeFX = 10;
                    PlayerPrefs.SetInt("volumeFX", 10);
                }
                else
                {
                    spriteFont.text = "Off";
                    volumeFX = 0;
                    PlayerPrefs.SetInt("volumeFX", 0);
                }
            }
            else
            {
                spriteFont.text = "On";
                volumeFX = 10;
                PlayerPrefs.SetInt("volumeFX", 10);
            }
        }

        PlayerPrefs.Save();
    }
コード例 #43
0
    void Start()
    {
        trueButton1 = GameObject.FindGameObjectWithTag("Intangibility");
        trueButton2 = GameObject.FindGameObjectWithTag("Hrglss");
        trueButton3 = GameObject.FindGameObjectWithTag("shrink");
        spriteFont = GameObject.FindGameObjectWithTag("PositionText").GetComponent<exSpriteFont>();
        buttonSetIndex = 1;

        spriteFont.text = buttonSetIndex.ToString() + " (Default)";
    }
コード例 #44
0
 void Start()
 {
     eSF = gameObject.GetComponent<exSpriteFont>();
 }
コード例 #45
0
        public void ChangeButtonUI(GameObject container)
        {
            if (isEffect)
            {
                _chkSpriteRender = container.GetComponent <SpriteRenderer>();
                image            = container.GetComponent <Image>();
#if EX2D
                _chkSpriteFont = container.GetComponent <exSpriteFont>();
                if (_chkSpriteFont)
                {
                    if (bitmapFont)
                    {
                        _chkSpriteFont.fontInfo = bitmapFont;
                    }

                    _chkSpriteFont.topColor = color;
                    _chkSpriteFont.botColor = fontBotttomColor;
                    _chkSpriteFont.Commit();
                }
                else
#endif
                if (null != image)
                {
                    if (null != sprite)
                    {
                        image.sprite = sprite;
                    }
                    image.color = color;
                }
                else if (_chkSpriteRender)
                {
                    _chkSpriteRender.color = color;
                    if (null != sprite)
                    {
                        _chkSpriteRender.sprite = sprite;
                    }
                }
                else
                {
                    _chkTextMesh = container.GetComponent <TextMesh>();
                    if (null == _chkTextMesh)
                    {
                        container.GetComponent <Renderer>().material.SetColor("_Color", color);
                    }
                    else
                    {
                        _chkTextMesh.color = color;
                    }

                    if (null == _chkTextMesh && null != mesh)
                    {
                        _meshFilter = container.GetComponent <MeshFilter>();
                        if (null != _meshFilter)
                        {
                            _meshFilter.mesh = mesh;
                        }
                    }
                }
                if (null != texture)
                {
                    container.GetComponent <Renderer>().material.SetTexture("_MainTex", texture);
                }
            }

            foreach (ButtonEffectBase childEffect in ChildObjects)
            {
                if (childEffect.isEffect)
                {
                    image            = childEffect.child.GetComponent <Image>();
                    _chkSpriteRender = childEffect.child.GetComponent <SpriteRenderer>();
#if EX2D
                    _chkSpriteFont = childEffect.child.GetComponent <exSpriteFont>();

                    if (null != _chkSpriteFont)
                    {
                        if (childEffect.bitmapFont)
                        {
                            _chkSpriteFont.fontInfo = childEffect.bitmapFont;
                        }
                        _chkSpriteFont.topColor = childEffect.color;
                        _chkSpriteFont.botColor = childEffect.fontBotttomColor;
                        _chkSpriteFont.Commit();
                    }
                    else
#endif
                    if (null != image)
                    {
                        if (null != childEffect.sprite)
                        {
                            image.sprite = childEffect.sprite;
                        }
                        image.color = childEffect.color;
                    }
                    else if (_chkSpriteRender)
                    {
                        _chkSpriteRender.color = childEffect.color;
                        if (childEffect.sprite)
                        {
                            _chkSpriteRender.sprite = childEffect.sprite;
                        }
                    }
                    else
                    {
                        if (null != childEffect.child)
                        {
                            _chkTextMesh = childEffect.child.GetComponent <TextMesh>();
                            if (null != _chkTextMesh)
                            {
                                _chkTextMesh.color = childEffect.color;
                            }
                            else
                            {
                                childEffect.child.GetComponent <Renderer>().material.SetColor("_Color", childEffect.color);
                            }

                            if (null != childEffect.texture)
                            {
                                childEffect.child.GetComponent <Renderer>().material.SetTexture("_MainTex", childEffect.texture);
                            }

                            if (null == _chkTextMesh && null != childEffect.mesh)
                            {
                                _meshFilter = container.GetComponent <MeshFilter>();
                                if (null != _meshFilter)
                                {
                                    _meshFilter.mesh = childEffect.mesh;
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #46
0
 void Awake()
 {
     MKSoftHUDTime.instance = this;
     Anzahl = GameObject.Find("Anzahl").GetComponent<exSpriteFont>();
     Zeitfont = GameObject.Find("mm:ss").GetComponent<exSpriteFont>();
 }
コード例 #47
0
    // Use this for initialization
    void Start()
    {
        fade = GameObject.Find("Fade").GetComponent<FadeScript>();
        fade.FadeIn();

        descriptionCloseButton = GameObject.Find("DescriptionCloseButton");
        difficultyLabel = GameObject.Find("DifficultyLabel").GetComponent<exSpriteFont>();

        difficultyLabel.text = NotesData.DIFFICULTY_LEVEL;

        musicSrc = (AudioSource)this.gameObject.GetComponent<AudioSource>();
        musicSrc.Play();

        for (int i = 0; i < ModeLauncherScript.modesDone.Length; i++) {
            string name = string.Format("Checkbox_{0}", i + 1);
            exSprite sprite = GameObject.Find(name).GetComponent<exSprite>();
            sprite.renderer.enabled = ModeLauncherScript.modesDone[i];
        }
        if (ModeLauncherScript.descriptionViewed) {
            CloseDescription();
        }
    }
コード例 #48
0
ファイル: MKSoftGO.cs プロジェクト: StoRmtec500/TestGameGIT
 void Awake()
 {
     GOButton = GameObject.Find("lbl_GO").GetComponent<exSpriteFont>();
     GOButtonaktiv = false;
 }
コード例 #49
0
ファイル: SkillLevelScript.cs プロジェクト: rjayako/omega
 // Use this for initialization
 void Start()
 {
     font = (exSpriteFont)GetComponent<exSpriteFont>();
     font.text = player.SelectedSkills[skillIndex].Level.ToString();
 }
コード例 #50
0
 // ------------------------------------------------------------------
 // Desc:
 // ------------------------------------------------------------------
 void Reset()
 {
     Transform textTrans = transform.Find("Board/Text");
     if ( textTrans != null ) {
         spriteText = textTrans.GetComponent<exSpriteFont>();
     }
 }
コード例 #51
0
ファイル: Coin.cs プロジェクト: exdev/band-of-warriors
 public IEnumerator FinishShowScore(exSpriteFont _score)
 {
     yield return new WaitForSeconds(0.1f);
     Spawner spawner = Game.instance.theSpawner;
     spawner.DestroyScore(_score);
 }
コード例 #52
0
    void Start()
    {
        //Object access
        runner = GameObject.FindGameObjectWithTag("Player").GetComponent<RunnerScript>();
        runnerCol = GameObject.FindGameObjectWithTag("Player").GetComponent<RunnerCollision>();
        spriteFont = GetComponent<exSpriteFont>();

        //Initiated by swipeDetector.cs
        hasStarted = false;

        //Set in runnerCollision
        scoreMultiplier = 1;

        //acheivs
        achieve1 = false;
        achieve2 = false;
        delay = 1.0f;

        //Gate Scoring
        gateScore = 0;
        gateScoreMulti = 1;
    }
コード例 #53
0
 // ------------------------------------------------------------------
 // Desc:
 // ------------------------------------------------------------------
 void Awake()
 {
     headIcon = transform.Find("head_icon").GetComponent<exSprite>();
     userName = transform.Find("name").GetComponent<exSpriteFont>();
     score = transform.Find("score").GetComponent<exSpriteFont>();
 }
コード例 #54
0
 void Start()
 {
     theSpriteFont = GetComponent<exSpriteFont>();
 }
コード例 #55
0
ファイル: DisplayFpsScript.cs プロジェクト: novendraap/beats2
 // Use this for initialization
 void Start()
 {
     textSprite = (exSpriteFont)this.gameObject.GetComponent<exSpriteFont>();
 }
コード例 #56
0
ファイル: FeedbackScript.cs プロジェクト: novendraap/beats2
    // Use this for initialization
    void Start()
    {
        // Disable rendering of all child items
        foreach (Component component in this.GetComponentsInChildren<Component>()) {
            if (component.gameObject.renderer != null) {
                component.gameObject.renderer.enabled = false;
            }
        }

        fadeTimerStart = 0;
        fadeDone = true;

        submitButton = GameObject.Find("SubmitButton").GetComponent<exSprite>();
        submitLabel = GameObject.Find("SubmitLabel").GetComponent<exSpriteFont>();
        submitButtonActive = false;

        // Disable the submit button to avoid collisions
        submitButton.gameObject.active = false;

        common = (CommonScript)GameObject.Find("Common").GetComponent<CommonScript>();
    }