public override bool AddReconstruction(ReconstructionAbstractBehaviour reconstructionBehaviour) { if (this.mReconstructionBehaviours.Count == 0) { ReconstructionImpl reconstructionImpl = reconstructionBehaviour.Reconstruction as ReconstructionImpl; if (reconstructionImpl != null) { bool flag = VuforiaWrapper.Instance.SmartTerrainBuilderAddReconstruction(reconstructionImpl.NativePtr) == 1; if (flag) { if (reconstructionImpl is ReconstructionFromTargetImpl) { (reconstructionImpl as ReconstructionFromTargetImpl).CanAutoSetInitializationTarget = false; } this.mReconstructionBehaviours.Add(reconstructionBehaviour); SmartTerrainTrackableBehaviour[] componentsInChildren = reconstructionBehaviour.GetComponentsInChildren <SmartTerrainTrackableBehaviour>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].gameObject.SetActive(false); } } else { Debug.LogError("Could not add Reconstruction to SmartTerrainBuilder"); } return(flag); } } else { Debug.LogError("Could not add Reconstruction to SmartTerrainBuilder, only one reconstruction can be added at a time"); } return(false); }
public override bool RemoveReconstruction(ReconstructionAbstractBehaviour reconstruction) { if (this.mReconstructionBehaviours.Contains(reconstruction)) { bool result = false; ReconstructionImpl reconstructionImpl = reconstruction.Reconstruction as ReconstructionImpl; if (reconstructionImpl != null) { result = (VuforiaWrapper.Instance.SmartTerrainBuilderRemoveReconstruction(reconstructionImpl.NativePtr) == 1); } this.mReconstructionBehaviours.Remove(reconstruction); reconstruction.OnReconstructionRemoved(); return(result); } return(false); }
public override bool DestroyReconstruction(Reconstruction reconstruction) { ReconstructionImpl reconstructionImpl = reconstruction as ReconstructionImpl; return(reconstructionImpl != null && VuforiaWrapper.Instance.SmartTerrainBuilderRemoveReconstruction(reconstructionImpl.NativePtr) == 1); }