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