Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by maynull · Apr 09, 2015 at 11:13 AM · iosbuildil2cpp

IL2CPP problem on AddRange(List<>)?

Hello there,

So I've been building the game with Mono 2.x for a while now and there seems to be no problem with Mono. However when I build with IL2CPP, in some part of the game, AddRange doesn't run correctly.

Is there a known issue or are there any workarounds?

Comment
Add comment · Show 7
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image JoshPeterson · Apr 09, 2015 at 11:59 AM 0
Share

I believe that AddRange is working correctly in most cases. Can you provide a few more details? For example what is the type of the generic parameter use with List? What happens when AddRange does not work correctly. Does it throw an exception? Thanks.

avatar image maynull · Apr 09, 2015 at 12:05 PM 0
Share
 if (Accessor.GameStateScript.CurGameState == GameStateEnum.Tutorial)
 {
        List<Gesture> tempGestureList = new List<Gesture>();
        tempGestureList.AddRange(_tutorialGestures);
        tempGestureList.AddRange(_cur$$anonymous$$apGestures);
        result = GestureRecognizer.ProtractorRecognize(vector, onScreenGesture.points[0], onScreenGesture.points[1], tempGestureList);
                 }
 ////////
 
 public class Gesture
 {
     public List<Unistroke> unistrokes;
     public List<Vector2> points;
     public GestureTypeEnum type;
     public Vector2 lastTouchPoint;
 
     public Gesture()
     {
         unistrokes = new List<Unistroke>();
         points = new List<Vector2>();
         lastTouchPoint = new Vector2();
     }
 
     public Gesture(List<Vector2> pointList)
     {
         unistrokes = new List<Unistroke>();
         points = new List<Vector2>();
         //points.AddRange(pointList);
         points.InsertRange(0, pointList);
         lastTouchPoint = new Vector2();
 
         unistrokes.Add(new Unistroke(points));
 
         List<Vector2> reversedPoints = new List<Vector2>();
 
         for (int i = points.Count - 1; i >= 0; i--)
         {
             reversedPoints.Add(points[i]);
         }
 
         unistrokes.Add(new Unistroke(reversedPoints));
 
     }
 
     public Gesture(List<Vector2> pointList, Unistroke u1, Unistroke u2)
     {
         points = new List<Vector2>();
         //points.AddRange(pointList);
         points.InsertRange(0, pointList);
         lastTouchPoint = new Vector2();
         this.unistrokes = new List<Unistroke>();
         unistrokes.Add(u1);
         unistrokes.Add(u2);
     }
 
     ~Gesture()
     {
     }
 }


It works totally fine in $$anonymous$$ono 2.x builds and PC & $$anonymous$$ac however it doesn't work on IL2CPP builds

avatar image JoshPeterson · Apr 09, 2015 at 12:13 PM 0
Share

Thanks for providing the code. Nothing here jumps out at me as being a problem. What happens when AddRange is called on line 4? Does an exception occur?

avatar image maynull · Apr 09, 2015 at 12:14 PM 0
Share

No there is no exception it actually adds something mixed up and not what's on the list

avatar image JoshPeterson · Apr 09, 2015 at 01:03 PM 0
Share

It might be useful to try to scope down the problem, to deter$$anonymous$$e what gets added incorrectly. Also, you might be able to work around the problem by using a foreach loop and calling Add for each elements in the list, ins$$anonymous$$d of calling AddRange.

Show more comments

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to get readable stacktrace in IOS build? 1 Answer

Distribute terrain in zones 3 Answers

Is there a way to upload a Unity project to the App Store with Mono as scripting backend after 1st of June? 1 Answer

IOS append not working? 0 Answers

IOS build size using IL2CPP 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges