public TriggerObject CreateShpereTrigger(Vector3 pos, float radius, System.Func <GameObject, bool> checkTrigger, System.Action callBack) { GameObject o = new GameObject("Trigger"); o.transform.SetParent(Root.transform); o.transform.position = pos; TriggerObject trigger = o.AddComponent <TriggerObject>(); trigger.SetParams(radius, checkTrigger, callBack); return(trigger); }
protected override void RegistEvent() { _triggerObject = TriggerManager.GetInstance.CreateShpereTrigger(Position, Radius, Check, TriggerEvent); }