LazyBot/Assets/Scripts/Entity/EntityController.cs
/// <summary>
/// More safe way of getting data from TargetInfo, then direct accessing through "Targets" property.
/// </summary>
/// <param name="targetType">Targets' type.</param>
/// <param name="getAllData">Is data, that wasn't got by default should be collected now.</param>
/// <returns>Container that contains all discovered targets.</returns>
More safe way of getting data from TargetInfo, then direct accessing through "Targets" property.
More safe way of getting data from TargetInfo then direct accessing through " Targets " property .
public LazyBot.Target.Data.TargetInfo.TargetContainer GetTargets(LazyBot.Target.Property.TargetTypeSO targetType, bool getAllData = true)
        {
            LazyBot.Target.Data.TargetInfo.TargetContainer targetC = _targets[targetType];
#if UNITY_EDITOR
            if (targetC == null)
            {
                Debug.LogError("There is no such target type in this entity.", this);
                return null;
            }
#endif
            if (getAllData)
            {
                foreach (var entry in targetC.Targets)
                {
                    for (int i = 0; i < entry.Value.Count; i++)
                    {
                        if (!entry.Value[i].IsFilled)
                            entry.Value[i].FillData();
                    }
                }
            }
            return targetC;
        }
public LazyBot . Target . Data . TargetInfo . TargetContainer GetTargets ( LazyBot . Target . Property . TargetTypeSO targetType , bool getAllData = true ) { LazyBot . Target . Data . TargetInfo . TargetContainer targetC = _targets [ targetType ] ; if UNITY_EDITOR if ( targetC == null ) { Debug . LogError ( " " , this ) ; return null ; } endif if ( getAllData ) { foreach ( var entry in targetC . Targets ) { for ( int i = 0 ; i < entry . Value . Count ; i ++ ) { if ( ! entry . Value [ i ] . IsFilled ) entry . Value [ i ] . FillData ( ) ; } } } return targetC ; }
More safe way of getting data from TargetInfo, then direct accessing through "Targets" property.
More safe way of getting data from TargetInfo then direct accessing through " Targets " property .
Container that contains all discovered targets.
Container that contains all discovered targets .
targetType
LazyBot.Target.Property.TargetTypeSO
None
getAllData
bool
None