public void StartSingleVSMatch(ConfigDataCharacter p1CharacterConfig, ConfigDataCharacter p2CharacterConfig, ConfigDataStage stageConfig) { m_stageConfig = stageConfig; m_cameraConfig = ConfigDataLoader.Instance.GetConfigDataCamera(m_stageConfig.CameraConfigID); m_characterConfigs = new ConfigDataCharacter[2] { p1CharacterConfig, p2CharacterConfig }; m_battleWorld.StartSingleVSMatch(m_characterConfigs[0], m_characterConfigs[1], m_stageConfig, m_cameraConfig); }
public static void StartUITask(UIIntent prevIntent, ConfigDataCharacter p1Config, ConfigDataCharacter p2Config, ConfigDataStage stageConfig) { UIIntent intent = new UIIntent(typeof(BattleUITask).Name, prevIntent); intent.SetCustomParam(ParamKey_P1Config, p1Config); intent.SetCustomParam(ParamKey_P2Config, p2Config); intent.SetCustomParam(ParamKey_StageConfig, stageConfig); UIManager.Instance.StartUITask(intent); }
/// <summary> /// 创建一个角色 /// </summary> /// <param name="configDataCharacter"></param> /// <param name="index"></param> /// <returns></returns> private Entity AddCharacter(ConfigDataCharacter configDataCharacter, int index) { var entity = AddEntity(); entity.AddComponent <MoveComponent>(); entity.AddComponent <PlayerComponent>().Init(index, configDataCharacter); entity.AddComponent <CommandComponent>().Init(); entity.AddComponent <LuaScriptComponent>().Init(configDataCharacter.LuaMainModule, entity); //entity.AddComponent<AnimationComponent>().Init(); todo entity.AddComponent <FSMComponent>(); entity.AddComponent <DelayImpactComponent>(); return(entity); }
/// <summary> /// 开始战斗 /// </summary> public void StartSingleVSMatch(ConfigDataCharacter p1CharacterConfig, ConfigDataCharacter p2CharacterConfig, ConfigDataStage stageConfig, ConfigDataCamera cameraConfig) { //更新配置 m_characterConfigs = new ConfigDataCharacter[2] { p1CharacterConfig, p2CharacterConfig }; m_stageConfig = stageConfig; m_cameraConfig = cameraConfig; m_cacheInputCodes = new int[2]; //创建单例组件 AddSingletonComponent <StageComponent>().Init(m_stageConfig); var cameraComponent = AddSingletonComponent <CameraComponent>().Init(m_cameraConfig); m_listener.OnCameraCreate(cameraComponent); var character1 = AddCharacter(m_characterConfigs[0], 0); var character2 = AddCharacter(m_characterConfigs[1], 1); m_matchComponent.SetMatchMode(MatchMode.SingleVS); m_matchComponent.SetMatchState(MatchState.None); m_matchComponent.SetRoundState(RoundState.PreIntro); m_listener.OnCreateCharacter(character1); m_listener.OnCreateCharacter(character2); m_listener.OnMatchStart(0); }
public void UpdateInfo(ConfigDataCharacter configDataCharacter, Dictionary <string, UnityEngine.Object> assetDic) { HeadImage.sprite = AssetUtility.GetSprite(assetDic, configDataCharacter.LittleHeadIcon); }
public void Init(int index, ConfigDataCharacter config) { m_index = index; m_config = config; }