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 CameraComponent Init(ConfigDataCamera config) { //初始化配置 m_yOffset = config.Yoffset * Number.EN4; m_aspect = config.Aspect * Number.EN4; m_minFieldOfView = config.MinFieldOfView * Number.EN4; m_maxFieldOfView = config.MaxFieldOfView * Number.EN4; m_zValue = config.Depth * Number.EN4; m_dumpRatio = config.DumpRatio * Number.EN4; m_position = Vector.zero; m_fieldOfView = m_maxFieldOfView; CalcViewportRect(); return(this); }
/// <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); }