public void OnEnable() { check = false; bindObject = Selection.activeObject as GameObject; if (bindObject == null) { Debug.LogError("[GameObjectLinkHelper] --> 找不到绑定节点"); return; } gameObjectLink = bindObject.GetComponent <GameObjectLink>() as GameObjectLink; if (gameObjectLink == null) { Debug.LogError("[GameObjectLinkHelper] --> 找不到GameObjectLink组件"); return; } check = true; checkLinkObjects(); }
public void OnDisable() { bindObject = null; gameObjectLink = null; check = false; }