this is the code i have so far
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
[CanEditMultipleObjects]
[CustomEditor(typeof(FakeCollider))]
public class Fake : Editor
{
public override void OnInspectorGUI()
{
DrawDefaultInspector();
EditorGUIUtility.LookLikeInspector();
EditorGUIUtility.LookLikeControls();
if (GUILayout.Button("Box Collider"))
{
}
}
}
inside the if (GUILayout.Button(“Box Collider”)) , i want to do access the FakeCollider.gameobject.addcomponant();
how do i do this .
in other words add a component to the FakeCollider?