public void RenderDiff() { // Blue Overlay this.baseOverlay = new Overlay(baseBranch.GetTip(), new Color(0.278f, 1f, 0.916f, 0.5f)); // Pink Overlay this.featureOverlay = new Overlay(featureBranch.GetTip(), new Color(0.7f, 0.22f, 0.63f, 0.5f)); foreach (VersionController ffController in ffControllers) { if (baseBranch.GetTip().ObjectIsTrackedInThisCommit(ffController)) { baseOverlay.RemoveObject(ffController); } if (featureBranch.GetTip().ObjectIsTrackedInThisCommit(ffController)) { featureOverlay.RemoveObject(ffController); } } foreach (VersionController resolvedController in resolvedControllers) { if (stagingArea[resolvedController] == baseBranch.GetTip().getObjectVersion(resolvedController)) { baseOverlay.SetColor(resolvedController, new Color(0f, 1f, 0f, 0.5f)); featureOverlay.SetColor(resolvedController, new Color(0f, 0f, 0f, 0.5f)); } else if (stagingArea[resolvedController] == featureBranch.GetTip().getObjectVersion(resolvedController)) { featureOverlay.SetColor(resolvedController, new Color(0f, 1f, 0f, 0.5f)); baseOverlay.SetColor(resolvedController, new Color(0f, 0f, 0f, 0.5f)); } // TODO: Somehow enable selectivity of the game object associated with this vesion controller in both overlays } //Hide the real object so that they can focus on the merge previews foreach (VersionController conflictController in conflictControllers) { Renderer conflictRenderer = conflictController.GetActiveVersion().GetComponent <Renderer>(); if (conflictRenderer != null) { conflictRenderer.enabled = false; hiddenSprites.Add(conflictRenderer); } } }
public void PickObject(GameObject pickedObject) { VersionController versionedObject; if (baseOverlay.HasGameObject(pickedObject, out versionedObject)) { PickVersion(versionedObject, baseBranch.GetTip().getObjectVersion(versionedObject)); baseOverlay.SetColor(versionedObject, new Color(0f, 1f, 0f, 0.5f)); featureOverlay.SetColor(versionedObject, new Color(0f, 0f, 0f, 0.5f)); this.ui.VersionPicked(versionedObject, pickedObject); } else if (featureOverlay.HasGameObject(pickedObject, out versionedObject)) { PickVersion(versionedObject, featureBranch.GetTip().getObjectVersion(versionedObject)); featureOverlay.SetColor(versionedObject, new Color(0f, 1f, 0f, 0.5f)); baseOverlay.SetColor(versionedObject, new Color(0f, 0f, 0f, 0.5f)); this.ui.VersionPicked(versionedObject, pickedObject); } }