示例#1
0
 public Target(Target otherTarget)
 {
     this.gameObject     = otherTarget.gameObject;
     this.transform      = otherTarget.transform;
     this.targetable     = otherTarget.targetable;
     this.targetTracker  = otherTarget.targetTracker;
     this.fireController = otherTarget.fireController;
     this.projectile     = otherTarget.projectile;
 }
        private void Awake()
        {
            this.tracker = this.GetComponent<TargetTracker>();
            this.fireCtrl = this.GetComponent<FireController>();

            this.tracker.AddOnPostSortDelegate(this.FilterTrackerTargetList);

            if (this.fireCtrl != null)
                this.fireCtrl.AddOnPreFireDelegate(this.FilterFireTargetList);
        }
示例#3
0
 private void Awake()
 {
     this.tracker  = base.GetComponent <TargetTracker>();
     this.fireCtrl = base.GetComponent <FireController>();
     this.tracker.AddOnPostSortDelegate(new TargetTracker.OnPostSortDelegate(this.FilterTrackerTargetList));
     if (this.fireCtrl != null)
     {
         this.fireCtrl.AddOnPreFireDelegate(new FireController.OnPreFireDelegate(this.FilterFireTargetList));
     }
 }
示例#4
0
        private void RegisterFireController()
        {
            FireController component = base.GetComponent <FireController>();

            if (component == null)
            {
                return;
            }
            component.AddOnStartDelegate(new FireController.OnStartDelegate(this.OnStartDelegate));
            component.AddOnUpdateDelegate(new FireController.OnUpdateDelegate(this.OnUpdateDelegate));
            component.AddOnTargetUpdateDelegate(new FireController.OnTargetUpdateDelegate(this.OnTargetUpdateDelegate));
            component.AddOnIdleUpdateDelegate(new FireController.OnIdleUpdateDelegate(this.OnIdleUpdateDelegate));
            component.AddOnFireDelegate(new FireController.OnFireDelegate(this.OnFireDelegate));
            component.AddOnStopDelegate(new FireController.OnStopDelegate(this.OnStopDelegate));
        }
示例#5
0
 public Target(Transform transform, TargetTracker targetTracker)
 {
     this.gameObject    = transform.gameObject;
     this.transform     = transform;
     this.targetable    = this.transform.GetComponent <Targetable>();
     this.targetTracker = targetTracker;
     if (targetTracker is Projectile)
     {
         this.projectile = (Projectile)targetTracker;
     }
     else
     {
         this.projectile = null;
     }
     this.fireController = null;
 }
        public Target(Transform transform, TargetTracker targetTracker)
        {
            this.gameObject = transform.gameObject;
            this.transform  = transform;
            this.targetable = this.transform.GetComponent <Targetable>();

            this.targetTracker = targetTracker;

            // The targetTracker arg could also be a projectile because it is derrived
            //   from a TargetTracker
            if (targetTracker is Projectile)
            {
                this.projectile = (Projectile)targetTracker;
            }
            else
            {
                this.projectile = null;
            }

            this.fireController = null;
        }
示例#7
0
 public void SetOnUpdateDelegate(FireController.OnUpdateDelegate del)
 {
     this.onUpdateDelegates = del;
 }
示例#8
0
 public void SetOnStopDelegate(FireController.OnStopDelegate del)
 {
     this.onStopDelegates = del;
 }
示例#9
0
 public void RemoveOnUpdateDelegate(FireController.OnUpdateDelegate del)
 {
     this.onUpdateDelegates = (FireController.OnUpdateDelegate)Delegate.Remove(this.onUpdateDelegates, del);
 }
示例#10
0
 public void AddOnUpdateDelegate(FireController.OnUpdateDelegate del)
 {
     this.onUpdateDelegates = (FireController.OnUpdateDelegate)Delegate.Combine(this.onUpdateDelegates, del);
 }