public static highlight ( GameObject obj, Color color ) : void | ||
obj | GameObject | |
color | Color | |
return | void |
public void RecalculateHighlights() { highlighter.removeAllHighlights(); foreach (Unit u in unitsInRange) { highlighter.highlight(u.tile.p, Highlight.Style.RED); } highlighter.highlight(actor.tile.p, Highlight.Style.BLUE); }
override protected void Drag() { // make "uncastable" (uncompilable) spells not draggable if (!compilable) { time_started = Time.time; return; } if (!on_drag) { time_started = Time.time; on_drag = true; } base.Drag(); GameObject obj = objectUnderCursor(); if (obj != null) { if (obj.GetComponent <Enchantable>() != null) { Highlighter.highlight(obj, Color.green); } else { Highlighter.highlight(obj, Color.red); } } else { Highlighter.highlight(null, Color.black); } }
protected void SpellCheck_Click(object sender, EventArgs e) { List <string> invalidWords = new List <string>(); SpellChecker sc = new SpellChecker(); string sql = String.Format("select * from Chapters where ID= {0}", Page.RouteData.Values["ID"].ToString()); DataSet data = connector.query(sql); string content = data.Tables[0].Rows[0]["Content"].ToString(); string[] words = splitter.split(content); foreach (string word in words) { if (!sc.Check(word)) { invalidWords.Add(word); } } System.IO.File.WriteAllLines(@"E:\invalid_words.txt", invalidWords); foreach (string word in invalidWords) { content = highlighter.highlight(content, word); } ChapterContent.Text = content; InvalidCount.Text = String.Format("{0} lỗi", invalidWords.Count); //InvalidCount.Text = String.Join("...", invalidWords.ToArray()); //InvalidCount.Text = words.Length.ToString(); }
public void RecalculateHighlights() { highlighter.removeAllHighlights(); foreach (Point dest in destinationPoints) { Unit otherUnit = currentStage.tiles[dest.x][dest.y].unit; // if (otherUnit == null || (otherUnit != actor && otherUnit.team == actor.team)) { highlighter.highlight(dest, Highlight.Style.GREEN); // } } for (int i = 0; i < currentPath.distance() - 1; i += 1) { highlighter.highlightPath(currentPath.at(i), currentPath.at(i + 1)); } highlighter.highlight(actor.tile.p, Highlight.Style.BLUE); }
public void RecalculateHighlights() { highlighter.removeAllHighlights(); foreach (Unit u in targetableUnits) { highlighter.highlight(u.tile.p, Highlight.Style.RED); } }
private void GetInput() { if (Input.GetKeyDown(KeyCode.C) && !isClimbingLadder) { playerHeight = m_CharacterController.height; cameraHeight = m_Camera.transform.localPosition.y; crouchTime = 0; if (m_standing) { targetCameraHeight = m_cameraHeight * .5f; targetPlayerHeight = m_standHeight * .5f; m_standing = false; } else { if (!Physics.Raycast(transform.position, transform.up, 1.5f)) { targetCameraHeight = m_cameraHeight; targetPlayerHeight = m_standHeight; m_standing = true; } } } if (Math.Abs(m_CharacterController.height - targetPlayerHeight) > 0) { transform.position += Vector3.up * 0.04f; crouchTime += 4f * Time.deltaTime; m_CharacterController.height = Mathf.Lerp(playerHeight, targetPlayerHeight, crouchTime); m_Camera.transform.localPosition = Vector3.Lerp(Vector3.up * cameraHeight, Vector3.up * targetCameraHeight, crouchTime); } if (Input.GetAxis("Mouse ScrollWheel") > 0f || Input.GetKeyDown(KeyCode.T)) { m_Inventory.IncrementCurrentItem(); } else if (Input.GetAxis("Mouse ScrollWheel") < 0f || Input.GetKeyDown(KeyCode.R)) { m_Inventory.DecrementCurrentItem(); } if (Input.GetKeyDown(KeyCode.G)) { m_InventoryDisplay.ToggleInventory(); } RaycastHit hit; if (Physics.Raycast(m_Camera.transform.position, m_Camera.transform.forward, out hit) && (m_Camera.transform.position - hit.point).sqrMagnitude < m_MaxDistanceCheck * m_MaxDistanceCheck) { m_Highlighter.highlight(hit); if (Input.GetMouseButtonDown(0)) { LeftClick(hit); } if (Input.GetMouseButtonDown(1)) { RightClick(hit); } if (Input.GetMouseButton(1)) { HoldRightClick(hit); } } else { m_Highlighter.highlight(null); } }