예제 #1
0
    private void DrawRadar()
    {
        IHuman[] humansIn = IHuman.GetNearByAll(player.trans.position, 50);
        Rect     r        = new Rect(0, 0, 100, 100);

        GUI.color = Color.gray;
        GUI.Box(r, "");
        for (int i = 0; i < humansIn.Length; i++)
        {
            Vector3 p = player.trans.InverseTransformPoint(humansIn [i].trans.position - player.trans.position) + new Vector3(50, 0, 50);
            r         = new Rect(p.x - 5, p.z - 5, 10, 10);
            GUI.color = Color.blue;
            GUI.Box(r, "");
        }
        IZombie[] zIn = IZombie.GetNearByAll(player.trans.position, 50);
        for (int i = 0; i < zIn.Length; i++)
        {
            Vector3 p = player.trans.InverseTransformPoint(zIn [i].trans.position - player.trans.position) + new Vector3(50, 0, 50);
            r         = new Rect(p.x - 10, p.z - 10, 20, 20);
            GUI.color = Color.red;
            GUI.Box(r, "");
        }
    }