public void Construct(TargetsBase targets) { if (targets is ITargetsMovable) { m_TargetContainer = targets as ITargetsMovable; } else { Destroy(this); } }
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; }
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; } } }
// Use this for initialization void Start() { targets = GetComponent <IFacadeBase> ().Targets as ITargetsMovable; }