public void RemoveConsume(LightConsume c)
 {
     if (consumesHit.Contains(c))
     {
         consumesHit.Remove(c);
     }
 }
 public void AddConsume(LightConsume c)
 {
     if (!consumesHit.Contains(c))
     {
         consumesHit.Add(c);
     }
 }
        public virtual void Init(LightConsume c)
        {
            consume = c;
            LightConsume lightConsume = consume;

            lightConsume.lightRemoved = (Action <LightBase>)Delegate.Combine(lightConsume.lightRemoved, new Action <LightBase>(OnLightExit));
        }
Exemple #4
0
 private void Awake()
 {
     startingHeight = base.transform.localScale;
     netbody        = GetComponent <NetBody>();
     consume        = GetComponent <LightConsume>();
     rb             = GetComponent <Rigidbody>();
     startingMass   = rb.mass;
 }
 public virtual void UpdateLight(LightConsume from)
 {
     if (consumesHit.Count > 0)
     {
         foreach (LightConsume item in consumesHit)
         {
             if (from != item)
             {
                 item.Recalculate(this);
             }
         }
     }
 }