OCLComponentAdapter Class

Summary

Generic localization component for OCL made for ease of use and fast integreation. Automatically loalize supported components of the GameObject Supported components are : - Text (string, "text" attribute) - TextMesh (string, "text" attribute) - TextMeshPro (string, "text" attribute) - UILabel (string, "text" attribute) - TextMeshPro (string, "text" attribute) - Image (Sprite, "sprite" attribute) - RawImage (Texture, "texture" attribute) - AudioSource (AudioClip, "clip" attribute) To customize and add a new supported type, on the same scheme as the other types, modify InitComps and the right Get/SetValue methods. OCLComponentAdapter check every frame if the localized attribute changed and localize it if needed. NGUI Support must be conditionnal and handled by reflection as the package could not be present in the project.
Namespace
OneClickLocalization.Components
Base Types
  • MonoBehaviour
graph BT Type-->Base0["MonoBehaviour"] Type["OCLComponentAdapter"] class Type type-node

Syntax

[AddComponentMenu("OneClickLocalization/Component Adapter")]
public class OCLComponentAdapter : MonoBehaviour

Attributes

Type Description
AddComponentMenu

Fields

Methods

Name Value Summary
GetAudioClipCompValue(Component) AudioClip
Get the value for an AudioClip based component
GetSpriteCompValue(Component) Sprite
Get the value for a Sprite based component
GetTextCompValue(Component) string
Get the value for a Text based component
GetTextureCompValue(Component) Texture
Get the value for a Texture based component