Esempio n. 1
0
    /// <summary>
    /// 通过游戏类型获取角色数据类型
    /// </summary>
    /// <returns></returns>
    public MiniGameCharacterBean CreateMiniGameCharacterBeanByType()
    {
        MiniGameCharacterBean itemUserGameData = null;

        switch (gameType)
        {
        case MiniGameEnum.Barrage:
            itemUserGameData = new MiniGameCharacterForBarrageBean();
            break;

        case MiniGameEnum.Combat:
            itemUserGameData = new MiniGameCharacterForCombatBean();
            break;

        case MiniGameEnum.Cooking:
            itemUserGameData = new MiniGameCharacterForCookingBean();
            break;

        case MiniGameEnum.Account:
            itemUserGameData = new MiniGameCharacterForAccountBean();
            break;

        case MiniGameEnum.Debate:
            itemUserGameData = new MiniGameCharacterForDebateBean();
            break;
        }
        return(itemUserGameData);
    }
Esempio n. 2
0
    public override void StartGame()
    {
        base.StartGame();
        //发射器开始旋转
        MiniGameAccountEjectorCpt       ejectorCpt        = miniGameBuilder.GetEjector();
        MiniGameCharacterForAccountBean userCharacterData = (MiniGameCharacterForAccountBean)miniGameData.GetUserGameData();

        userCharacterData.characterData.GetAttributes(out CharacterAttributesBean characterAttributes);
        ejectorCpt.SetData(5 + characterAttributes.account / 20f, 1.8f + characterAttributes.account / 20f);
        ejectorCpt.SetCallBack(this);
        ejectorCpt.StartRotate();
        //打开游戏UI
        UIMiniGameAccount uiMiniGameAccount = UIHandler.Instance.manager.OpenUIAndCloseOther <UIMiniGameAccount>(UIEnum.MiniGameAccount);

        uiMiniGameAccount.SetData(miniGameData.winSurvivalTime, miniGameData.winMoneyL, miniGameData.winMoneyM, miniGameData.winMoneyS);
        //开始倒计时
        StartCoroutine(StartCountDown());
    }
Esempio n. 3
0
 /// <summary>
 /// 设置NPC数据
 /// </summary>
 /// <param name="characterMiniGameData"></param>
 public void SetData(MiniGameCharacterForAccountBean characterMiniGameData)
 {
     this.characterMiniGameData = characterMiniGameData;
     SetCharacterData(characterMiniGameData.characterData);
 }