Beispiel #1
0
    /// <summary>
    /// 开始游戏
    /// </summary>
    public override void StartGame()
    {
        base.StartGame();
        //显示主持人
        miniGameBuilder.SetCompereCharacterActive(true);
        //评审找位置
        List <NpcAIMiniGameCookingCpt> listAuditNpcAI = miniGameBuilder.GetCharacterByType(NpcAIMiniGameCookingCpt.MiniGameCookingNpcTypeEnum.Auditer);

        for (int i = 0; i < listAuditNpcAI.Count; i++)
        {
            NpcAIMiniGameCookingCpt itemNpc = listAuditNpcAI[i];
            itemNpc.OpenAI();
            itemNpc.SetIntent(NpcAIMiniGameCookingCpt.MiniGameCookingIntentEnum.GoToAuditTable);
        }
        //选手找位置
        List <NpcAIMiniGameCookingCpt> listPlayerNpcAI = miniGameBuilder.GetCharacterByType(NpcAIMiniGameCookingCpt.MiniGameCookingNpcTypeEnum.Player);

        for (int i = 0; i < listPlayerNpcAI.Count; i++)
        {
            NpcAIMiniGameCookingCpt itemNpc = listPlayerNpcAI[i];
            itemNpc.OpenAI();
            itemNpc.SetIntent(NpcAIMiniGameCookingCpt.MiniGameCookingIntentEnum.GoToStove);
        }
        //打开游戏控制器
        BaseControl baseControl = GameControlHandler.Instance.StartControl <ControlForMiniGameCookingCpt>(GameControlHandler.ControlEnum.MiniGameCooking);

        baseControl.SetCameraFollowObj(miniGameBuilder.GetUserCharacter().gameObject);
    }
Beispiel #2
0
    private NpcAIMiniGameCookingCpt CreateCharacter(MiniGameCharacterBean characterGameData, Vector3 startPosition, NpcAIMiniGameCookingCpt.MiniGameCookingNpcTypeEnum npcType)
    {
        GameObject objCharacter        = Instantiate(objNpcContainer, objNpcModel, startPosition);
        NpcAIMiniGameCookingCpt npcCpt = objCharacter.GetComponent <NpcAIMiniGameCookingCpt>();

        npcCpt.startPosition = startPosition;
        npcCpt.SetNpcType(npcType);
        npcCpt.SetData((MiniGameCharacterForCookingBean)characterGameData);
        npcCpt.OpenAI();
        return(npcCpt);
    }