/// <summary>
    /// チームの初期化
    /// </summary>
    /// <param name="index"></param>
    private void InitTeam(int index)
    {
        // チーム
        BattleMapTeam team = new BattleMapTeam();

        team.Index = index;

        BattleMapTeamColorType teamColor = (BattleMapTeamColorType)Enum.ToObject(typeof(BattleMapTeamColorType), index);

        team.TeamColor = teamColor;

        // コマンドボード
        BattleMapCommandBoard commandBoard = commandGenerator.CreateCommandBoard();

        team.CommandBoard = commandBoard;

        // TODO: とりあえず先頭以外は非活性
        if (index != 0)
        {
            commandBoard.GameObject.SetActive(false);
        }

        // チームの追加
        BattleMapTeams teams = holder.BattleMapTeams;

        teams.TeamList.Add(team);
    }
Example #2
0
    /// <summary>
    /// ドロップダウンからモンスターのチームを取得
    /// </summary>
    /// <returns></returns>
    private BattleMapTeam GetTeamByDropdown()
    {
        string text = dropdownTeam.captionText.text;

        BattleMapTeamColorType colorType = (BattleMapTeamColorType)Enum.Parse(typeof(BattleMapTeamColorType), text);

        return(holder.BattleMapTeams.GetByColor(colorType));
    }
Example #3
0
    public BattleMapTeam GetByColor(BattleMapTeamColorType colorType)
    {
        //foreach (BattleMapTeam team in teamList)
        //{
        //    if (team.TeamColor == colorType)
        //    {
        //        return team;
        //    }
        //}

        BattleMapTeam team = teamList.First(t => t.TeamColor == colorType);

        return(team);
    }
    /// <summary>
    /// 顔の色のスプライトを取得
    /// </summary>
    /// <param name="colorType"></param>
    /// <returns></returns>
    private Sprite GetFaceColorImageSprite(BattleMapTeamColorType colorType)
    {
        // キャッシュから取得
        bool exists = faceColorSpriteDic.ContainsKey(colorType);

        if (exists)
        {
            return(faceColorSpriteDic[colorType]);
        }

        // パスを作成
        string typeStr   = colorType.ToString().ToLower();
        string imagePath = IMAGE_FACE_COLOR_RESOURCE_PREFIX + typeStr;


        // スプライトを取得
        return(Resources.Load <Sprite>(imagePath));
    }
Example #5
0
    public GameObject InstantiateCircle(BattleMapTeamColorType colorType)
    {
        GameObject go = null;

        switch (colorType)
        {
        case BattleMapTeamColorType.RED:
            go = Instantiate(circleRedPrefab) as GameObject;
            break;

        case BattleMapTeamColorType.BLUE:
            go = Instantiate(circleBluePrefab) as GameObject;
            break;

        default:
            break;
        }

        go.GetComponent <SpriteRenderer>().sortingOrder = ICON_SORTING_ORDER_MASK_DOWN;

        return(go);
    }