Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Full Inspector: Inspector and serialization for structs, dicts, generics, interfaces

Discussion in 'Assets and Asset Store' started by sient, Jan 23, 2014.

  1. nikkolas-golesh

    nikkolas-golesh

    Joined:
    May 3, 2015
    Posts:
    4
    Thanks. Yes, we do call base.Awake().

    We think the problem may have to do with some data being held about the behavior on Full Inspector or Unity's side that we can't seem to clear.
     
  2. Remiel

    Remiel

    Joined:
    Oct 17, 2012
    Posts:
    103
    Try resetting meta data from context menu in the inspector of the behaviour (click on the little cogwheel icon). I had some problems that were cleared by doing that so it might help you too.
     
  3. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Can you send me a build that reproduces this issue? If not, what does the behavior code look like? Does a reimport-all fix the issue? Do you have a custom editor defined for the behavior type?

    Thanks
     
  4. Vorren

    Vorren

    Joined:
    Oct 24, 2014
    Posts:
    19
    Hey sient,
    can you please implement ReadOnly attribute? It would be really useful :)
     
  5. Remiel

    Remiel

    Joined:
    Oct 17, 2012
    Posts:
    103
    You already have [InspectorDisabled] which draws the inspector with a disabled GUI, so that the user cannot interact with it.
     
  6. nikkolas-golesh

    nikkolas-golesh

    Joined:
    May 3, 2015
    Posts:
    4
    We haven't been able to reproduce the bug under other conditions yet. We have tried to reimport-all and that does not fix the issue. We do not use a custom editor for this behavior, but I have created one and removed it as a test to try and get full inspector to work with it. Interestingly, when I do create a custom editor for the class it doesn't seem to recognize it and still tries to serialize the behavior with the default inspector. It seems to us that maybe there is a meta file or some data being sorted about the class name, maybe on Unity's side, that is preventing Full Inspector from serializing the behavior properly.

    Here is the offending behavior:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4.  
    5. public class ProjectileLauncherController : WeaponController
    6. {
    7.   public AudioClip shotSound;
    8.   [Tooltip("Check if you want the shot sound to play once every time the gun is fired" +
    9.     ". Otherwise, the sound will only play if the last sound has finished playing.")]
    10.   public bool playSoundPerShot = true;
    11.  
    12.   [System.Serializable]
    13.   public class MuzzleBreak
    14.   {
    15.     public GameObject bullet;
    16.     public GameObject effect;
    17.     public string boneName;
    18.  
    19.     [HideInInspector] public GameObject boneNode;
    20.     [HideInInspector] public FiringBehavior firingBehavior;
    21.     [HideInInspector] public ObjectPool bulletPool;
    22.     [HideInInspector] public ObjectPool firingEffectPool;
    23.     [HideInInspector] public PooledObject effectinst;
    24.   }
    25.  
    26.   public MuzzleBreak[] Muzzles;
    27.  
    28.  
    29.   //[Tooltip("Number of seconds to wait after a shot before firing again")]
    30.   public float delayBetweenActivates = 1.0f;
    31.   public float shootTimerVariationMin = 0.0f;
    32.   public float shootTimerVariationMax = 0.3f;
    33.   public float delayBetweenEachMuzzle = 0.0f;
    34.  
    35.   private Coroutine m_shootCoroutine;
    36.  
    37.   protected float shotTimer;
    38.   protected float shotDelay;
    39.   private float shotTimerVariation;
    40.   protected Animator anim_;
    41.   protected UnitController unitController_;
    42.   private FiringBehavior m_firingBehavior;
    43.   protected FiringBehavior.FiringDetails m_firingDetails;
    44.  
    45.   /*!*****************************************************************************
    46.   * PreInit: Called once upon object creation in scene
    47.   *******************************************************************************/
    48.   public override void PreInit()
    49.   {
    50.     base.PreInit();
    51.  
    52.     m_firingDetails = new FiringBehavior.FiringDetails();
    53.   }
    54.  
    55.   /*!*****************************************************************************
    56.   * PostInit: Called once, but after all objects have initialized themselves,
    57.   * use this to get components from other objects
    58.   *******************************************************************************/
    59.   public override void PostInit()
    60.   {
    61.     base.PostInit();
    62.    
    63.     //Get the firing behavior component
    64.     m_firingBehavior = GetComponent<FiringBehavior>();
    65.  
    66.     foreach( MuzzleBreak muzzle in Muzzles )
    67.     {
    68.       muzzle.firingBehavior = m_firingBehavior;
    69.       SetupBoneObjectPair( muzzle.boneName, ref muzzle.boneNode );
    70.      
    71.       muzzle.bulletPool = ObjectPoolManager.GetObjectPool( muzzle.bullet.name );
    72.       muzzle.firingEffectPool = ObjectPoolManager.GetObjectPool( muzzle.effect.name );
    73.       muzzle.effectinst = null;
    74.     }
    75.   }
    76.  
    77.   /*!*****************************************************************************
    78.   * OnRuntimeCreation: Called every time the object is enabled (created), use
    79.   * this to initialize data that needs to be set every time the object is enabled
    80.   *******************************************************************************/
    81.   public override void OnRuntimeCreation()
    82.   {
    83.     base.OnRuntimeCreation();
    84.  
    85.     shotTimerVariation = Random.Range( shootTimerVariationMin * 1000, shootTimerVariationMax * 1000 ) / 1000.0f;
    86.  
    87.     m_shootCoroutine = null;
    88.   }
    89.  
    90.   /*!*****************************************************************************
    91.   * OnRuntimeDestruction: Called every time the object is disabled (destroyed), use
    92.   * this to un-initialize data that needs to be reset every time the object is disabled
    93.   ****************************************************************************** */
    94.   public override void OnRuntimeDestruction()
    95.   {
    96.     base.OnRuntimeDestruction();
    97.   }
    98.  
    99.   /*!*****************************************************************************
    100.   * OnFinalDestruction: Called only once when the object is completely destroyed
    101.   * from the scene. (Rarely used)
    102.   ****************************************************************************** */
    103.   public override void OnFinalDestruction()
    104.   {
    105.     base.OnFinalDestruction();
    106.   }
    107.  
    108.   /*!*****************************************************************************
    109.    * prepare_for_death: detach any currently attached effects so they can die out gracefully
    110.   *******************************************************************************/
    111.   public void prepare_for_death()
    112.   {
    113.     //Remove all children effects from each muzzle break
    114.     for( int i = 0; i < Muzzles.Length; ++i )
    115.     {
    116.       //All children of muzzle break are effects so just detach all children
    117.       Transform muzzleTrans = Muzzles[ i ].boneNode.transform;
    118.       muzzleTrans.DetachChildren();
    119.     }
    120.   }
    121.  
    122.   /*!*****************************************************************************
    123.   * Init:
    124.   ****************************************************************************** */
    125.   public override void Init( GameObject own )
    126.   {
    127.     base.Init( own );
    128.  
    129.     m_firingBehavior.Owner = own;
    130.  
    131.     anim_ = owner.GetComponentInChildren<Animator>();
    132.  
    133.     unitController_ = owner.GetComponent<UnitController>();
    134.  
    135.     shotDelay = delayBetweenActivates;
    136.     shotTimer = shotDelay;
    137.   }
    138.  
    139.   /*!*****************************************************************************
    140.    * OnActivate: set the delegate
    141.   *******************************************************************************/
    142.   public override void OnActivate(Transform target)
    143.   {
    144.     base.OnActivate(target);
    145.  
    146.   }
    147.  
    148.   /*!*****************************************************************************
    149.    * OnDeactivate: set the delegate
    150.   *******************************************************************************/
    151.   public override void OnDeactivate()
    152.   {
    153.     base.OnDeactivate();
    154.  
    155.     foreach( MuzzleBreak muzzle in Muzzles )
    156.     {
    157.       if (muzzle.effectinst != null)
    158.       {
    159.         muzzle.effectinst.Destroy();
    160.         muzzle.effectinst = null;
    161.       }
    162.     }
    163.    
    164.     //End firing behaviors that are lasting too long
    165.     m_firingBehavior.EndFire();
    166.   }
    167.  
    168.   /*!*****************************************************************************
    169.    * InactiveUpdate: Do nothing while the weapon is inactive
    170.   *******************************************************************************/
    171.   public override void InactiveUpdate()
    172.   {
    173.     shotTimer += Time.deltaTime;
    174.   }
    175.  
    176.   /*!*****************************************************************************
    177.    * ActiveUpdate: Shoot the gun while active based on the fire rate
    178.   *******************************************************************************/
    179.   public override void ActiveUpdate()
    180.   {  
    181.     UpdateShooting();
    182.   }
    183.  
    184.   /*!*****************************************************************************
    185.    * UpdateShooting:
    186.   *******************************************************************************/
    187.   public virtual void UpdateShooting()
    188.   {  
    189.     if( shotTimer >= ( shotDelay + shotTimerVariation ) )
    190.     {
    191.       //if they have an aim scree, make sure it's actually aiming at the target before shooting
    192.       if( m_aiming != null )
    193.       {
    194.         if( m_aiming.IsAimingAtTarget() )
    195.         {
    196.           shotTimer = 0.0f;
    197.           anim_.SetTrigger( attachedBoneNodeIndex );
    198.         }
    199.       }
    200.     }
    201.     else
    202.     {
    203.       shotTimer += Time.deltaTime;
    204.     }
    205.   }
    206.  
    207.   /*!*****************************************************************************
    208.    * BeginShooting: starts shooting
    209.   *******************************************************************************/
    210.   public virtual void BeginShooting( bool hasFired = true )
    211.   {
    212.       //begin shooting can be sent as a message from an animator, thus it may arrive after we are already
    213.       //done firing the gun. We need to ensure that the weapon is active
    214.     if (delUpdate != ActiveUpdate)
    215.     {
    216.       return;
    217.     }
    218.  
    219.     //since this is a message response, sometimes the unit will die right after the animation message is sent.
    220.     //If so, the object will be returned to the pool and this function will still run.
    221.     if( gameObject.activeSelf == false )
    222.     {
    223.       return;
    224.     }
    225.  
    226.     //Get next shot timer variation
    227.     shotTimerVariation = Random.Range( shootTimerVariationMin * 1000, shootTimerVariationMax * 1000 ) / 1000.0f;
    228.  
    229.     bHasFired = hasFired;
    230.    
    231.     Shoot();
    232.   }
    233.  
    234.   /*!*****************************************************************************
    235.    * Shoot: Shoots all bullets from ejection ports and creates muzze flashes
    236.   *******************************************************************************/
    237.   public virtual void Shoot( bool playSound = true )
    238.   {
    239.     if( m_shootCoroutine != null )
    240.     {
    241.       StopCoroutine( m_shootCoroutine );
    242.  
    243.         //End firing behaviors that are lasting too long before firing another round
    244.       m_firingBehavior.EndFire();
    245.     }
    246.  
    247.     m_shootCoroutine = StartCoroutine( crtShoot() );
    248.   }
    249.  
    250.   /*!*****************************************************************************
    251.    * Shoot: Shoots all bullets from ejection ports and creates muzze flashes
    252.   *******************************************************************************/
    253.   IEnumerator crtShoot()
    254.   {
    255.     foreach( MuzzleBreak muzzle in Muzzles )
    256.     {
    257.       FireBullet( muzzle );
    258.       yield return new WaitForSeconds( delayBetweenEachMuzzle );
    259.     }
    260.  
    261.     m_shootCoroutine = null;
    262.   }
    263.  
    264.   /*!*****************************************************************************
    265.    * Shoot: Instantiates and apply motion to a single projectile
    266.   *******************************************************************************/
    267.   void FireBullet( MuzzleBreak muzzle )
    268.   {
    269.     //either play a one shot, or wait for the last sound to finish
    270.     if( playSoundPerShot )
    271.     {
    272.       m_audioPlayer.PlayImmediate(shotSound);
    273.     }
    274.     else
    275.     {
    276.       m_audioPlayer.PlayAttempt(shotSound);
    277.     }
    278.  
    279.     if (muzzle.effectinst != null)
    280.     {
    281.       muzzle.effectinst.Destroy();
    282.       muzzle.effectinst = null;
    283.     }
    284.  
    285.       // create muzzle effect
    286.     Transform muzzleTrans = muzzle.boneNode.transform;
    287.     muzzle.effectinst = muzzle.firingEffectPool.CreateInstance( muzzleTrans.position, muzzleTrans.forward );
    288.     muzzle.effectinst.transform.parent = muzzle.boneNode.transform;
    289.  
    290.     //get the layer that this weapon is attached to and offset it by the damage layer amount
    291.     //so if it was attached to a friendly, it would become a friendly_damageobject
    292.     m_firingBehavior.projLayer = transform.parent.gameObject.layer + LayerIDs.DAMAGEOBJ_OFFSET;
    293.  
    294.     m_firingDetails.bulletPool = muzzle.bulletPool;
    295.  
    296.     if(m_targetTrans == null)
    297.     {
    298.       m_firingDetails.target = null;
    299.     }
    300.     else
    301.     {
    302.       m_firingDetails.target = m_targetTrans.gameObject;
    303.     }
    304.  
    305.     m_firingDetails.muzzle = muzzle.boneNode.transform;
    306.     m_firingDetails.bulletDamage = Mathf.RoundToInt( m_statDamage.Value );
    307.     m_firingDetails.owner = owner;
    308.     m_firingDetails.totalShotTime = ( shotDelay + shotTimerVariation );
    309.     m_firingDetails.muzzleEffect = muzzle.effectinst;
    310.     m_firingDetails.shotSound = shotSound;
    311.     m_firingDetails.velocityMax = muzzle.firingBehavior.muzzleVelocity;
    312.  
    313.     m_firingBehavior.Fire( m_firingDetails );
    314.   }
    315.  
    316.   /*!*****************************************************************************
    317.    * SetupBoneObjectPairs: attaches the bone node game object by finding it by name
    318.   *******************************************************************************/
    319.   void SetupBoneObjectPair( string boneName, ref GameObject boneNode )
    320.   {
    321.     boneNode = MyUtility.FindNodeInChild( gameObject, boneName );
    322.    
    323.     if( boneNode == null )
    324.     {
    325.       Debug.LogError( "Bone node:" + boneName + "Was not found!" );
    326.     }
    327.   }
    328. }
    and the base:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class WeaponController : MonoBehaviorExtension<WeaponController>
    5. {
    6.   [SerializeField] private string m_audioPlayerName = "weapon";
    7.   protected MyAudioPlayer m_audioPlayer;
    8.   public MyAudioPlayer AudioPlayer
    9.   {
    10.     get { return m_audioPlayer; }
    11.   }
    12.  
    13.   public bool bAllowFleeing = false;
    14.  
    15.   [Tooltip("How close does a unit need to be for them to flee")]
    16.   [ShowIfBool("bAllowFleeing", true)]
    17.   public float fleeDistance = 0.0f;
    18.  
    19.   [Tooltip("While fleeing, how much space do they need to create from their target before they stop fleeing." +
    20.     "This should be larger than the flee distance, otherwise the unit will constantly" +
    21.     "Switch between fleeing and not fleeing repeatedly")]
    22.   [ShowIfBool("bAllowFleeing", true)]
    23.   public float fleeCancelDistance = 1.0f;
    24.  
    25.   [HideInInspector] public GameObject owner;
    26.  
    27.         //the weapon's target if applicable
    28.     protected Transform m_targetTrans;
    29.   public Transform TargetTransform
    30.   {
    31.     get { return m_targetTrans; }
    32.     set { m_transform = value; }
    33.   }
    34.  
    35.         //switch out the function we're using for the weapon while active and inactive
    36.     protected delegate void DelUpdate();
    37.  
    38.     protected DelUpdate delUpdate;
    39.  
    40.   [HideInInspector]
    41.   public bool bHasFired;
    42.  
    43.   [HideInInspector]
    44.   public int attachedBoneNodeIndex;
    45.  
    46.   protected StatsManager m_weaponStatsManager;
    47.  
    48.   protected Aiming m_aiming;
    49.  
    50.   protected Stat m_statAttackDist;
    51.   public Stat Stat_AttackDist
    52.   {
    53.     get { return m_statAttackDist; }
    54.   }
    55.  
    56.   protected Stat m_statAttackDistMin;
    57.   public Stat Stat_AttackDistMin
    58.   {
    59.     get { return m_statAttackDistMin; }
    60.   }
    61.  
    62.   protected Stat m_statAttackDistMax;
    63.   public Stat Stat_AttackDistMax
    64.   {
    65.     get { return m_statAttackDistMax; }
    66.   }
    67.  
    68.  
    69.   protected Stat m_statDamage;
    70.  
    71.  
    72.   /*!*****************************************************************************
    73.   * PreInit: Called once upon object creation in scene
    74.   *******************************************************************************/
    75.   public override void PreInit()
    76.   {
    77.     bHasFired = false;
    78.     owner = null;
    79.     delUpdate = InactiveUpdate;
    80.   }
    81.  
    82.   /*!*****************************************************************************
    83.   * PostInit: Called once, but after all objects have initialized themselves,
    84.   * use this to get components from other objects
    85.   *******************************************************************************/
    86.   public override void PostInit()
    87.   {
    88.     m_audioPlayer = GetComponent<AudioPlayers>().GetPlayer(m_audioPlayerName);
    89.  
    90.     m_weaponStatsManager = GetComponent<StatsManager>();
    91.  
    92.     m_statDamage = m_weaponStatsManager.GetStat(eStatType.Damage);
    93.     m_statAttackDist = m_weaponStatsManager.GetStat(eStatType.AttackDistance);
    94.     m_statAttackDistMin = m_weaponStatsManager.GetStat(eStatType.AttackDistanceMin);
    95.     m_statAttackDistMax = m_weaponStatsManager.GetStat(eStatType.AttackDistanceMax);
    96.   }
    97.  
    98.   /*!*****************************************************************************
    99.   * OnRuntimeCreation: Called every time the object is enabled (created), use
    100.   * this to initialize data that needs to be set every time the object is enabled
    101.   *******************************************************************************/
    102.   public override void OnRuntimeCreation()
    103.   {
    104.     delUpdate = InactiveUpdate;
    105.     bHasFired = false;
    106.   }
    107.  
    108.   /*!*****************************************************************************
    109.   * OnRuntimeDestruction: Called every time the object is disabled (destroyed), use
    110.   * this to un-initialize data that needs to be reset every time the object is disabled
    111.   ****************************************************************************** */
    112.   public override void OnRuntimeDestruction()
    113.   {
    114.     owner = null;
    115.  
    116.     if (delUpdate == ActiveUpdate)
    117.     {
    118.       OnDeactivate();
    119.     }
    120.  
    121.     delUpdate = InactiveUpdate;
    122.   }
    123.  
    124.   /*!*****************************************************************************
    125.   * OnFinalDestruction: Called only once when the object is completely destroyed
    126.   * from the scene. (Rarely used)
    127.   ****************************************************************************** */
    128.   public override void OnFinalDestruction()
    129.   {
    130.    
    131.   }
    132.  
    133.   /*!*****************************************************************************
    134.   * Init:
    135.   ****************************************************************************** */
    136.   public virtual void Init(GameObject own)
    137.   {
    138.     owner = own;
    139.  
    140.     m_aiming = owner.GetComponent<Aiming>();
    141.   }
    142.  
    143.     /*!*****************************************************************************
    144.      * InactiveUpdate: Should be overwritten by the child (What to do while inactive)
    145.     *******************************************************************************/
    146.     public virtual void InactiveUpdate()
    147.     {
    148.     }
    149.  
    150.     /*!*****************************************************************************
    151.      * ActiveUpdate: Should be overwritten by the child (What to do while active)
    152.     *******************************************************************************/
    153.     public virtual void ActiveUpdate()
    154.     {
    155.       //if the active update wasn't overwritten, assume the weapon has been used
    156.     bHasFired = true;
    157.     }
    158.  
    159.     /*!*****************************************************************************
    160.      * Update: just reroute to the delegate update
    161.     *******************************************************************************/
    162.     public void Update()
    163.     {
    164.  
    165.     if (delUpdate != null)
    166.       delUpdate();
    167.     else
    168.     {
    169.       Debug.Log("Delegate is null");
    170.     }
    171.     }
    172.  
    173.     /*!*****************************************************************************
    174.      * OnActivate: set the delegate
    175.     *******************************************************************************/
    176.     public virtual void OnActivate(Transform target)
    177.     {
    178.     bHasFired = false;
    179.  
    180.         delUpdate = ActiveUpdate;
    181.  
    182.     m_targetTrans = target;
    183.     }
    184.  
    185.     /*!*****************************************************************************
    186.      * OnDeactivate: set the delegate
    187.     *******************************************************************************/
    188.     public virtual void OnDeactivate()
    189.     {
    190.     bHasFired = false;
    191.  
    192.         delUpdate = InactiveUpdate;
    193.     }
    194.  
    195.   /*!*****************************************************************************
    196.    * IsReady: Is the weapon currently ready to fire
    197.   *******************************************************************************/
    198.   public virtual bool IsReady()
    199.   {
    200.     return true;
    201.   }
    202. }
    MonoBehaviorExtension derives from BaseBehavior<FullSerializerSerializer>.

    Copying this code into a different behavior with a different name will serialize properly. Other classes deriving from WeaponController serialize properly also.
     
  7. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    +1, thanks.
     
  8. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    There are a bunch of references to other things, but nothing in there is extremely unusual - nothing stands out to me like it should cause any errors. If you do find a way to reproduce the issue, I'll try to get it fixed ASAP. Thanks.
     
  9. Vorren

    Vorren

    Joined:
    Oct 24, 2014
    Posts:
    19
    Hey sient,

    I was implementing an ObservableCollection from the later version of .net that is currently available in unity and I came across a pretty weird (meaning potentially suboptimal) behavior:

    Your ListAdaptor's DrawItem changes the index of _list every frame to the result of _itemDrawer() function. This caused my collection to spwan onchange events even when the index haven't really changed. I fixed this with a simple check, but I think that this check should also be performed in ListAdaptor, so that we don't call the [] operator if there is no need to (that operator can be overriden and there is no guessing what kind of evil could be happening there :) )

    So, long story short, here's my updated code:
    ListAdaptor.cs

    Code (CSharp):
    1.  public virtual void DrawItem(Rect position, int index) {
    2.             // Rotorz seems to sometimes give an index of -1, not sure why.
    3.             if (index < 0) {
    4.                 return;
    5.             }
    6.  
    7.             var metadata = _metadata.Enter(index);
    8.             fiGraphMetadataCallbacks.ListMetadataCallback(metadata.Metadata, fiGraphMetadataCallbacks.Cast(_list), index);
    9.  
    10.             var newItemInIndex = _itemDrawer(position, _list[index], metadata);
    11.             var itemInIndex = _list[index];
    12.  
    13.             if(itemInIndex == null || itemInIndex.Equals(newItemInIndex)){
    14.                 _list[index] = newItemInIndex;
    15.             }
    16.         }
     
  10. blindgoat

    blindgoat

    Joined:
    Oct 24, 2012
    Posts:
    31
    @sient Thanks again for all you're doing with FS.

    You fixed a bug for me earlier with this fix.

    We are running into basically the same issue as before, except instead of a single TestItem in our save file, we have an array. This gives us the same issue as before; items marked as [fsIgnore] are being wiped on deserialize.

    Old code:
    Code (CSharp):
    1. public class MySaveFile : BaseSaveFile
    2. {
    3.     public TestItem testItem;
    4. }
    New code:
    Code (CSharp):
    1. public class MySaveFile : BaseSaveFile
    2. {
    3.     public TestItem[] testItem;
    4. }
    The rest of the code is the exact same as before. Here is an example project, using the latest version of FS (e428bd669d1704a9bb686e69674db689348e5c8f) from github, and Unity 5.0.1f1.

    Open Main scene, look at TestSaveFile in the Project view and notice the "IgnoreString" variable has a value of "ISSUE HERE". Once you run the project, it serializes the data, then deserializes it back into the same object, changing the value of the "IgnoreString".
     
    Last edited: May 10, 2015
  11. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Ok, I've added the check, but I think you mean to have

    if(itemInIndex == null || itemInIndex.Equals(newItemInIndex) == false){

    I ended up changing the method to:

    Code (csharp):
    1. public virtual void DrawItem(Rect position, int index) {
    2.             // Rotorz seems to sometimes give an index of -1, not sure why.
    3.             if (index < 0) {
    4.                 return;
    5.             }
    6.  
    7.             var metadata = _metadata.Enter(index);
    8.             fiGraphMetadataCallbacks.ListMetadataCallback(metadata.Metadata, fiGraphMetadataCallbacks.Cast(_list), index);
    9.  
    10.             var updatedItem = _itemDrawer(position, _list[index], metadata);
    11.             var existingItem = _list[index];
    12.  
    13.             if (existingItem == null ||
    14.                 existingItem.Equals(updatedItem) == false) {
    15.                 _list[index] = updatedItem;
    16.             }
    17.         }
     
  12. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Please check this commit and let me know if the issue has been fixed.

    Thanks!
     
  13. JoeProgram

    JoeProgram

    Joined:
    Aug 24, 2012
    Posts:
    5
    I'm attempting to build an empty WebGL project with only FullInspector imported, and am receiving the error during compile.

    Failed running python "/Applications/Unity/Unity.app/Contents/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc" -Oz -std=c++11 -Wno-unused-value -Wno-invalid-offsetof -I-I"/Users/jfrance/dev/prototypes/empty/EmptyProject/Assets/../Temp/StagingArea/Data/Libraries/bdwgc/include" -I"/Users/jfrance/dev/prototypes/empty/EmptyProject/Assets/../Temp/StagingArea/Data/Libraries/libil2cpp/include" -I"/Users/jfrance/dev/prototypes/empty/EmptyProject/Assets/../Temp/StagingArea/Data/il2cppOutput" -nostdinc -DIL2CPP_EXCEPTION_DISABLED=1 -c @"/var/folders/hs/mxq34c097bvf61xw4vhjjync0000gn/T/tmp65ffef12.tmp"

    WARNING root: [33m-I or -L of an absolute path "-I/Users/jfrance/dev/prototypes/empty/EmptyProject/Assets/../Temp/StagingArea/Data/Libraries/libil2cpp/include" encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript). Pass '-Wno-warn-absolute-paths' to emcc to hide this warning.[0m
    /Users/jfrance/dev/prototypes/empty/EmptyProject/Assets/../Temp/StagingArea/Data/il2cppOutput/Bulk_Generics_109.cpp:852:1: warning: control may reach end of non-void function [-Wreturn-type]
    }
    ^
    /Users/jfrance/dev/prototypes/empty/EmptyProject/Assets/../Temp/StagingArea/Data/il2cppOutput/Bulk_Generics_109.cpp:979:1: warning: control may reach end of non-void function [-Wreturn-type]
    }
    ^
    /Users/jfrance/dev/prototypes/empty/EmptyProject/Assets/../Temp/StagingArea/Data/il2cppOutput/Bulk_Generics_109.cpp:1383:1: warning: control may reach end of non-void function [-Wreturn-type]
    }
    ^
    /Users/jfrance/dev/prototypes/empty/EmptyProject/Assets/../Temp/StagingArea/Data/il2cppOutput/Bulk_Generics_109.cpp:1510:1: warning: control may reach end of non-void function [-Wreturn-type]
    }
    ^
    /Users/jfrance/dev/prototypes/empty/EmptyProject/Assets/../Temp/StagingArea/Data/il2cppOutput/Bulk_Generics_109.cpp:1937:1: warning: control may reach end of non-void function [-Wreturn-type]
    }
    ^
    /Users/jfrance/dev/prototypes/empty/EmptyProject/Assets/../Temp/StagingArea/Data/il2cppOutput/Bulk_Generics_109.cpp:2064:1: warning: control may reach end of non-void function [-Wreturn-type]
    }
    ^
    /Users/jfrance/dev/prototypes/empty/EmptyProject/Assets/../Temp/StagingArea/Data/il2cppOutput/Bulk_Generics_109.cpp:2454:1: warning: control may reach end of non-void function [-Wreturn-type]
    }
    ^
    /Users/jfrance/dev/prototypes/empty/EmptyProject/Assets/../Temp/StagingArea/Data/il2cppOutput/Bulk_Generics_109.cpp:2581:1: warning: control may reach end of non-void function [-Wreturn-type]
    }
    ^
    8 warnings generated.
    /Users/jfrance/dev/prototypes/empty/EmptyProject/Assets/../Temp/StagingArea/Data/il2cppOutput/Bulk_Generics_25.cpp:265:10: fatal error: 't15278MD.h' file not found
    #include "t15278MD.h"
    ^
    1 error generated.
    ERROR root: [31mcompiler frontend failed to generate LLVM bitcode, halting[0m
     
    Last edited: May 13, 2015
  14. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Strange, FI should definitely be building in WebGL. I've reported a bug in il2cpp for the tk, where a custom tk editor will cause a compile failure. The current workaround is to wrap custom tk editors in #if UNITY_EDITOR ifdefs.

    A couple questions:
    - What version of Unity are you using?
    - Have you removed all serializers except Full Serializer?

    What version of FI are you on? Would you mind fully zipping up the project and sending it to me (in a private message)?
     
  15. zee_ola05

    zee_ola05

    Joined:
    Feb 2, 2014
    Posts:
    166
    Hi @sient
    Is there a way to only serialize properties in the derived class? For some reason, I have to make my class derive from Unity.Object but I don't want properties from that class to be serialized. I'm using JsonDotNet serializer.
     
  16. zee_ola05

    zee_ola05

    Joined:
    Feb 2, 2014
    Posts:
    166
    I guess i have to mark my class with:
    [JsonObject(MemberSerialization.OptIn)]
    then manually set which properties i'd wanna be serialized with:
    [JsonProperty]

    Do I understand it correctly?
     
  17. JoeProgram

    JoeProgram

    Joined:
    Aug 24, 2012
    Posts:
    5
    Hi @sient ,
    1. I'm on Unity 5.0.2
    2. I'm on Full Serializer v2.6.1
    3. I hadn't removed all serializers except FS. I gave that a shot, but I'm still getting the same error.
    4. I'm zipping up the project and will send it to your shortly.
    Thanks!
     
  18. jrhee

    jrhee

    Joined:
    Dec 5, 2013
    Posts:
    74
    Hi sient,

    Is it possible to use a base class that inherits from BaseBehavior, rather than inheriting from BaseBehavior directly? I saw in the docs that changing CommonBaseBehavior to inherit from a custom base class rather than Monobehaviour is possible, but when I tried that and changed my child classes to inherit from BaseBehavior, I don't see the FI behavior in the inspector.

    Cheers,
    John
     
  19. jrhee

    jrhee

    Joined:
    Dec 5, 2013
    Posts:
    74
    Ah nevermind- I was using a custom editor. Switched it to derive from CommonBaseBehaviorEditor and all's working as expected.
     
  20. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    You don't want to serialize the properties when it is an instance of the base class, but you *do* want to serialize them when it is an instance of a derived class? Right now conditional serialization is not supported in the Base* derived classes right now, but you can get it to work if you have a non-Base class that uses the Json.NET serializer. You then use the Json.NET "ShouldSerialize" methods/annotations and only serialize if this.GetType() != typeof(BaseType).

    Please let me know if I understood correctly - if so, I'll add a work item for conditional serialization in Base* derived types.
     
  21. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Ha, okay. No worries
     
  22. JoeProgram

    JoeProgram

    Joined:
    Aug 24, 2012
    Posts:
    5
    Hi sient -

    I tried sending you a private message that contained the project zip, but I couldn't attach a file. Is there a different way you'd like me to send the project to you?
     
  23. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Is there a way to have InspectorCategory and InspectorButton in the same inspector? For example, I'd like to have a button at the top of the inspector using InspectorOrder(0), and then have the InspectorCategory tabs underneath it.

    As of now, when using InspectorCategory, the button simply disappears. The button works correctly with InspectorDatabaseEditor however.

    Thanks.
     
  24. psxcode

    psxcode

    Joined:
    Jan 26, 2014
    Posts:
    26
    FullInspector has normal performance in Editor mode. When my collection has 200 elements performance drops to 5-10 fps. And it was ok. But when I entered Play mode and tried to edit - the performance was fast REALLY FAST.
    I cannot believe it. 5 fps to 60 when I enter Play mode.
    Interesting what can cause this performance drop in Editor mode.
     
  25. jrhee

    jrhee

    Joined:
    Dec 5, 2013
    Posts:
    74
    Just curious- is there a difference in performance or other disadvantage between using fiValue for a Dictionary in a Monobehavior vs inheriting from BaseBehavior? My main need for FI is inspecting/serializing Dictionaries, but want to avoid the overhead of converting my existing custom editors, attribute editors, Awake overrides, etc.

    Another note- which version of the docs should we be using?
    http://jacobdufault.github.io/fullinspector/assets/docs/
    http://jacobdufault.github.io/fullinspector/guide/

    Seems like the latter's more recent, but is missing parts from the former- would be nice not to have to read through both looking for answers while getting up to speed :)
     
  26. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Yep, thanks! Got the PM with the link.
     
  27. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Unfortunately this style of customization isn't easily feasible using attributes. I'd recommend writing a tk editor for this case.

    You can make the button appear by adding an [InspectorCategory] annotation to it as well.
     
  28. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Oh! Thanks! This is a perf regression with the new serialization system - I'll try to get it fixed tomorrow. In-editor should also be running really fast (the core issue is that when you're in the editor and you change something in the inspector, the entire object is serialized, which does not happen in play-mode).
     
  29. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    If the main need is for just dictionaries, then I'd recommend going through the fiValue approach. The overhead for fiValue should be lower than the Base* types, since FI itself does not have to invoke reflection (whereas the Base* types have to use reflection to assign the deserialized values to the class members).

    If you do not need to serialize dictionaries, then you should also see if fiInspectorOnly will work for you. It has zero overhead.

    /guide/ are the newer docs - they should contain just about all of the information from the old ones. What have you had to search for in the old docs? As a tip, all of the inspector-related methods start with Inspector* so you can use code-completion to discover all of them.
     
    rakkarage likes this.
  30. psxcode

    psxcode

    Joined:
    Jan 26, 2014
    Posts:
    26
    Thanks. Also note that when I just scroll(not changing) the collection list down I have 5fps responce.
     
  31. jrhee

    jrhee

    Joined:
    Dec 5, 2013
    Posts:
    74
    Ok thanks! Just checking- there's no way simple way to avoid having to reference fiValue contents through FIValueDerivedClass.Value? Or at least hide Value parent label in inspector?

    Most of what I was looking for relates to custom attributes/editors. Code completion was useful for seeing what attributes are packaged in with FI, but was getting stuck figuring out how to convert to AttributePropertyEditor.
     
  32. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    any progress on dragging and dropping groups of files?
     
    Last edited: May 22, 2015
  33. blindgoat

    blindgoat

    Joined:
    Oct 24, 2012
    Posts:
    31
    Sient,

    Thanks for the efforts! I can now load data into an existing list. It doesn't work with an existing array, however. I can use lists for now, but thought you would like to know that if I switch from List<MyObject> to MyObject[], the same issue occurs as before.
     
  34. Vorren

    Vorren

    Joined:
    Oct 24, 2014
    Posts:
    19
    Hey Sient,

    Could you expose BaseCollectionPropertyEditor for better expansion?
    My suggestion is to change:
    Code (CSharp):
    1. private readonly PropertyEditorChain _addItemEditor;
    2.        
    to something like this:
    Code (CSharp):
    1. private PropertyChainEditor _addItemEditor;
    2. protected PropertyEditorChain AddItemEditor{
    3.             get{
    4.                 return _addItemEditor;
    5.             }
    6.             set{
    7.                 _addItemEditor = value;
    8.             }
    9.         }
    This will enable your library users to create more powerful Collection gui's, such as, for example, a list editor that allows to add items from another list.
     
  35. Vorren

    Vorren

    Joined:
    Oct 24, 2014
    Posts:
    19
    Actually, in continuation:
    how to implement an editor for a list to which you can only add elements of another list?
     
  36. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    I have an optimization for this implemented which should hopefully give a dramatic speedup, but it isn't quite stable enough. I'll push out a release to the asset store as soon as the remaining issues are fixed. PM me if you want the (buggy) build now.
     
  37. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Well, if you want to avoid the Value stuff, you can derive from BaseObject - though since you're just using a dictionary you will have to create a wrapper type again.

    If you have a more specific question about AttributePropertyEditor I'd be happy to answer.
     
  38. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Sorry, not at the moment :(. I'll try to work on it this weekend. I assume you are referencing this issue.
     
  39. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Okay, I've created an issue here. It may be a bit before I fix this once since List<T> supports partial deserialization.
     
  40. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    You can currently customize the AddItemEditor via the `TAddItem` generic parameter, ie,

    BaseCollectionPropertyEditor<TActual, TCollection, TItem, TAddItem>.

    Just pass in the type you want to use for adding the item. For example, the dictionary property editor is implemented as:

    public class IDictionaryPropertyEditor<TActual, TKey, TValue> : BaseCollectionPropertyEditor<TActual, IDictionary<TKey, TValue>, KeyValuePair<TKey, TValue>, TKey>

    Do you need something more flexible?


    This is a really tricky issue right now, since there isn't good support for accessing the parent element inside of a property editor. Your best bet is to probably write a custom editor or a tk editor. I can try to give you some more direction if you'd like.
     
  41. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    I found the source of the issues, but unfortunately it means that Unity 4 will not be receiving the optimization. Unity 5 is nice and fast though! I plan to push a build sometime this weekend, probably Saturday or Sunday. PM me for a build now.
     
  42. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    https://github.com/jacobdufault/fullinspector/issues/110

    actually this one i think,. it is a feature that is in the default inspector but not in full inspector?
    how can we populate a list with thousands of items? one by one?
    cannot drag em all?
    thanks
     
  43. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Just a heads-up that with the 5.1 beta, there are two warnings in the console:

    Assets/FullInspector2/Core/Editor/fiEditorWindowUtility.cs(40,20): warning CS0618: `UnityEditor.EditorWindow.title' is obsolete: `Use titleContent instead (it supports setting a title icon as well).'

    Assets/FullInspector2/Modules/Common/Editor/TypeSelectionPopupWindow.cs(17,20): warning CS0618: `UnityEditor.EditorWindow.title' is obsolete: `Use titleContent instead (it supports setting a title icon as well).'
     
  44. Illusive-S

    Illusive-S

    Joined:
    Sep 19, 2013
    Posts:
    8
    Hello there, i recently bought FI and i have encountered this little thing called SharedInstance.
    I am wondering if there is a way to copy it some way for each object using it? I love the fact that i can have a prefab of data but as the game begins i want to have separate instances for each SharedInstance user
     
  45. mrleerman

    mrleerman

    Joined:
    Jul 15, 2014
    Posts:
    3
    I seem to be experiencing some trouble using FI 2.6.1's fiValue in Unity 4.6.5f1. Is this combination supported? If so, using fiValue doesn't seem to work. I was receiving some very strange errors (InvalidCastException) when I tried to start using fiValue to hold a List<someinterface> and have been trying to track down the culprit. I upgraded from an FI 2.6 beta hoping that was the problem to no avail. I swapped from a List to a Dictionary like the example in the docs, no love. Finally I tried just using fiValue to hold an int. Still no go. After rev-ing from Unity 4.6.2 to 4.6.5 with still no resolution I'm at my wits end.

    Here's what I have for a repro:
    1. I created a brand new project.
    2. I updated my FI through the asset store (eventually actually deleted it locally and redownloaded just to make sure). Verified store gave me FI 2.6.1 via changelog file.
    3. Set FullSerializer to the default and removed the others.
    4. I made a very simple component:
      Code (CSharp):
      1. using FullInspector;
      2. using System;
      3. using UnityEngine;
      4.  
      5. namespace FITest
      6. {
      7.     [Serializable]
      8.     public class FIInt : fiValue<int> { }
      9.  
      10.     public class FITester : MonoBehaviour
      11.     {
      12.         public FIInt someNum;
      13.     }
      14. }
    5. I added this component to an otherwise empty GameObject in a scene.
    When I open the FITester component in the Inspector I get this warning:
    Caught exception when reading property Value with context=0; returning default value for int
    UnityEngine.Debug:LogWarning(Object)
    FullInspector.InspectedProperty:Read(Object) (at Assets/FullInspector2/Core/Utility/InspectedProperty.cs:178)
    FullInspector.Internal.fiEditorGUI:EditPropertyHeight(Object, InspectedProperty, fiGraphMetadataChild) (at Assets/FullInspector2/Core/Editor/fiEditorGUI.cs:350)
    FullInspector.Internal.ReflectedPropertyEditor:GetElementHeight(GUIContent, Object, fiGraphMetadata) (at Assets/FullInspector2/Core/Editor/PropertyEditors/ReflectedPropertyEditor.cs:415)
    FullInspector.PropertyEditorExtensions:GetElementHeight(IPropertyEditor, GUIContent, Object, fiGraphMetadataChild) (at Assets/FullInspector2/Core/Editor/IPropertyEditorExtensions.cs:240)
    FullInspector.fiValuePropertyDrawer:GetPropertyHeight(SerializedProperty, GUIContent) (at Assets/FullInspector2/Modules/fiValue/Editor/fiValuePropertyDrawer.cs:59)
    UnityEditor.Editor:OnInspectorGUI()
    FullInspector.Internal.fiInspectorOnly_MonoBehaviourEditor:OnInspectorGUI() (at Assets/FullInspector2/Core/Editor/fiInspectorOnly_MonoBehaviourEditor.cs:18)
    UnityEditor.DockArea:OnGUI()

    Followed by this error:
    ArgumentException: Field 'Value' defined on type 'fiValue`1' is not a field on the target object which is of type 'Int32'.
    System.Reflection.MonoField.GetValue (System.Object obj) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoField.cs:110)
    FullInspector.InspectedProperty.Read (System.Object context) (at Assets/FullInspector2/Core/Utility/InspectedProperty.cs:174)
    UnityEngine.Debug:LogException(Exception)
    FullInspector.InspectedProperty:Read(Object) (at Assets/FullInspector2/Core/Utility/InspectedProperty.cs:181)
    FullInspector.Internal.fiEditorGUI:EditPropertyHeight(Object, InspectedProperty, fiGraphMetadataChild) (at Assets/FullInspector2/Core/Editor/fiEditorGUI.cs:350)
    FullInspector.Internal.ReflectedPropertyEditor:GetElementHeight(GUIContent, Object, fiGraphMetadata) (at Assets/FullInspector2/Core/Editor/PropertyEditors/ReflectedPropertyEditor.cs:415)
    FullInspector.PropertyEditorExtensions:GetElementHeight(IPropertyEditor, GUIContent, Object, fiGraphMetadataChild) (at Assets/FullInspector2/Core/Editor/IPropertyEditorExtensions.cs:240)
    FullInspector.fiValuePropertyDrawer:GetPropertyHeight(SerializedProperty, GUIContent) (at Assets/FullInspector2/Modules/fiValue/Editor/fiValuePropertyDrawer.cs:59)
    UnityEditor.Editor:OnInspectorGUI()
    FullInspector.Internal.fiInspectorOnly_MonoBehaviourEditor:OnInspectorGUI() (at Assets/FullInspector2/Core/Editor/fiInspectorOnly_MonoBehaviourEditor.cs:18)
    UnityEditor.DockArea:OnGUI()

    Like I mentioned earlier, swapping to an fiValue wrapped Dictionary like in the docs gets me a different error and no warning:
    InvalidCastException: Cannot cast from source type to destination type.
    FullInspector.fiValue`1[T].FullInspector.Internal.fiIValueProxyAPI.set_Value (System.Object value) (at Assets/FullInspector2/Modules/fiValue/fiValue.cs:93)
    FullInspector.fiValuePropertyDrawer.OnGUI (Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Assets/FullInspector2/Modules/fiValue/Editor/fiValuePropertyDrawer.cs:39)
    UnityEditor.PropertyDrawer.OnGUISafe (Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyDrawer.cs:23)
    UnityEditor.PropertyHandler.OnGUI (Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, Boolean includeChildren) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:134)
    UnityEditor.PropertyHandler.OnGUILayout (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:195)
    UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:6079)
    UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:6073)
    UnityEditor.Editor.DoDrawDefaultInspector (UnityEditor.SerializedObject obj) (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:325)
    UnityEditor.Editor.DoDrawDefaultInspector () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:335)
    UnityEditor.Editor.DrawDefaultInspector () (at C:/buildslave/unity/build/artifacts/EditorGenerated/EditorBindings.cs:232)
    UnityEditor.Editor.OnInspectorGUI () (at C:/buildslave/unity/build/artifacts/EditorGenerated/EditorBindings.cs:236)
    FullInspector.Internal.fiInspectorOnly_MonoBehaviourEditor.OnInspectorGUI () (at Assets/FullInspector2/Core/Editor/fiInspectorOnly_MonoBehaviourEditor.cs:18)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1094)
    UnityEditor.DockArea:OnGUI()

    Thoughts?
     
    Last edited: May 31, 2015
  46. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Done, I will PM you a build.
     
  47. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Thanks, looks like they introduced the API in 5.1 and immediately deprecated the old one :/. I don't have 5.1 installed ATM but I'll get this fixed when I do.
     
  48. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    I think UnityEngine.Object.Instantiate should work, but let me know if for some reason it doesn't.
     
  49. sient

    sient

    Joined:
    Aug 9, 2013
    Posts:
    602
    Looks like fiValue doesn't work inside of namespaces. It uses a property drawer + Unity's serializedObject API. serializedObject.type does not include the namespace inside of the type, which means we cannot support namespaces + fiValue until the additional information is exposed :(. Sorry about that!
     
  50. psxcode

    psxcode

    Joined:
    Jan 26, 2014
    Posts:
    26
    Hi. Noticed an issue in the issue about performance.
    FI 2.6.1 on Unity 4.6.5f1.
    When I inspect some GameObject and it has quite long property list,
    and Im not changing anything, the inspector is just displayed - Unity eats full one hardware thread.
    When I release object the CPU meter drops to zero.
    It looks like FI is refreshing or changing something, while user does not interact with Unity.

    Edit.
    When I inspect an object with not so long property list, the CPU consumption is not a full thread.
    So it is proportional to properties amount.
    But still eating CPU while I do not interact with UNITY
     
    Last edited: Jun 1, 2015