Esempio n. 1
0
        public override void OnInspectorGUI()
        {
//			base.OnInspectorGUI();

            Localizer.Load();
            serializedObject.Update();

            var langCount = Localizer.LanguageList.Count;

            var component = ComponentFinder.Find <Image, RawImage, Renderer>(localizer);

            if (component is Renderer)
            {
                UpdateTexture2DInspector(langCount);
            }
            else if (component is RawImage)
            {
                UpdateTextureInspector(langCount);
            }
            else if (component is Image)
            {
                UpdateSpriteInspector(langCount);
            }

            serializedObject.ApplyModifiedProperties();
        }
Esempio n. 2
0
        protected override void Prepare()
        {
#if LOCALIZER_TMP
            var component = ComponentFinder.Find <TextMesh, Text, TMP_Text>(this);
#else
            var component = ComponentFinder.Find <TextMesh, Text>(this);
#endif
            if (component == null)
            {
                return;
            }

            if (component is TextMesh textMesh)
            {
                injector = new TextMeshInjector(textMesh);
            }
            else if (component is Text text)
            {
                injector = new UITextInjector(text);
            }
#if LOCALIZER_TMP
            else if (component is TMP_Text tmp)
            {
                injector = new TMPInjector(tmp);
            }
#endif
        }
Esempio n. 3
0
        protected override void Prepare()
        {
            var component = ComponentFinder.Find <AudioSource>(this);

            if (component == null)
            {
                return;
            }

            if (component is AudioSource audio)
            {
                injector = new AudioSourceInjector(audio);
            }
        }
Esempio n. 4
0
        protected override void Prepare()
        {
            var component = ComponentFinder.Find <Renderer, RawImage, Image>(this);

            if (component == null)
            {
                return;
            }

            if (component is Renderer renderer)
            {
                injector = new TextureInjector(renderer, propertyName, texture2Ds);
            }
            else if (component is Image image)
            {
                injector = new UIImageInjector(image, sprites);
            }
            else if (component is RawImage rawImage)
            {
                injector = new RawImageInjector(rawImage, textures);
            }
        }