Photon UNITY c# script for PUN asset update notification

MT3MT3
edited October 2015 in Tutorials and Code Sharing
Greetings!

I felt I wanted an update feature for PUN similar to the UNITY "update available" message. I would like to share it in case anyone else might like this feature. It uses concepts that could serve a number of purposes, like grabbing a scoreboard from the internet once a day.

It is implemented in a single script that should be added to an object in your games "lobby scene" so that PUN is active.

It uses the WWW object to read the current release from the PUN thread on the UNITY web site.

It employs PlayerPrefs to facilitate a "once a day" notification via a legacy GUI window (for backward compatibility).

The script only works while running your app in the Unity editor and will not function (or malfunction) in compiled builds.

I'm an old school programmer and probably didn't structure this script or comment as well as could have been done... so I'm hoping someone might find it entertaining to improve on this (especially my brute force parsing) and enlighten us all to a better way. I also hope I've not committed a transgression with the way I've posted the script :s

Hope you enjoy.

using UnityEngine;

Comments

  • Nice!
    Do you mind fixing the formatting? Wrap the script in "code" tags or upload the .cs file as attachment?
  • Sorry I just don't see any way to upload the script :(

    Usually, the script will self-format if pasted into a script while in Monodevelop... not much but maybe it'll help?
Sign In or Register to comment.