예제 #1
0
 public void Construct(TargetsBase targets)
 {
     if (targets is ITargetsMovable)
     {
         m_TargetContainer = targets as ITargetsMovable;
     }
     else
     {
         Destroy(this);
     }
 }
예제 #2
0
        public void Construct()
        {
            if (m_Constructed)
            {
                return;
            }

            IFacadeBase facade = GetComponent <IFacadeBase> ();

            if (facade != null)
            {
                TargetsBase targets = facade.Targets;
                if (targets is ITargetsMovable)
                {
                    m_Targets = targets as ITargetsMovable;

                    m_Targets.MovementTarget = transform.position;
                }
            }
            m_Constructed = true;
        }
예제 #3
0
        public SheepIsCalm(
            IFacadeBase facade,
            SheepIsCalm.Settings settings
            ) : base(
                facade
                )
        {
            m_Settings      = settings;
            m_Dependencies  = new SheepIsCalm.Dependencies();
            m_CurrentFields = new SheepIsCalm.CurrentFields();

            SheepFacade sheepFac = (facade as SheepFacade);

            if (sheepFac)
            {
                m_Dependencies.Controller = sheepFac.Controller;
                m_Dependencies.Model      = sheepFac.Model;
                ITargetsMovable movable = m_Dependencies.Model.Targets as ITargetsMovable;
                if (movable != null)
                {
                    movable.MovementTarget = m_Dependencies.Model.Position + Vector3.forward;
                }
            }
        }
예제 #4
0
 // Use this for initialization
 void Start()
 {
     targets = GetComponent <IFacadeBase> ().Targets as ITargetsMovable;
 }