public static DrawRect ( Rect r, float y, Color c, float padding = 0.0f ) : void | ||
r | Rect | |
y | float | |
c | Color | |
padding | float | |
Résultat | void |
void Update() { if (_drawDebugLines) { UCore.DrawRect(m_testbed.Bound, 0.1f, Color.white); } Vector3 target = m_moveTarget.transform.position; Vector3 dist = target - m_player.transform.position; if (dist.magnitude > 1.0f) { Vector3 delta = dist.normalized * Time.deltaTime * 100.0f; if (delta.magnitude > dist.magnitude) { m_player.transform.position = target; } else { m_player.transform.position += delta; } } else { if (_alwaysMove) { SetNewTarget(); } } m_testbed.Update(m_player.transform.position); }
public void Update(Vector3 position) { MetaLodTargetGameObject.PlayerPos = position; m_metalod.Update(); foreach (var target in m_metalod.Targets) { MetaLodTargetGameObject tgo = target as MetaLodTargetGameObject; Vector3 pos = tgo.gameObject.transform.position; Rect rect = new Rect() { }; rect.center = new Vector2(pos.x, pos.z); rect.size = new Vector2(5.0f, 5.0f); UCore.DrawRect(rect, 10.0f, new Color(tgo.Liveness, 0, 0, 1)); } }
private void DrawDebugLines() { UQtAlgo.TraverseAllLeaves(_root, (leaf) => { Color c = Color.gray; if (leaf == _focusLeaf) { c = Color.blue; } else if (_swapInQueue.Contains(leaf)) { c = Color.green; } else if (_swapOutQueue.Contains(leaf)) { c = Color.red; } else if (_holdingLeaves.Contains(leaf)) { c = Color.white; } UCore.DrawRect(leaf.Bound, 0.1f, c, 1.0f); }); }