This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityAtoms; | |
using UnityAtoms.BaseAtoms; | |
using UnityEngine; | |
public class EnemyHealthBarManager : MonoBehaviour | |
{ | |
[SerializeField] | |
private AtomList _enemies; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HealthBar : MonoBehaviour | |
{ | |
[SerializeField] | |
private IntVariable Health; | |
void Update() | |
{ | |
GetComponent<Image>().fillAmount = 1.0f * Health.Value / Health.InitialValue; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PlayerHealth : MonoBehaviour | |
{ | |
public IntVariable Health; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
resolve: { | |
modules: [ | |
path.join('path', 'to', 'enum'), | |
path.join('path', 'to', 'node_modules'), | |
], | |
}, | |
// Rest of your webpack config... | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.source_strings.json | |
.src_manifest.json | |
.enum_manifest.json | |
src/translatedFbts.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import fbt from 'fbt'; | |
const FancyParagraph = () => ( | |
<p> | |
<fbt desc="fancy paragraph">So fancy!</fbt> | |
</p> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { LocaleConsumer } from 'fbt-easy-setup'; | |
import fbt from 'fbt'; | |
const ToggleLocale = () => ( | |
<LocaleConsumer> | |
{({ locale, setLocale }) => ( | |
<button | |
type="button" | |
onClick={() => setLocale(locale === 'sv_SE' ? 'en_US' : 'sv_SE')} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { LocaleProvider } from 'fbt-easy-setup'; | |
import ReactDOM from 'react-dom'; | |
const App = () => ( | |
<LocaleProvider> | |
{/* Rest of your app goes here... */} | |
</LocaleProvider> | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
module.exports = { | |
entry: [ | |
path.join(process.cwd(), 'src/i18n/init.js'), // Init i18n framework | |
path.join(process.cwd(), 'src/index.js'), // App entry | |
], | |
// Add more config here... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { init } from 'fbt-easy-setup'; | |
import translations from '../translatedFbts.json'; | |
import locales from './locales'; | |
init({ translations, locales, defaultLocale: navigator.language }); |
NewerOlder