Author Topic: problem with Flash Pro deployment  (Read 3991 times)

Arcanor

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 46
    • View Profile
problem with Flash Pro deployment
« on: November 06, 2013, 09:57:06 AM »
I'm using the latest v.3.0.4 of NGUI.  Trying to deploy a small project to Flash Pro, but NGUI is having a problem.  Here is the error message from the Unity Editor console.

  1. Assets/NGUI/Scripts/UI/UILabel.cs(1013,39): error CS1612: Cannot modify a value type return value of `System.Collections.Generic.List<UnityEngine.Vector3>.this[int]'. Consider storing the value in a temporary variable

I know you don't like flash, but is this supported?  Thanks! :)

UncleAcid

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 51
    • View Profile
Re: problem with Flash Pro deployment
« Reply #1 on: November 06, 2013, 10:18:08 AM »
I had gotten the same thing and solved it using the following, just replace the block under the #else with this.

  1. #if UNITY_FLASH
  2.                 if (scale == 1f)
  3.                 {
  4.                         for (int i = start; i < verts.size; ++i)
  5.                         {
  6.                                
  7.                                 Vector3 buff = verts.buffer[i];
  8.                                 buff.x += fx;
  9.                                 buff.y += fy;
  10.                                 verts.buffer[i] = buff;
  11.                         }
  12.                 }
  13.                 else
  14.                 {
  15.                         for (int i = start; i < verts.size; ++i)
  16.                         {
  17.                                 Vector3 buff = verts.buffer[i];
  18.                                 buff.x = fx + verts.buffer[i].x * scale;
  19.                                 buff.y = fy + verts.buffer[i].y * scale;
  20.                                 verts.buffer[i] = buff;
  21.                         }
  22.                 }
  23. #else
  24.                 if (scale == 1f)
  25.                 {
  26.                         for (int i = start; i < verts.size; ++i)
  27.                         {
  28.                                 verts.buffer[i].x += fx;
  29.                                 verts.buffer[i].y += fy;
  30.                         }
  31.                 }
  32.                 else
  33.                 {
  34.                         for (int i = start; i < verts.size; ++i)
  35.                         {
  36.                                 verts.buffer[i].x = fx + verts.buffer[i].x * scale;
  37.                                 verts.buffer[i].y = fy + verts.buffer[i].y * scale;
  38.                         }
  39.                 }
  40. #endif

Arcanor

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 46
    • View Profile
Re: problem with Flash Pro deployment
« Reply #2 on: November 06, 2013, 10:29:16 AM »
This seems to work.  Thanks for your reply!  :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: problem with Flash Pro deployment
« Reply #3 on: November 07, 2013, 05:01:52 AM »
One of many wonders of Unity's Flash conversion... I'll add it in, thanks.