Exemplo n.º 1
0
 private void Start()
 {
     if (weakObject == null)
     {
         weakObject = GetComponentInParent <WeakObject>();
     }
 }
Exemplo n.º 2
0
        static public bool IsDead(this WeakObject item)
        {
            if (item.IsAlive() == false)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 3
0
                int IEqualityComparer <T> .GetHashCode(T obj)
                {
                    WeakObject <T> wobj = obj as WeakObject <T>;

                    if (wobj != null)
                    {
                        return(wobj.GetHashCode());
                    }

                    return((obj == null) ? 0 : obj.GetHashCode());
                }
Exemplo n.º 4
0
                bool IEqualityComparer <T> .Equals(T x, T y)
                {
                    WeakObject <T> wx = x as WeakObject <T>;

                    if (wx != null)
                    {
                        x = wx.Target;
                    }

                    WeakObject <T> wy = y as WeakObject <T>;

                    if (wy != null)
                    {
                        y = wy.Target;
                    }

                    return(Object.Equals(x, y));
                }
Exemplo n.º 5
0
 public void Initialize(GameObject obj)
 {
     Owner = new WeakObject<GameObject>(obj);
     index = obj.Index;
 }