コード例 #1
0
    // Use this for initialization
    void Start()
    {
        scrguitexcomp = GameObject.Find("ScoreGUI").GetComponent <ScoreGUITexture>(); //コンポーネント
        ggmstrcomp    = GameObject.Find("gage").GetComponent <Gagemaster>();          //コンポーネント
        tex           = scrguitexcomp.optintex;

        //Texture2DからSpriteを作成
        sprite = Sprite.Create(
            texture: tex,
            rect: new Rect(0, 12 * Const.CO.FONTPY, 480, Const.CO.FONTPY),
            pivot: new Vector2(0.5f, 0.5f)
            );
        GetComponent <SpriteRenderer>().sprite = sprite;
        transform.localScale = new Vector3(0.3f, 0.3f, 1.0f);
    }
コード例 #2
0
ファイル: Score0.cs プロジェクト: maze516/cfdgame
    // Use this for initialization
    //スコアカンストしたりマイナスになっても変にならないように(num+10)%10にしている
    void Start()
    {
        scrguitexcomp = GameObject.Find("ScoreGUI").GetComponent <ScoreGUITexture>(); //コンポーネント
        ggmstrcomp    = GameObject.Find("gage").GetComponent <Gagemaster>();          //コンポーネント
        cnt           = 0;
        prenum        = -1;
        num           = 0;
        tex           = scrguitexcomp.numtex;
        sprite        = Sprite.Create(
            texture: tex,
            rect: new Rect(0, (9 - (num + 10) % 10) * Const.CO.FONTPY, 48, Const.CO.FONTPY),
            pivot: new Vector2(0.5f, 0.5f)
            );
        GetComponent <SpriteRenderer>().sprite = sprite;

        Vector3 scale = transform.localScale;

        scale.x *= 0.4f;
        scale.y *= 0.4f;
        transform.localScale = scale;
    }
コード例 #3
0
ファイル: Yajirushi.cs プロジェクト: maze516/cfdgame
 // Use this for initialization
 void Start()
 {
     mnybllts = GameObject.Find("nabie").GetComponent <MenyBullets>(); //
     ggmstr   = GameObject.Find("gage").GetComponent <Gagemaster>();   //コンポーネント
     //yajino = 0;
 }
コード例 #4
0
ファイル: GageSpeedY.cs プロジェクト: maze516/cfdgame
 // Use this for initialization
 void Start()
 {
     mat        = GetComponent <SpriteRenderer>().material;
     ufocomp    = GameObject.Find("ufo").GetComponent <Ufo>();         //ufo コンポーネント
     ggmstrcomp = GameObject.Find("gage").GetComponent <Gagemaster>(); //ufo コンポーネント
 }