when i need to use my own classes? when i need to use unity scripting api classes? why i have create my own classes?how can i know which class i need to use? How can I identify the functionality of each class so that I can choose?how i can create my own class? when I type my class, it never exist before like unity script api class.
using System;
using UnityEngine;
public class Car {
}
class ‘car’ never exist before.
if i type:
using System;
using UnityEngine;
public class Car : MonoBehavior {
}
class ‘car’ already exist in unity scripting api document. can anybody give me some document and book about use classes in unity?
some have UnityEngine.xxx have enumerations, Interfaces, Attributes. what is enumerations? what is Interfaces? what is Attributes?
I have no clue what you are really asking.
If you want to attach a script to an object in the scene, you need to inherit from monobehavior. This allows it to run stuff like Update, Start, Awake, etc.
If you don’t add MonoBehavior, you can still use it just like you would a c# class.
Now, beyond that…a lot of your questions make me think you need to start on some beginner tutorials. Either with c# or with Unity’s tutorials…
how class connect to class? public class ArenaVortex : Trigger
public class Car : Monobehavior
what do you know and understand about Trigger ( my own class ) ? what do you know and understand about Monobehavior ( unity api )?why have to put 2 or 3 class on 1 line? what does it mean?
You need to learn about object oriented programming and C# fundamentals if you want to understand all of this.
The ArenaVortex : Trigger relationship you mention is called inheritance. ArenaVortex is the child, Trigger is the parent.
public class Car : Monobehavior
how classes working? is Monobehavior is a class? normal in c# it is another class.why have to put 2 or 3 class on 1 line? what does it mean? how see visual how class connect? Example what is ‘classes’ like?
Yes, MonoBehaviour is a class. It is defined in the UnityEngine DLL. Any script which will be attached to an object should inherit from MonoBehaviour, that way Unity will know about it.
i think when need to use a classes in unity scripting api library, we type Monobehavior in
public class Car : Monobehavior
what does it mean in other way than a class?
how to use classes in unity scripting api? what i should type?