fehaar / FFWD

This is the FFWD framework for XNA, that allows you to port Unity3D games to XNA for use on WP7 or XBox360 (XBLIG)
Microsoft Public License
133 stars 36 forks source link

problem in Linerender #40

Closed mydiscogr closed 12 years ago

mydiscogr commented 12 years ago

I've tried Linerender and maybe I've found a bug here's my code the start line have right thickness the end is double where's //WP7 comment means that in unity works without that line but no in FFWD

p.s. can you add some define in main lib just to made conditional compiling :)
p.s.s. I'd like to contribute but I never use git so be patient I'm still studing how git works

public override void Start () {

    _startPoint.x = StartPoint.x;
    _startPoint.y = StartPoint.y;
    _startPoint.z = transform.position.z;
    _endpoint.z = transform.position.z;

    _lineRenderer = gameObject.AddComponent<LineRenderer>();
    _lineRenderer.useWorldSpace = true;     //WP7   maybe in unity default is True, in your code is false
    _lineRenderer.SetColors( Color.white, Color.white); 
    _lineRenderer.material =material;
    _lineRenderer.SetVertexCount(2);        //WP7 without this I have an exception...

      #if WP7
    _lineRenderer.SetWidth(lineWidth,lineWidth/2);  //correction FFWD
      #else
    _lineRenderer.SetWidth(lineWidth,lineWidth);    
     #endif 
   }    
fehaar commented 12 years ago

Yes. It is very possible that there are some things in the LineRenderer that is not working exactly as in Unity. I will look at the code and at least try to remove the exceptions for starters.

Regarding the conditional sompilation, you can use the tags WINDOWS and WINDOWS_PHONE. These are defined in XNA by default, but not in Unity. So Unity will ignore the code but it will run in XNA.

mydiscogr commented 12 years ago

great thanks :)