public void MessageMark(MarkerRepresentation mr) { if (status == -1 && mr.index != -1) { representationHolding = mr; status = 1; //Change own status Color matColour = representationHolding.colourOfMarker; matColour.a = 0.1f; markerMat.color = matColour; //Set the colour markerRenderer.enabled = true; //Enable the renderer } }
public static MarkerRepresentation AssignNewMarker() { if (listOfMarkerColoursAvailable.Count > 0) { MarkerRepresentation retVal = listOfMarkerColoursAvailable[0]; //give it the top-most item listOfMarkerColoursAvailable.RemoveAt(0); return(retVal); } else { Debug.LogError("No marker colour left"); return(new MarkerRepresentation()); //The -1 specifies that this is not useful } }
public MarkerRepresentation representationHolding; //The representation currently held void Start() { status = -1; //initially disabled if (prefabMark != null) { markerInstance = Instantiate(prefabMark); markerInstance.transform.parent = transform; //Who's the daddy? markerInstance.transform.position = transform.position; //With no offset markerMat = markerInstance.GetComponent <MeshRenderer>().material; markerRenderer = markerInstance.GetComponent <Renderer>(); } else { Debug.LogError("No marker prefab attached."); } markerRenderer.enabled = false; //corresponds to status = -1 representationHolding = new MarkerRepresentation(); //set it to the unmarked represenation }
private void MarkThis() //After status check { bool messagesExist = GetComponent <ActorFunctionality>().messageQueueBox.GetComponent <MessageQueueFunctionality>().messageQueue.Count > 0 ? true : false; if (messagesExist) { //We already know that status = -1 representationHolding = Markers.AssignNewMarker(); //Get a representation if (representationHolding.index != -1) { status = 1; //Message is marked Color matColour = representationHolding.colourOfMarker; markerMat.color = matColour; //Set the colour markerRenderer.enabled = true; //Enable the renderer } } else { Log newLog = new Log(1, "Only Actors with messages can be marked"); //Create a Log VisualizationHandler.Handle(newLog); //Send it to the Visualization Handler to be handled } }
public void ClearMark() //Clear the representation held { representationHolding = new MarkerRepresentation(); //clear the representation held }
public void ClearMark() { representationHolding = new MarkerRepresentation(); status = -1; //Set back to unmarked state markerRenderer.enabled = false; }