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 AMDAndrew · Dec 28, 2012 at 09:33 AM · meshcombineargumentsoverload

No overload for method "X" takes `1' arguments

Hello Guys, I'm having a problem with the Draw Call Optimizer from AssetStore.

At the line 136,

 Mesh[] combinedMeshes = MeshCombineUtility.Combine(meshIntermediates.ToArray());


Indicates the following error

 No overload for method `Combine' takes `1' arguments

I tried to use, in the script where the error shows up :

Using MeshCombineUtility;

but still I was getting an error (cause' it's not a unity system type).

This is the Start sequence from the first script

 void Start()
     {
         
         MeshFilter[] filters = GetComponentsInChildren<MeshFilter>();
         Matrix4x4 myTransform = transform.worldToLocalMatrix;
         
         Dictionary<string, Dictionary<Material, List<MeshCombineUtility.MeshInstance>>> allMeshesAndMaterials = new Dictionary<string, Dictionary<Material, List<MeshCombineUtility.MeshInstance>>>();
         for(int i = 0; i < filters.Length; i++)
         {
             Renderer curRenderer = filters[i].renderer;
             MeshCombineUtility.MeshInstance instance = new MeshCombineUtility.MeshInstance();
             
             instance.mesh = filters[i].mesh;
             
             if(curRenderer != null && curRenderer.enabled && instance.mesh != null)
             {

In MeshCombineUtility.cs, the 2nd script, I have the following definitions :

 public class MeshCombineUtility 
 {    
     public struct MeshInstance
     {
         public Mesh      mesh;
         public int       subMeshIndex;            
         public Matrix4x4 transform;
     }
     
     public static Mesh Combine (MeshInstance[] combines, bool generateStrips)
     {
         int vertexCount = 0;
         int triangleCount = 0;
         int stripCount = 0;
         foreach( MeshInstance combine in combines )
         {........................................

Thank you for further help.

//EDIT

Seems that adding a boolean here

Mesh[] combinedMeshes = MeshCombineUtility.Combine(meshIntermediates.ToArray());

results into a matrix error : Cannot implicitly convert type UnityEngine.Mesh' to UnityEngine.Mesh[]'

Comment
Add comment · Show 5
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 AMDAndrew · Dec 28, 2012 at 09:45 AM 0
Share

Ok, So I've tried this but I get an error with the matrix. Cannot implicitly convert type UnityEngine.$$anonymous$$esh' to UnityEngine.$$anonymous$$esh[]'

avatar image Lovrenc · Dec 28, 2012 at 09:49 AM 2
Share

Again. Your function returns $$anonymous$$esh, your variable type is $$anonymous$$esh[]. Wont budge. So change to $$anonymous$$esh combined$$anonymous$$eshes = $$anonymous$$eshCombineUtility.Combine(.......

avatar image AMDAndrew · Dec 28, 2012 at 09:54 AM 0
Share

Please, it's not that simple. If I do that I will get a "missing a using directive" error

avatar image AMDAndrew · Dec 28, 2012 at 10:08 AM 0
Share

Ok Sir. Fattie, I applied what you said and I had to cut down all the matrixes. Now I get no more errors.

I'll be back with a new reply in about 10-30 $$anonymous$$utes.

//Later Edit

Thank you Lovrenc and Fattie.

Although I had to remove the [i] construnctions it's working pretty well.

avatar image AMDAndrew · Dec 28, 2012 at 11:00 AM 0
Share

Nope, you use Tatonation !

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Lovrenc · Dec 28, 2012 at 09:41 AM

Function ID:

 public static MeshCombine
   (MeshInstance[] combines, bool generateStrips)

Your call:

 MeshCombineUtility.Combine(meshIntermediates.ToArray());


Seems like youre missing a boolean in your call. Try:

 MeshCombineUtility.Combine(meshIntermediates.ToArray(), false);

use true or false depending on your needs.

Also. Your function returns Mesh. Your variable type is Mesh[]

Change to:

 Mesh combinedMeshes = MeshCombineUtility.Combine(.......
Comment
Add comment · Share
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

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

10 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

Related Questions

CombineMeshes() Not Working Properly? 0 Answers

Assertion failed on expression: '(int)lastVertex < GetVertexCount()' 1 Answer

CombineMeshes not working on one machine but is on another 1 Answer

C# No overload for method 'BeOlvasBabok' takes 1 arguments 1 Answer

Occlusion culling and mesh combining possible and working? 0 Answers


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