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 /
avatar image
0
Question by BlacKatFever · Aug 22, 2011 at 07:02 AM · c#javascriptvariablesconversion

Some Basic Conversions from JavaScript to C#

My company is asking me to make a text-based game using Unity (I know) so I'm trying to get a better grasp of the GUI system since I figure I'll be needed to use that almost exclusively.

They've also asked that I do it in C# since the experience will help if we decide to make something for XBLA. Problem is that I have no experience in programming and the guidebook I'm using is written in Java. Any help you can give would be appreciated.

Text is "Unity 3D Game Development By Example" by Ryan Creighton.

When setting up variables there are two areas I don't know how to do in C#. Snipped out excess code. The project is to create a "Memory" type game where you flip cards over and try to find it's pair.

 class Card extends System.Object
 {
     var aCards:Array;
     var aGrid:Array;
     var aCardsFlipped;ArrayList;
     var img : String;
 
 function Card()
   {
     img = "robot";
   }
 }

I'm not sure how to set an image as a variable, nor how to set up Arrays / ArrayLists as variables. I've tried looking around online but there is very little stuff for C# out there. Thanks again for any help you can give. (Any advice on making a text-based game would also be appreciated......just kidding. :( )

Comment
Add comment
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

1 Reply

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

Answer by Joshua · Aug 22, 2011 at 07:12 AM

There's very little stuff for C# out there? Are you kidding me? There are literally dozens and dozens of books on it.

ArrayLists/arrays. Image. Your homework.

Comment
Add comment · Show 2 · 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
avatar image BlacKatFever · Aug 22, 2011 at 08:50 AM 0
Share

The section on ArrayLists / Arrays looks like it will be useful.

I didn't mean to make it sound like there isn't much out there on C#, I meant that in terms of learning materials - there isn't much out there for use of C# within Unity - especially for beginners. There is a text scheduled to come out towards the end of the year but that is it.

There are a few good tutorials out there that I've come across - like the ones at BergZerg Arcade and 3D Buzz, but they're not quite what I'm looking for - namely a very heavy GUI-focused game (well, at least that's how it's looking now.)

Anyway, thanks for taking the time out to reply. Will look into your suggested reading material as well.

avatar image Bunny83 · Aug 22, 2011 at 11:44 AM 0
Share

Well, Unity uses quite plain C# only with some limitations (no unsafe code for example). Learning the language or using it in Unity are two things ;). Unity just provides an API you can use to interact with Unity. $$anonymous$$eep in $$anonymous$$d that "most" examples in the documentation also provide C# samples. You can switch the language in this small drop-down-selector.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Converting a JS script into C# - hit a wall with arrays... 1 Answer

Integer to Character in unityscript 2 Answers

Help, How can I get variables? 1 Answer

Convert from javascript to c# 2 Answers

Accessing variables from scripts issues 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