Ejemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        _collider  = GetComponent <Collider2D>();
        _spawnTime = Time.time;

        onHitDelegate += OnHit;
    }
Ejemplo n.º 2
0
 public override void OnStart()
 {
     onHitDelegate = new OnHitDelegate(OnExecute);
     if (aim.onHitDelegate == null)
     {
         aim.onHitDelegate = onHitDelegate;
     }
     else
     {
         aim.onHitDelegate += onHitDelegate;
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Removes a OnHitDelegate
 /// See docs for AddOnHitDelegate()
 /// </summary>
 /// <param name="del"></param>
 public void RemoveOnHitDelegate(OnHitDelegate del)
 {
     this.onHitDelegates -= del;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// This replaces all older delegates rather than adding a new one to the list.
 /// See docs for AddOnHitDelegate()
 /// </summary>
 /// <param name="del"></param>
 public void SetOnHitDelegate(OnHitDelegate del)
 {
     this.onHitDelegates = del;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Add a new delegate to be triggered when the target is hit.
 /// The delegate signature is:  delegate(HitEffectList effects, Target target)
 /// See IHitEffect documentation for usage of the provided 'effect'
 /// </summary>
 /// <param name="del"></param>
 public void AddOnHitDelegate(OnHitDelegate del)
 {
     this.onHitDelegates += del;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Removes a OnHitDelegate 
 /// See docs for AddOnHitDelegate()
 /// </summary>
 /// <param name="del"></param>
 public void RemoveOnHitDelegate(OnHitDelegate del)
 {
     this.onHitDelegates -= del;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// This replaces all older delegates rather than adding a new one to the list.
 /// See docs for AddOnHitDelegate()
 /// </summary>
 /// <param name="del"></param>
 public void SetOnHitDelegate(OnHitDelegate del)
 {
     this.onHitDelegates = del;
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Add a new delegate to be triggered when the target is hit.
		/// The delegate signature is:  delegate(EventInfoList eventInfoList, Target target)
		/// See EventInfoList documentation for usage.
        /// **This will only allow a delegate to be added once.**
        /// </summary>
        /// <param name="del"></param>
        public void AddOnHitDelegate(OnHitDelegate del)
        {
            this.onHitDelegates -= del;  // Cheap way to ensure unique (add only once)
            this.onHitDelegates += del;
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Add a new delegate to be triggered when the target is hit.
 /// The delegate signature is:  delegate(HitEffectList effects, Target target)
 /// See IHitEffect documentation for usage of the provided 'effect'
 /// </summary>
 /// <param name="del"></param>
 public void AddOnHitDelegate(OnHitDelegate del)
 {
     this.onHitDelegates += del;
 }
Ejemplo n.º 10
0
 /**
  * Adds an on hit callback
  */
 public void AddHitCallback(OnHitDelegate callback)
 {
     this.hitCallbacks.Add(callback);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Add a new delegate to be triggered when the target is hit.
 /// The delegate signature is:  delegate(EventInfoList eventInfoList, Target target)
 /// See EventInfoList documentation for usage.
 /// **This will only allow a delegate to be added once.**
 /// </summary>
 /// <param name="del"></param>
 public void AddOnHitDelegate(OnHitDelegate del)
 {
     this.onHitDelegates -= del;  // Cheap way to ensure unique (add only once)
     this.onHitDelegates += del;
 }