Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

X-Com style interface

Discussion in 'General Discussion' started by heathkit, Apr 17, 2014.

  1. heathkit

    heathkit

    Joined:
    Oct 10, 2013
    Posts:
    2
    I'm working on my first unity project, and I'd like to create a control interface similar to how X-Com works. So, the player can move units - the have a cursor indicating which space the unit will move to. Potentially, there's also a line indicating the path the unit will take.

    So far, the best way I've thought to do this is with a game object for the cursor (like a semi-transparent wireframe cube). I don't like it, but I could construct the path indicator with a set of game objects that are elongated cylinders for each line segment. Is there a better way to approach this? Is there an example out there of a system like this?
     
  2. minionnz

    minionnz

    Joined:
    Jan 29, 2013
    Posts:
    391
    $xcom.png

    Are you meaning A, B, or C?

    I'd use a cube for A, a Line Renderer for B and probably a Sprite for C
     
  3. heathkit

    heathkit

    Joined:
    Oct 10, 2013
    Posts:
    2
    Thanks, that's what I was looking for. How would you handle the health display for each unit? It's just a billboarded texture, right?

    Also, using the line renderer - if I wanted a multi-segment line with sharp angles, would I need a different line renderer for each segment?
     
  4. minionnz

    minionnz

    Joined:
    Jan 29, 2013
    Posts:
    391
    A texture will work fine, using a transparent cutout shader to reduce/increase the visible health. Though have a look at nGUI or Daikon Forge - they may be more useful or easier to set up.

    LineRenderer supports multi-segment, if you plan to make it curved you'll probably have to split the line and calculate x/z positions yourself.