示例#1
0
文件: Beat.cs 项目: tTomonori/KeyNote
    private void createBeatObject(bool aTriplet = false)
    {
        if (mBeatObject != null)
        {
            mBeatObject.delete();
        }
        mBeatObject = MyBehaviour.createObjectFromPrefab <MyBehaviour>("score/" + (aTriplet ? "beatTriplet" : "beat"));
        mBeatObject.transform.parent        = this.gameObject.transform;
        mBeatObject.transform.localPosition = new Vector3(0, 0, 0);
        mBeatObject.transform.localScale    = new Vector3(1, 1, 1);

        //配列初期化
        if (aTriplet)
        {
            mNotes    = new Note[3];
            mLyricses = new LyricsBubble[3];
            mBpms     = new ChangeBpmObject[3];
        }
        else
        {
            mNotes    = new Note[4];
            mLyricses = new LyricsBubble[4];
            mBpms     = new ChangeBpmObject[4];
        }
        //behaviour取得
        mNotePositions   = mBeatObject.findChild("notes").GetComponent <MyBehaviour>().GetComponentsInChildrenWithoutSelf <Transform>();
        mLyricsPositions = mBeatObject.findChild("lyricses").GetComponent <MyBehaviour>().GetComponentsInChildrenWithoutSelf <Transform>();
        mBpmPositions    = mBeatObject.findChild("bpms").GetComponent <MyBehaviour>().GetComponentsInChildrenWithoutSelf <Transform>();
        sendTimeToColliders();
    }
    //選択不可のキャラの設定
    private void setNg()
    {
        Arg aData  = MySceneManager.getArg("charaSetting");
        int tCount = 0;

        foreach (string tFile in aData.get <string[]>("ng"))
        {
            if (tFile == "none")
            {
                continue;
            }
            MyBehaviour tBehaviour = GameObject.Find(tFile).GetComponent <MyBehaviour>();
            tBehaviour.findChild <SpriteRenderer>("ng").color = new Color(0, 0, 0, 0.6f);
            tBehaviour.findChild <MyButton>("button").gameObject.SetActive(false);
            tCount++;
        }
        if (tCount <= 1)
        {
            MyBehaviour tBehaviour = GameObject.Find("noneChara").GetComponent <MyBehaviour>();
            tBehaviour.findChild <SpriteRenderer>("ng").color = new Color(0, 0, 0, 0.6f);
            tBehaviour.findChild <MyButton>("button").gameObject.SetActive(false);
        }
    }
示例#3
0
 //キャラの設定内容を表示
 void setCharaSetting(GameSetting.CharaData aData, MyBehaviour aDataDisplay)
 {
     if (aData.mFile == "none")
     {
         aDataDisplay.findChild <SpriteRenderer>("charaImg").sprite = null;
         aDataDisplay.findChild <TextMesh>("charaName").text        = "なし";
         aDataDisplay.findChild <TextMesh>("none").color            = new Color(1, 1, 1, 1);
     }
     else
     {
         aDataDisplay.findChild <SpriteRenderer>("charaImg").sprite = Resources.Load <Sprite>("sprites/chara/" + aData.mFile + "/" + aData.mFile);
         aDataDisplay.findChild <TextMesh>("charaName").text        = aData.mName;
         aDataDisplay.findChild <TextMesh>("none").color            = new Color(1, 1, 1, 0);
     }
     aDataDisplay.findChild <TextMesh>("aiName").text = aData.mAiName;
 }