Answers for "unity inheritance"

0

unity inheritance

using UnityEngine;
using System.Collections;
 
[System.Serializable]
 
public class ParentClass
{
        // Some code for things
 
}
Code (CSharp):
using UnityEngine;
using System.Collections;
 
[System.Serializable]
public class ChildClass : ParentClass
{
       //Some code to do business
 
}
Even if you want to add a new class inside the code you already have you have to do it. Example.
Code (CSharp):
using UnityEngine;
using System.Collections;
 
public class ClassYouMade : MonoBehaviour {
 
void Update() {
//code...
}
 
}
 
[System.Serializable]
public class SomethingYouMightNeed
{
 
//code...
 
}
Posted by: Guest on March-08-2021

Browse Popular Code Answers by Language