Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- [System.Serializable]
- public class MyClass {
- public string myString; //Must be the first declared varible, this will allow name on array and lists
- public int myInt;
- public float myFloat;
- public GameObject myGO;
- public Transform myTransform;
- }
- [System.Serializable]
- public class MyOtherClass {
- public string myOtherString;
- public int myOtherInt;
- public float myOtherFloat;
- public GameObject myOtherGO;
- public Transform myOtherTransform;
- }
- [SelectionBase]
- public class Example : MonoBehaviour {
- [Header("Example Class")]
- [Range (-50, 50)]
- public int blockedInt;
- public GameObject someGO;
- [Space(10)]
- //Will add some space on the inspector
- public List <MyClass> myClass;
- public MyOtherClass[] myOtherClass;
- private Dictionary <string, MyClass> items;
- [ContextMenu ("Do Something")]
- void Hue () {
- print ("Sucefully");
- }
- void Start () {
- items = new Dictionary <string , MyClass> ();
- for (int i = 0; i < myClass.Count; i ++){
- items.Add (myClass[i].myString, myClass[i]);
- }
- }
- void Update () {
- bool myBool = true;
- //This will change bool value
- myBool ^= true;
- }
- void Reset () {
- //Called every time script is reseted by the inspector
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement