public bool AddThingToInventory(Thing thing) { if (!DEBUGSCENE) { DebugMenu.AppendDebugLine(thingName + " has picked up " + thing.thingName, this); } return(inventory.addThing(thing)); }
public void Update(float delta) { sinceLastSunUpdated += delta; // AREA OWNS THE MASTER LOCK ON ALL THINGS // lock (_allThingsLock) { foreach (Thing thing in allThings) { thing.ManualUpdate(delta); if (thing is Creature) { Creature creature = (Creature)thing; if (creature.GetCurrentState() == Creature.CREATURE_STATE.DEAD) { _removeTheseThings.Add(creature); creature.DestroyAllParts(); Debug.LogWarning("Removed a dead creature"); DebugMenu.AppendDebugLine("Removed a dead creature", creature); } } } foreach (Thing thing in _removeTheseThings) { allThings.Remove(thing); thing.gameObject.SetActive(false); thing.transform.SetParent(disabledContainer.transform); } _removeTheseThings = new List <Thing>(); } foreach (Tribe tribe in tribesPresent) { tribe.Update(); } AreaLocalTime += delta; if (sinceLastSunUpdated > updateSunEvery) { float timeOfDay = (AreaLocalTime) % dayLength; sun.rotation = Quaternion.Euler(new Vector3((timeOfDay / dayLength) * 360, 0, 0)); sinceLastSunUpdated = 0; } }