public void CreateStage(ConfigDataStage configDataStage, IAssetProvider assetProvider) { var stagePrefab = assetProvider.GetAsset <GameObject>(configDataStage.Prefab); var go = GameObject.Instantiate(stagePrefab); go.transform.SetParent(StageRoot.transform, false); }
public void Init(ConfigDataStage configDataStage) { m_BorderXMin = configDataStage.BorderXMin * Number.EN4; m_BorderXMax = configDataStage.BorderXMax * Number.EN4; m_BorderYMin = configDataStage.BorderYMin * Number.EN4; m_BorderYMax = configDataStage.BorderYMax * Number.EN4; m_P1InitPos = new Vector(configDataStage.P1InitPos[0] * Number.EN4, configDataStage.P1InitPos[1] * Number.EN4); m_P2InitPos = new Vector(configDataStage.P2InitPos[0] * Number.EN4, configDataStage.P2InitPos[1] * Number.EN4); }
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); }
/// <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 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); }