public virtual void AttractBait() { if (this.m_CurrentFishController == null) { var inRangeFishs = Physics.OverlapSphere(this.GetFitPosition(), this.m_Data.baitRange, this.m_FishLayerMask); if (inRangeFishs.Length > 0) { var random = UnityEngine.Random.Range(0, inRangeFishs.Length); var fish = inRangeFishs [random]; this.m_CurrentFishController = fish.GetComponent <CSimpleFishController> (); } } if (this.m_CurrentFishController != null) { if (this.m_CurrentFishController.GetBait() == null) { this.m_CurrentFishController.SetBait(this); } this.m_CurrentFishController.SetBaitRatio(this.m_Data.baitValue); } }
public FSMFishIdleState(IContext context) : base(context) { this.m_Controller = context as CSimpleFishController; }