Beispiel #1
0
        public static HUDObject LoadFromStorage(Storage.HUDObject storageHudObject, Storage.HUD storageHud)
        {
            // Build collisionboxes, hitboxes and events from storageCharacter
            // No worries with performance here, get a copy to everything
            HUDObject hudObj = new HUDObject();

            hudObj.name     = storageHudObject.name;
            hudObj.teamId   = storageHudObject.teamId;
            hudObj.playerId = storageHudObject.playerId;
            hudObj.attackAndGrabDelegation = storageHudObject.attackAndGrabDelegation;

            // Populate events
            if (storageHudObject.events != null)
            {
                hudObj.events = new List <ConditionalEvent>(storageHudObject.events.Length);
                foreach (Storage.GenericEvent e in storageHudObject.events)
                {
                    hudObj.events.Add(ConditionalEvent.LoadFromStorage(e, storageHud));
                }
            }
            else
            {
                hudObj.events = new List <ConditionalEvent>();
            }

            return(hudObj);
        }
Beispiel #2
0
        public static HUD LoadFromStorage(string bundleName, Storage.HUD storageHud)
        {
            HUD hud = new HUD(bundleName);

            hud.rootCanvas = storageHud.mainPrefabName;

            // Populate objects
            if (storageHud.objects != null)
            {
                hud.objects = new List <HUDObject>(storageHud.objects.Length);
                foreach (Storage.HUDObject storageObject in storageHud.objects)
                {
                    hud.objects.Add(HUDObject.LoadFromStorage(storageObject, storageHud));
                }
            }
            else
            {
                hud.objects = new List <HUDObject>();
            }

            return(hud);
        }