private void createCustomRectPreview() { GameObject customRectPreviewGameObject = GameObject.Find("[Gif Creator] Custom Rect Preview"); if (customRectPreviewGameObject == null) { customRectPreviewGameObject = new GameObject("[Gif Creator] Custom Rect Preview"); customRectPreviewGameObject.hideFlags = HideFlags.HideAndDontSave | HideFlags.HideInInspector; } CustomRectPreview customRectPreview = customRectPreviewGameObject.GetComponent <CustomRectPreview>(); if (customRectPreview == null) { customRectPreview = customRectPreviewGameObject.AddComponent <CustomRectPreview>(); } CustomRectPreview.Singleton = customRectPreview; }
public void OnEnable() { Singleton = this; }