/// <summary> /// Called by Unity when the object is first activated /// </summary> protected virtual void Awake() { if (SynthesizedObject == null) { SynthesizedObject = GetComponent <SynthesizedObject>(); } }
/// <summary> /// Try to add this trait to the associated SynthesizedObject /// </summary> /// <returns>True if the trait was added successfully</returns> public bool TryAdd() { return(SynthesizedObject != null && SynthesizedObject.TryAddTrait(this)); }
/// <summary> /// Try to remove this trait from the associated SynthesizedObject /// </summary> /// <returns>True if the trait was removed successfully</returns> public bool TryRemove() { return(SynthesizedObject != null && SynthesizedObject.TryRemoveTrait(this)); }