- Home /
Question is too broad and does not target Unity specifically. Please, learn basic programming before going into game creation with Unity. Unity Answers is not designed to teach beginners how to code.
what different between my own class and unity api class?
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?
Answer by isbdnt · Jul 05, 2017 at 05:56 AM
It depends on your requirements. I recommend you to write some basic console applications instead of game before you understand what is programming.
This is a great topic, there is no way to tell you all the concepts in such place. You'd better learn c# program$$anonymous$$g at least two months.
can you give me Detail document? or please explain for me detail? how classes work? WHY I HAVE TO CREATE $$anonymous$$Y OWN CLASSES?
checkout c# Topics, your own classes are to define your custom game world, Unity scripting api just provides common functionalities among game program$$anonymous$$g like rendering models, camera view and math etc.
using System;
using UnityEngine;
public class Audio$$anonymous$$anager : $$anonymous$$onoBehaviour, CheckpointListener
{
do you what is CheckpointListener??how to use something like that?
is $$anonymous$$onoBehavior is a class? normal in c# it is another class.
Answer by kumarc123 · Jul 05, 2017 at 07:41 AM
Unity API classes are intended for most of the rendering/ physics, transformation of game objects. Depending on each game or any Unity 3D app, you'll have to design your custom classes or object models.
Unity provides with all important needs to make any kind of game.
Each game will have it's own behavior which means the game objects will have their own behaviors, which you'll have to code using Unity APIs.
it is the developer's job to design or utilize the engine features as he/she wishes. In all scenarios, there definitely exists a case where you have to write custom code for your game logic. Examples include, camera behavior, custom collision detection for updating scores etc.
As a developer you'll have to create your own custom behaviors and reuse them if needed in any game.