Exemplo n.º 1
0
    /// <summary>
    /// 指定されたドロップの種類に応じてプレハブ生成
    /// </summary>
    /// <param name="droptype">ドロップの種類</param>
    /// <returns>ドロップのGameObject</returns>
    public GameObject DropCreate(Drop.DROPTYPE droptype)
    {
        GameObject DropPrefab;

        switch (droptype)
        {
        case Drop.DROPTYPE.Circle:
            DropPrefab = Instantiate(CircleDropPrefab);
            DropPrefab.GetComponent <Drop>()._DropType = droptype;
            return(DropPrefab);

        case Drop.DROPTYPE.Cross:
            DropPrefab = Instantiate(CrossDropPrefab);
            DropPrefab.GetComponent <Drop>()._DropType = droptype;
            return(DropPrefab);

        case Drop.DROPTYPE.Tryangle:
            DropPrefab = Instantiate(TryangleDropPrefab);
            DropPrefab.GetComponent <Drop>()._DropType = droptype;
            return(DropPrefab);

        default:
            return(null);
        }
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        //プレハブ生成
        //HPの合計値を計算
        ToatalHP = 0;
        GameObject DropPrefab;

        DropPrefab = Instantiate(CirclePlayerPrefab);
        DropPrefab.GetComponent <Player>()._DropType = Drop.DROPTYPE.Circle;
        ToatalHP += DropPrefab.GetComponent <Player>()._HP;

        DropPrefab = Instantiate(CrossPlayerPrefab);
        DropPrefab.GetComponent <Player>()._DropType = Drop.DROPTYPE.Cross;
        ToatalHP += DropPrefab.GetComponent <Player>()._HP;


        DropPrefab = Instantiate(TryanglePlayerPrefab);
        DropPrefab.GetComponent <Player>()._DropType = Drop.DROPTYPE.Tryangle;
        ToatalHP += DropPrefab.GetComponent <Player>()._HP;
    }