public void UnlinkGameObject()
 {
     if (Selection.objects.Length > 0)
     {
         foreach (GameObject obj in Selection.objects)
         {
             F3DTurretConstructor cons = obj.GetComponent <F3DTurretConstructor>();
             if (cons != null)
             {
                 DestroyImmediate(cons);
             }
         }
     }
 }
 void OnEnable()
 {
     if (constructor == null)
     {
         constructor = (F3DTurretConstructor)target;
         if (IsInScene())
         {
             isInScene = true;
         }
         else
         {
             isInScene = false;
             return;
         }
         LoadDatabase();
         LoadTurretNames();
         turretIndex = constructor.turretIndex;
         UpdateFullTurret();
     }
 }
        public void UpdateFullTurret()
        {
            constructor = (F3DTurretConstructor)target;
            if (IsInScene())
            {
                isInScene = true;
            }
            else
            {
                isInScene = false;
                return;
            }
            LoadDatabase();
            LoadTurretNames();
            turretIndex = constructor.turretIndex;

            if (turrets.Count > 0)
            {
                if (turrets.Count > turretIndex)
                {
                    constructor.UpdateFullTurret(turrets[turretIndex]);
                }
            }
        }