public void SetRenderMethodInterface(RenderMethodInterface renderMethod) { // Set the new rendermethod if (renderMethod == null) { m_renderMethodInterface = null; // Do not change the rendermethod type here as we may want to retain that property // for the next time we create a rendermethod m_actorInterface.SetRenderMethod(HVR.Interface.Types.INVALID_HANDLE); } else { m_renderMethodInterface = renderMethod; // Set the rendermethod here to ensure that the type matches the // rendermethod that was just assigned to this actor m_renderMethodType = renderMethod.type; m_actorInterface.SetRenderMethod(m_renderMethodInterface.handle); } // If the suborutinestack has any shaders, we need to set them again after the rendermethod has changed if (m_subroutineStack.GetShaderArray().Length > 0) { m_forceUpdateSubroutines = true; } }
public void CreateRenderMethod(string renderMethodType) { // Ensure any rendermethod interfaces are deleted and not attached to this HvrActor's actor if (m_renderMethodInterface != null) { m_renderMethodInterface.Delete(); m_renderMethodInterface = null; } // It is required to recreate the asset if the rendermethod is changed // TODO Remove the need to do this if (m_assetInterface != null) { CreateAsset(data, dataMode); } RenderMethodInterface renderMethod = new RenderMethodInterface(); renderMethod.Create(renderMethodType); SetRenderMethodInterface(renderMethod); }
private void Destruct() { if (m_actorInterface != null) { m_actorInterface.Delete(); m_actorInterface = null; } if (m_assetInterface != null) { m_assetInterface.Delete(); m_assetInterface = null; } if (m_renderMethodInterface != null) { m_renderMethodInterface.Delete(); m_renderMethodInterface = null; } HvrScene.Remove(this); }