private void AssignSubSteps(List <CameraSubStep> subSteps) { foreach (var subStep in subSteps) { if (!SubStepsToCameraSubStepViews.ContainsKey(subStep)) { AddNewSubStepView(subStep); } } RefreshAllNumberLabels(); }
private void ClearSubSteps() { foreach (var kvp in m_SubStepsToSubStepViews) { GameObject.Destroy(kvp.Value.gameObject); } SubStepsToCameraSubStepViews.Clear(); if (CameraSubSteps != null) { CameraSubSteps.Clear(); } }
private void RemoveSubStepView(CameraSubStep subStep) { if (!SubStepsToCameraSubStepViews.ContainsKey(subStep)) { return; } var subStepView = SubStepsToCameraSubStepViews[subStep]; SubStepsToCameraSubStepViews.Remove(subStep); CameraSubSteps.Remove(subStep); GameObject.Destroy(subStepView.gameObject); //RefreshAllNumberLabels(); }
private CameraSubStepView AddNewSubStepView(CameraSubStep subStep) { var subStepViewObj = GameObject.Instantiate(SubStepViewPrefab); var subStepView = subStepViewObj.GetComponent <CameraSubStepView>(); subStepViewObj.transform.SetParent(SubStepViewRoot, false); subStepViewObj.transform.SetAsLastSibling(); AddButtonRootTransform.transform.SetAsLastSibling(); subStepView.SubStep = subStep; subStepView.RemoveButtonClicked += RemoveSubStepView; SubStepsToCameraSubStepViews.Add(subStep, subStepView); return(subStepView); }