Ejemplo n.º 1
0
Archivo: Gun.cs Proyecto: benrosen/RTS
 void Start()
 {
     targetingManager = GetComponent<TargetingManager> ();
     intervalManager = GetComponent<IntervalManager> ();
     proximityManager = GetComponent<ProximityManager> ();
     lastIntervalStartTime = Time.time;
     lastFireTime = 1000000000;
 }
    /// <summary>
    /// Helper function that ensures there is an instance of ProximityTrigger alongside the specified component.
    /// </summary>

    static ProximityManager GetInstance(Component mb)
    {
        ProximityManager pro = mb.GetComponent <ProximityManager>();

        if (pro == null)
        {
            pro = mb.gameObject.AddComponent <ProximityManager>();
        }
        return(pro);
    }
    /// <summary>
    /// Add a new exit event listener.
    /// </summary>

    static public void AddOnExit(Component mb, OnTriggerCallback callback)
    {
        ProximityManager pro = GetInstance(mb);

        foreach (TriggerListener p in pro.mOnExit)
        {
            if (p.mb == mb && p.callback == callback)
            {
                return;
            }
        }

        TriggerListener ent = new TriggerListener();

        ent.mb       = mb;
        ent.callback = callback;
        pro.mOnExit.Add(ent);
    }
    /// <summary>
    /// Add a new fixed update listener.
    /// </summary>

    static public void AddOnUpdate(Component mb, OnUpdateCallback callback)
    {
        ProximityManager pro = GetInstance(mb);

        foreach (UpdateListener p in pro.mOnUpdate)
        {
            if (p.mb == mb && p.callback == callback)
            {
                return;
            }
        }

        UpdateListener ent = new UpdateListener();

        ent.mb       = mb;
        ent.callback = callback;
        pro.mOnUpdate.Add(ent);
    }
Ejemplo n.º 5
0
 void Start()
 {
     proximityManager = GetComponent<ProximityManager> ();
 }
 void Start()
 {
     mTrans = transform;
     ProximityManager.AddOnUpdate(this, OnUpdate);
 }
Ejemplo n.º 7
0
 void Start()
 {
     mFaction = Tools.FindInParents <GameFaction>(transform);
     ProximityManager.AddOnUpdate(this, OnUpdate);
 }
Ejemplo n.º 8
0
 void Start()
 {
     intervalManager = GetComponent<IntervalManager> ();
     proximityManager = GetComponent<ProximityManager> ();
     lastIntervalStartTime = Time.time;
 }
Ejemplo n.º 9
0
 public void AuthorizationChanged(ProximityManager manager, bool authorization)
 {
 }
Ejemplo n.º 10
0
 public void LocationChanged(ProximityManager manager, GameTableLocation location)
 {
     this.gameBrowser?.Refresh();
 }