public virtual void Init() { if (_Instance != null) { return; } _Instance = this; OnExitingPlayMode_Event = new FOnExitingPlayMode(); ObjectMap = new Dictionary <ulong, ICgObject>(); MCgDataMapping.Init(); FCgManager_Prefab.Get().Init(); #if UNITY_EDITOR FCgPlayInEditor.Get(); #endif // #if UNITY_EDITOR // Set Editor Callbacks #if UNITY_EDITOR EditorApplication.playModeStateChanged += OnPlayModeStateChanged; #endif // #if UNITY_EDITOR }
public static void Init() { if (_Instance != null) { return; } GameObject go = GameObject.Find(DATA_MAPPING_NAME); #if UNITY_EDITOR if (go == null) { FCgDebug.LogError("MCgDataMapping.Init: Failed to find GameObject with name: " + DATA_MAPPING_NAME); } #endif // #if UNITY_EDITOR _Instance = go.GetComponent <MCgDataMapping>(); #if UNITY_EDITOR if (_Instance == null) { FCgDebug.LogError("MCgDataMapping.Init: GameObject: " + DATA_MAPPING_NAME + " does not have a component of type MCgDataMapping."); } #endif // #if UNITY_EDITOR _Instance.Init_Internal(); }