Beispiel #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;
			}
		}
Beispiel #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;
         }
     }
 }
Beispiel #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;
				}
			}
		}
Beispiel #4
0
 private void PassDelegatesToTraits(TraitedMonoBehaviour sentObj)
 {
     SetTraitActions <InstructionTrait, InstructionData[]>(sentObj, PassInstructionToManagers);
 }
Beispiel #5
0
 public override void PassDelegatesToTraits(TraitedMonoBehaviour sentObj)
 {
     SetTraitActions <UICanvasTrait, UICanvas>(sentObj, SetActiveCanvas);
 }
Beispiel #6
0
		public void RaiseTraitsFound(TraitedMonoBehaviour sentObj)
		{
			if (OnTraitsFound == null) { return; }
			OnTraitsFound(sentObj);
		}
Beispiel #7
0
		public virtual void PassDelegatesToTraits(TraitedMonoBehaviour sentObj) { }