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 Oct 26, 2014 at 11:43 PM by vexe for the following reason:

The question is answered, right answer was accepted

avatar image
-1
Question by kinggaunt · Oct 24, 2014 at 11:35 PM · javascriptgameobjectvariables

What variables can i declare?

I have looked all over here. I am quite new to Unity3D and i would just like to know what are the variables that i can actually declare in Unity3D...

Examples:

JavaScript:

var zombieFigure : gameObject

var zombieFootsteps : sound

var guiFont : Font........

I know about the variables such as string, double, integer etc...

I just want to know if there is a list or if anybody knows ALL of the unity specific variables such as game objects, sounds, fonts, lights etc...

Thank you! :)

Comment
Add comment · Show 4
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 kdubnz · Oct 25, 2014 at 01:57 AM 0
Share

robertbu seems to have answered your issue. You may be better served long term by learning C# ins$$anonymous$$d of UnityScript. Regards,

avatar image Kiwasi · Oct 25, 2014 at 02:07 AM 0
Share

If you are just new to Unity I would strongly suggest learning C# over JavaScript.

avatar image kinggaunt · Oct 25, 2014 at 07:09 PM 0
Share

No, i aren't new to scripting, i just want to know what can i declare that a user can input to a script in the inspector window of a script. JavaScript or C#, i do both. I just want to know what i can do such as:

var Light : light; var sound : AudioClip; ... Can i just have a list of them?

avatar image tanoshimi · Oct 25, 2014 at 10:47 PM 1
Share

Why? What possible use is it to attempt to enumerate every value in a potentially infinite list?

1 Reply

  • Sort: 
avatar image
5
Best Answer

Answer by robertbu · Oct 25, 2014 at 01:39 AM

Asking for this lists like trying to learn plumbing by getting a massive list of all possible plumbing parts. There may be some minimal value long-term, but you would be better off starting small, and adding class as you go. The short (and somewhat simplified) answer, is that you can declare a variable of a primitive types and any class. This includes:

  • Any classes/scripts you write

  • Any classes found in the Unity Scripting API Refrence. On the left hand side of the current version of the refrence, you can open 'UnityEngine' and then 'Classes'.

  • Any of the components you find on the Component menu (which are 'just' classes')

  • Any classes you find on the net like in the Unity Wiki

  • Primitive types like float, double, int. Here is a list of primitive types in C#. I don't believe they all exist in Javascript.

Note your examples declarations are wrong and would not compile. And case matters. 'GameObject' is not the same thing as 'gameObject'. The three might be something like:

 var zombieFigure : GameObject;
 var zombieFootsteps : AudioClip;
 var guiLable : GUIText;

Or at least these three would compile, where your examples would not.

Edit:

Here is a list of classes from the reference. Most (but not all) can be declared as a variable, but for many it does not make sense to do so. BTW: it should be 'var light : Light;

 AccelerationEvent
 ADBannerViewa
 AddComponentMenu
 ADInterstitialAd
 AnchoredJoint2D
 AndroidInput
 AndroidJavaClass
 AndroidJavaException
 AndroidJavaObject
 AndroidJavaProxy
 AndroidJNI
 AndroidJNIHelper
 Animation
 AnimationClip
 AnimationClipPair
 AnimationCurve
 AnimationEvent
 AnimationInfo
 AnimationState
 Animator
 AnimatorOverrideController
 AnimatorStateInfo
 AnimatorTransitionInfo
 AnimatorUtility
 Application
 AssemblyIsEditorAssembly
 AssetBundle
 AssetBundleCreateRequest
 AssetBundleRequest
 AsyncOperation
 AudioChorusFilter
 AudioClip
 AudioDistortionFilter
 AudioEchoFilter
 AudioHighPassFilter
 AudioListener
 AudioLowPassFilter
 AudioReverbFilter
 AudioReverbZone
 AudioSettings
 AudioSource
 Avatar
 AvatarBuilder
 Behaviour
 BitStream
 BoneWeight
 Bounds
 BoxCollider
 BoxCollider2D
 Caching
 Camera
 CapsuleCollider
 CharacterController
 CharacterInfo
 CharacterJoint
 CircleCollider2D
 Cloth
 ClothRenderer
 ClothSkinningCoefficient
 Collider
 Collider2D
 Collision
 Collision2D
 Color
 Color32
 CombineInstance
 Compass
 Component
 ComputeBuffer
 ComputeShader
 ConfigurableJoint
 ConstantForce
 ContactPoint
 ContactPoint2D
 ContextMenu
 ControllerColliderHit
 Coroutine
 CrashReport
 Cubemap
 Cursor
 Debug
 DetailPrototype
 DisallowMultipleComponent
 Display
 DistanceJoint2D
 EdgeCollider2D
 Event
 ExecuteInEditMode
 FixedJoint
 Flare
 Font
 GameObject
 GeometryUtility
 Gizmos
 GL
 Gradient
 GradientAlphaKey
 GradientColorKey
 Graphics
 GUI
 GUIContent
 GUIElement
 GUILayer
 GUILayout
 GUILayoutOption
 GUILayoutUtility
 GUISettings
 GUISkin
 GUIStyle
 GUIStyleState
 GUIText
 GUITexture
 GUIUtility
 Gyroscope
 Handheld
 HideInInspector
 HingeJoint
 HingeJoint2D
 HostData
 HumanBone
 HumanDescription
 HumanLimit
 HumanTrait
 ImageEffectOpaque
 ImageEffectTransformsToLDR
 Input
 InteractiveCloth
 iPhone
 NSError
 NSNotification
 iPhoneInput
 Joint
 Joint2D
 JointAngleLimits2D
 JointDrive
 JointLimits
 JointMotor
 JointMotor2D
 JointSpring
 JointSuspension2D
 JointTranslationLimits2D
 Keyframe
 LayerMask
 LensFlare
 Light
 LightmapData
 LightmapSettings
 LightProbeGroup
 LightProbes
 LineRenderer
 LocalNotification
 LocationInfo
 LocationService
 LOD
 LODGroup
 MasterServer
 MatchTargetWeightMask
 Material
 MaterialPropertyBlock
 Mathf
 Matrix4x4
 Mesh
 MeshCollider
 MeshFilter
 MeshRenderer
 Microphone
 MissingComponentException
 MissingReferenceException
 MonoBehaviour
 Motion
 MovieTexture
 NavMesh
 NavMeshAgent
 NavMeshHit
 NavMeshObstacle
 NavMeshPath
 NavMeshTriangulation
 Network
 NetworkMessageInfo
 NetworkPlayer
 NetworkView
 NetworkViewID
 NotificationServices
 Object
 OcclusionArea
 OcclusionPortal
 OffMeshLink
 OffMeshLinkData
 Particle
 ParticleAnimator
 ParticleEmitter
 ParticleRenderer
 ParticleSystem
 CollisionEvent
 Particle
 ParticleSystemRenderer
 PhysicMaterial
 Physics
 Physics2D
 PhysicsMaterial2D
 Ping
 Plane
 PlayerPrefs
 PlayerPrefsException
 PolygonCollider2D
 ProceduralMaterial
 ProceduralPropertyDescription
 ProceduralTexture
 Profiler
 Projector
 QualitySettings
 Quaternion
 Random
 Ray
 Ray2D
 RaycastHit
 RaycastHit2D
 Rect
 RectOffset
 RemoteNotification
 RenderBuffer
 Renderer
 RenderSettings
 RenderTexture
 RequireComponent
 Resolution
 ResourceRequest
 Resources
 Rigidbody
 Rigidbody2D
 RPC
 RuntimeAnimatorController
 SamsungTV
 Screen
 ScriptableObject
 Security
 SerializeField
 Shader
 SkeletonBone
 SkinnedCloth
 SkinnedMeshRenderer
 Skybox
 SleepTimeout
 SliderJoint2D
 Social
 SoftJointLimit
 SparseTexture
 SphereCollider
 SplatPrototype
 SpringJoint
 SpringJoint2D
 Sprite
 SpriteRenderer
 StackTraceUtility
 StaticBatchingUtility
 SystemInfo
 Terrain
 TerrainCollider
 TerrainData
 TextAsset
 TextEditor
 TextGenerationSettings
 TextGenerator
 TextMesh
 Texture
 Texture2D
 Texture3D
 Time
 Touch
 TouchScreenKeyboard
 TrackedReference
 TrailRenderer
 Transform
 Tree
 TreeInstance
 TreePrototype
 Types
 UICharInfo
 UILineInfo
 UIVertex
 UnassignedReferenceException
 UnityException
 Vector2
 Vector3
 Vector4
 WaitForEndOfFrame
 WaitForFixedUpdate
 WaitForSeconds
 WebCamDevice
 WebCamTexture
 WheelCollider
 WheelFrictionCurve
 WheelHit
 WheelJoint2D
 WWW
 WWWForm





Comment
Add comment · Show 4 · 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 kinggaunt · Oct 25, 2014 at 07:09 PM 0
Share

No, i aren't new to scripting, i just want to know what can i declare that a user can input to a script in the inspector window of a script. JavaScript or C#, i do both. I just want to know what i can do such as:

var Light : light; var sound : AudioClip; ... Can i just have a list of them?

avatar image robertbu · Oct 25, 2014 at 08:57 PM 0
Share

I updated my answer with a list of classes from the reference, but you could have fond the list by looking on the left hand side of any reference page. $$anonymous$$ost can be declared as a variable, but out of context, it may not make sense to do so. And these are only the ones in the engine. These don't include components you import.

avatar image Kiwasi · Oct 25, 2014 at 10:42 PM 0
Share

@robertbu I'm so tempted right now to go onto $$anonymous$$SDN right now and copy off the full list of classes in every namespace...

@kinggaunt Be careful what you wish for. The full list from the .Net framework will be massive and essentially useless. You are better off searching for classes as you need them, rather then trying to understand the entire rang of possibilities.

avatar image kinggaunt · Oct 26, 2014 at 01:55 AM 0
Share

Thank you robertbu

Follow this Question

Answers Answers and Comments

29 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

Related Questions

Multiple Cars not working 1 Answer

How to tell if two blocks are right next to each other?(2D) 1 Answer

Can someone help me fix my Javascript for Flickering Light? 6 Answers

How to tell if 2 blocks are next to each other in a 2d game? 1 Answer

Setting Scroll View Width GUILayout 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