public void LoadResource(VisualEffectResource resource, VisualEffect effectToAttach = null) { if (graphView.controller == null || graphView.controller.model != resource) { bool differentAsset = resource != m_DisplayedResource; m_DisplayedResource = resource; graphView.controller = VFXViewController.GetController(resource, true); graphView.UpdateGlobalSelection(); if (differentAsset) { graphView.FrameNewController(); } } if (effectToAttach != null && graphView.controller != null && graphView.controller.model != null && effectToAttach.visualEffectAsset == graphView.controller.model.asset) { graphView.attachedComponent = effectToAttach; } }