public void Initialize(HLODControllerBase controller, ISpaceManager spaceManager, HLODTreeNode parent) { for (int i = 0; i < m_childTreeNodeIds.Count; ++i) { var childTreeNode = m_container.Get(m_childTreeNodeIds[i]); childTreeNode.Initialize(controller, spaceManager, this); } //set to initialize state m_fsm.ChangeState(State.Release); m_fsm.RegisterIsReadyToEnterFunction(State.Release, IsReadyToEnterRelease); m_fsm.RegisterEnteredFunction(State.Release, OnEnteredRelease); m_fsm.RegisterEnteringFunction(State.Low, OnEnteringLow); m_fsm.RegisterIsReadyToEnterFunction(State.Low, IsReadyToEnterLow); m_fsm.RegisterEnteredFunction(State.Low, OnEnteredLow); m_fsm.RegisterExitedFunction(State.Low, OnExitedLow); m_fsm.RegisterEnteringFunction(State.High, OnEnteringHigh); m_fsm.RegisterIsReadyToEnterFunction(State.High, IsReadyToEnterHigh); m_fsm.RegisterEnteredFunction(State.High, OnEnteredHigh); m_fsm.RegisterExitedFunction(State.High, OnExitedHigh); m_controller = controller; m_spaceManager = spaceManager; m_parent = parent; m_isVisible = true; m_isVisibleHierarchy = true; m_boundsLength = m_bounds.extents.x * m_bounds.extents.x + m_bounds.extents.z * m_bounds.extents.z; }
public void Setup() { mGameObject = AssetDatabase.LoadAssetAtPath <GameObject>("Assets/TestAssets/Prefabs/HLODTestPrefabBaked.prefab"); mGameObject = GameObject.Instantiate(mGameObject, Vector3.zero, Quaternion.identity); Assert.NotNull(mGameObject); mHlodGameObject = mGameObject.transform.Find("HLOD").gameObject; Assert.NotNull(mHlodGameObject); mHlodController = mHlodGameObject.GetComponentInChildren <HLODControllerBase>(); mHlodController.Install(); mHlodController.Awake(); mHlodController.Start(); mHlodController.OnEnable(); mHlodCameraComponent = HLODCameraRecognizer.RecognizedCamera; Assert.NotNull(mHlodCameraComponent); }