29 lines
		
	
	
		
			693 B
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			693 B
		
	
	
	
		
			C#
		
	
	
	
using System;
 | 
						|
using System.Collections;
 | 
						|
using System.Collections.Generic;
 | 
						|
using UnityEngine;
 | 
						|
using UnityEngine.UI;
 | 
						|
using LangSprite = LanguageConfig.LangSprite;
 | 
						|
 | 
						|
public class LangImage : MonoBehaviour
 | 
						|
{
 | 
						|
    public bool FitSize = false;
 | 
						|
    [SerializeField] LangSprite[] mLangSprites;
 | 
						|
 | 
						|
    private void Start()
 | 
						|
    {
 | 
						|
        Image tMyImage = GetComponent<Image>();
 | 
						|
        for (int i = 0; i < mLangSprites.Length; i++)
 | 
						|
        {
 | 
						|
            if (mLangSprites[i].LangType == LanguageConfig.Instance.LangType)
 | 
						|
            {
 | 
						|
                tMyImage.sprite = mLangSprites[i].LSprite;
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        if (FitSize)
 | 
						|
        {
 | 
						|
            tMyImage.SetNativeSize();
 | 
						|
        }
 | 
						|
    }
 | 
						|
} |