public void DisposeEditorGO() { if (EditorGameObject) { GameObject.Destroy(EditorGameObject); EditorGameObject = null; kfObj = null; } }
public void EnsureEditorGO(GameObject curvGO) { if (!EditorGameObject) { if (!editorGameObjectPrefabGO) { editorGameObjectPrefabGO = AssetDatabase.LoadAssetAtPath(EditorGameObjectPrefab, typeof(GameObject)) as GameObject; } EditorGameObject = GameObject.Instantiate(editorGameObjectPrefabGO) as GameObject; kfObj = EditorGameObject.GetComponent <GOECurvKeyFrameGO>(); kfObj.Keyframe = this; } EditorGameObject.transform.parent = curvGO.transform; EditorGameObject.transform.localPosition = Position; EditorGameObject.transform.localRotation = Rotation; EditorGameObject.transform.localScale = Scale; }