Ejemplo n.º 1
0
		protected void SetDataHolder<T, U, V>(TraitedMonoBehaviour sentObj, IDataHoldable<U, V> sentDataHolder) where T : TraitBase, IDataRetrievable<U, V>
		{
			T[] traits = sentObj.GetArray<T>();
			for (int i = 0; i < traits.Length; i++)
			{
				traits[i].DataHolder = sentDataHolder;
			}
		}
Ejemplo n.º 2
0
 private void SetTraitActions <T, U>(TraitedMonoBehaviour sentObj, Action <U> sentAction) where T : TraitBase, ISendable <U>
 {
     TraitBase[] traits = sentObj.GetArray();
     for (int i = 0; i < traits.Length; i++)
     {
         if (traits[i] is T)
         {
             T newT = (T)traits[i];
             newT.SendAction = sentAction;
         }
     }
 }
Ejemplo n.º 3
0
		protected void SetTraitFunctions<T, U, V>(TraitedMonoBehaviour sentObj, Func<U, V> sentFunc) where T : TraitBase, IReceivable<U, V>
		{
			TraitBase[] traits = sentObj.GetArray();
			for (int i = 0; i < traits.Length; i++)
			{
				if (traits[i] is T)
				{
					T newT = (T)traits[i];
					newT.ReceiveFunction = sentFunc;
				}
			}
		}