Exemple #1
0
            internal bool Despawn(SpawnedObjectController cntrl)
            {
                if (!_activeInstances.Remove(cntrl))
                {
                    return(false);
                }

                cntrl.SetDespawned();
                cntrl.transform.parent        = _owner.transform;
                cntrl.transform.localPosition = Vector3.zero;
                cntrl.transform.rotation      = Quaternion.identity;

                _instances.Add(cntrl);
                return(true);
            }
Exemple #2
0
            internal void Despawn(SpawnedObjectController obj)
            {
                if (!_activeInstances.Contains(obj))
                {
                    return;
                }

                _activeInstances.Remove(obj);

                obj.SetDespawned();
                obj.transform.parent        = _owner.transform;
                obj.transform.localPosition = Vector3.zero;
                obj.transform.rotation      = Quaternion.identity;

                _instances.Add(obj);
            }