Hi,
Indeed, this is a bold script to turn into an action if you are new to c#.
Typically, this is too much for a custom action. Instead you should keep this as a monobehavior and control it from PlayMaker.
Instead of doing the job in "awake" do it in a a Public function that you can then call using "sendMessage" action for example.
The two difficulties you are facing with this script to port as Custom action are:
-- Coroutine don't work inside Custom Actions, only in Monobehavior
-- the legacy UI isn't ideal within Custom Action. I strongly suggest you switch to the new Unity UI or ngui and the likes.
Bye,
Jean
Bye,
Jean