コード例 #1
0
    // -Private API-

    private void SpawnCharacter(CharacterConfig config)
    {
        GameObject templateCharacter = Resources.Load <GameObject>("Characters/Templates/" + config.m_CharacterTemplate);
        GameObject spawnedCharacter  = Instantiate(templateCharacter);

        spawnedCharacter.transform.position = transform.position;
        spawnedCharacter.transform.rotation = transform.rotation;

        FighterController fighterController = spawnedCharacter.GetComponent <FighterController>();

        fighterController.SetCombos(config.m_ComboList.ToComboList());

        if (m_PlayerSlotToSpawn < PlayerDataSlots.Count)
        {
            PlayerData playerData = PlayerDataSlots.GetPlayer(m_PlayerSlotToSpawn);
            playerData.m_InputConverter.BindController(fighterController);
        }
    }