Beispiel #1
0
        public void SetupRenderList(Hansel pHansel, Gretel pGretel)
        {
            RenderList.Clear();
            RenderList.AddRange(InteractiveObjects);
            RenderList.AddRange(Collectables);
            RenderList.AddRange(Enemies);
            RenderList.Add(pHansel);
            RenderList.Add(pGretel);
            //Brunnen Overlay hinzufügen
            foreach (InteractiveObject iObj in InteractiveObjects)
            {
                if (iObj.ActivityId == Activity.UseWell)
                {
                    InteractiveObject wellOverlay = InteractiveObjectDataManager.Instance.GetElementByString("wellOverlay");
                    wellOverlay.SkeletonPosition = iObj.SkeletonPosition + new Vector2(-100, 300);
                    wellOverlay.ApplySettings();
                    RenderList.Add(wellOverlay);
                }
            }

            List <InteractiveObject> del = new List <InteractiveObject>();

            foreach (InteractiveObject iObj in RenderList)
            {
                if (iObj.Name.Contains("jump") || iObj.Name.Contains("slip"))
                {
                    del.Add(iObj);
                }
            }

            foreach (InteractiveObject iObj in del)
            {
                RenderList.Remove(iObj);
            }
        }
Beispiel #2
0
        //Brunnen-Overlay ein-/ausblenden
        public static void SetWellOverlay(Vector2 pWellPosition, bool pVisible, ref List <InteractiveObject> pRenderList)
        {
            InteractiveObject wellOverlay = InteractiveObjectDataManager.Instance.GetElementByString("wellOverlay");             //BrunnenOverlay-iObjName und PositionOffset muss auch in SceneData.SetupRenderList() gesetzt werden.

            if (pVisible && !pRenderList.Contains(wellOverlay))
            {
                pRenderList.Add(wellOverlay);
                wellOverlay.SkeletonPosition = pWellPosition + new Vector2(-100, 300);
                wellOverlay.ApplySettings();
            }
            else if (!pVisible && pRenderList.Contains(wellOverlay))
            {
                pRenderList.Remove(wellOverlay);
            }
        }