Hi, im triying to create a editor that whenever i press the button it takes the position from the target and add it to a array list, but i cant make that the array list do a plus , there is my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(CameraFollow))]
public class MaxPosEditor : Editor {
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
CameraFollow camera = (CameraFollow)target;
if (GUILayout.Button("SelectPosition"))
{
camera.maxPosLvl.SetValue();
int currentpos = camera.maxPosLvl.Length - 1;
camera.maxPosLvl[currentpos] = camera.transform.position.x;
}
}
}