コード例 #1
0
        public override void OnDelayedWorldLoadFinished()
        {
            Overwatch.Log("CleanupPlumbbobs");

            List <PlumbBob> list = new List <PlumbBob>();

            foreach (PlumbBob plumbbob in Sims3.Gameplay.Queries.GetObjects <PlumbBob>())
            {
                if (plumbbob.Charred)
                {
                    Overwatch.Log(" Uncharred");
                    plumbbob.Charred = false;
                }

                list.Add(plumbbob);
            }

            if (list.Count > 1)
            {
                RestartTask.Perform(PlumbBob.SelectedActor, list.Count);

                PlumbBob.Shutdown();

                foreach (PlumbBob plumbbob in list)
                {
                    plumbbob.Dispose();

                    // PlumbBob:Destroy() does nothing
                    //plumbbob.Destroy();

                    // GameObject:Destroy()
                    World.RemoveObjectFromObjectManager(plumbbob.ObjectId);
                    Simulator.DestroyObject(plumbbob.ObjectId);
                }
            }
        }