コード例 #1
0
ファイル: LevelCreateSys.cs プロジェクト: SongYaMeng/LineOut
    public BtnColor SetBtnInfo(int x1, int y1, string a)
    {
        GameObject go  = Resources.Load <GameObject>(@"Prefabs\BtnColor\" + a.ToString());
        Transform  go1 = transform.GetChild(x1).GetChild(y1);

        go1.GetComponent <SpriteRenderer>().DOFade(0, 0.01f);
        mapCtrl.GetMapOne(x1, y1).IsObstacle = true;
        GameObject go3 = Instantiate(go);

        SetParentInit(go1, go3.transform);
        BtnColor BtnCol1 = go3.transform.GetChild(0).GetComponent <BtnColor>();

        BtnCol1.AddBtnPath(mapCtrl.GetMapOne((int)go1.position.x, (int)go1.position.y));
        BtnCol1.mColor = BtnCol1.GetComponent <SpriteRenderer>().color;
        mapCtrl.AddColors(BtnCol1);
        return(BtnCol1);
    }