示例#1
0
        // Token: 0x06004D43 RID: 19779 RVA: 0x0019E218 File Offset: 0x0019C618
        private void OnItemPickedUp(SpawnablePickup sp)
        {
            switch (this.spawnType)
            {
            case ObjectSpawner.SpawnType.OnDespawned:
                this.timer.StopTimer();
                break;

            case ObjectSpawner.SpawnType.OnPickedUp:
                this.timer.ResetTimer();
                this.timer.StartTimer();
                break;
            }
            if (this.mLastSpawnedObject != null && this.mLastSpawnedObject.gameObject == sp.gameObject)
            {
                this.mLastSpawnedObject = null;
            }
        }
示例#2
0
        private void SetupLastSpawnedObject(GameObject spawnedObject, VRC.Player instigator)
        {
            if (this.spawnType == ObjectSpawner.SpawnType.OnTimer)
            {
                this.timer.ResetTimer();
                this.timer.StartTimer();
            }
            else
            {
                this.timer.StopTimer();
                this.timer.ResetTimer();
            }
            this.mLastSpawnedObject = spawnedObject;
            if (this.mLastSpawnedObject.GetComponent <VRC_Pickup>() != null)
            {
                SpawnablePickup spawnablePickup = spawnedObject.AddComponent <SpawnablePickup>();
                spawnablePickup.SetupSpawnedObject(this.despawnType, this.despawnTime, this.autoDespawnDistance, new Action <SpawnablePickup>(this.OnItemPickedUp), null, new Action <SpawnableObject>(this.OnItemDestroyed), this);
            }
            else
            {
                SpawnableObject spawnableObject = spawnedObject.AddComponent <SpawnableObject>();
                spawnableObject.SetupSpawnedObject(this.despawnType, this.despawnTime, this.autoDespawnDistance, new Action <SpawnableObject>(this.OnItemDestroyed), this);
            }
            VRC_DestructibleStandard component = this.mLastSpawnedObject.GetComponent <VRC_DestructibleStandard>();

            if (component != null)
            {
                this.SetupDestructibleStandard(component);
            }
            SpawnableObject component2 = spawnedObject.GetComponent <SpawnableObject>();

            this.mSpawnedObjects.Add(component2);
            if (this.onItemSpawned != null)
            {
                this.onItemSpawned(spawnedObject);
            }
            if (this.onObjectSpawnedTrigger != null && !string.IsNullOrEmpty(this.onObjectSpawnedEvent.ParameterString))
            {
                VRC_Trigger.TriggerCustom(this.onObjectSpawnedTrigger.gameObject, this.onObjectSpawnedEvent.ParameterString);
            }
        }