Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Oct 03, 2018 at 04:23 PM by Staffordwhat.
avatar image
0
Question by Staffordwhat · Oct 03, 2018 at 04:01 PM · arraylistarrayslistsarraylist

How can you do calculations on two lists?

I have two lists of floats and I want to be able to divide the contents of both lists together:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class moveCube : MonoBehaviour {
 
  public List myListPerson = new List();
     public List<float> myListCar = new List<float>();
 
 }

I am adding new floats to this list in Update using myListPerson.Add and I want to be able to do calculations on these lists in real time e.g. mylistPerson/myListCar.

Is this possible? Sorry if this question is very vague.

Comment
Add comment · Show 1
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 tormentoarmagedoom · Oct 03, 2018 at 04:10 PM 0
Share

Good day. I edited your question... USE THE CODE BUTTON TO PASTE CODE PLEASE!

1 Reply

  • Sort: 
avatar image
1
Best Answer

Answer by tormentoarmagedoom · Oct 03, 2018 at 04:16 PM

Good day.

Yes is very vague.. You ask

"Is this possible?"

I answer you:

Yes, it is.

Good bye


I supose you want to know how to do it (you didnt ask for it....) You want to know something very simple, i dont understand why are you asking this.... If you are able to create and declare a List, really don't know how to access it? its very strange... You spent 0 minutes on goolge looking for it... So i dont think is good for you to give you the answer...

Second, wtf means

"mylistPerson/myListCar"

divide a list with another list? only numbers can be divided by other numbers... Maybe you want to say something like this...?

 float result = mylistPerson[i]/myListCar[u];

Please remake all whole question, using good examples, explaingin why you need this, what you find on internet, what YOU TRIED...

Now yes. Good bye.

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

Follow this Question

Answers Answers and Comments

108 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 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 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 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 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 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

Undo/back system using a List/Array 2 Answers

Reading all data in the list with duplicate data inside 1 Answer

How to return index of List element? 1 Answer

How to modify array values? 1 Answer

Is there a way to remove array entries in the editor? 4 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