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 /
This question was closed Sep 17, 2014 at 07:01 AM by Kiwasi for the following reason:

Duplicate Question

avatar image
-1
Question by Albert-han · Sep 17, 2014 at 06:52 AM · listint

Comparing int from list1 to int from list2

Hi guys im sorry im asking this question twice. It's because my last question wasnt really answered.

this is just for my learning purpuses and not for my game so i'll be happy to hear any answers

I have two list

List 1

 [System.Serializable]
 public class List1
 {
 public int List1int;
 public string List1name;
 public Texture2d List1texture,
 }

List 2

 [System.Serializable]
 public class List2
 {
 public int List2int;
 public string List2name;
 public Texture2d List2texture,
 }

Both of this list are in different scripts

So the question is how do i compare the list1int to the list2int.

For example:

 If (list1int ==lis2int)
 {
 //do something
 }

But this is not possible because it is not recognise by the script. I also tried the suggestions in my last question like

 List1 list1Object = new List1();
 List2 list2Object = new List2();

Which was said to work but it still does not recognise it. How would i make it so that it can recognise the list1int and then i can compare list1int to list2int.

*if possible can someone please give me a working script as an example of this scenario(each list in 2 different script)

Thanks,so greatful for any answers.

Comment
Add comment · Show 2
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 Kiwasi · Sep 17, 2014 at 07:03 AM 1
Share

Go back and watch the beginner tutorials. You've asked this question three times today. It been answered, but your understanding of basic coding is so poor you haven't understood any of the answers.

avatar image hatake3 · Sep 17, 2014 at 11:53 AM 0
Share

You don't have 2 lists, you have 2 classes with 3 public fields each. Doing

 if (list1int == list2int)

in class List1, for instance, doesn't work because List1 has no clue what list2int is. As Bored$$anonymous$$ormon pointed out, this is very basic coding. Asking more questions here won't get you anywhere, you need to sit down and study the basics for yourself to understand it.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

A node in a childnode? 1 Answer

Get the two highest floats in a genericList without using .Sort()? 1 Answer

Comparing Ints in Two List 1 Answer

Edit each Parameter Class on Function 1 Answer

using char to extract integer numbers from a list - [UnityScript] 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