playMaker

Author Topic: Calling function in script - Screenshot 360 [SOLVED]  (Read 3441 times)

PolyMad

  • Hero Member
  • *****
  • Posts: 553
Calling function in script - Screenshot 360 [SOLVED]
« on: May 03, 2020, 09:12:06 AM »
I got this script that I would call at the pression of a key:

https://github.com/yasirkula/Unity360ScreenshotCapture/#example-code

But I can't add the script to an object because Unity says that the "script class can't be abstract".
« Last Edit: May 09, 2020, 11:02:29 AM by PolyMad »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Calling function in script
« Reply #1 on: May 03, 2020, 10:58:57 AM »
Hi.
Best is to ask the author

PolyMad

  • Hero Member
  • *****
  • Posts: 553
Re: Calling function in script
« Reply #2 on: May 03, 2020, 11:36:58 AM »
Uhhh but it's a simple script... he doesn't know how Playmaker works.
I think this is a Playmaker setup, no?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Calling function in script
« Reply #3 on: May 03, 2020, 03:12:05 PM »
Hi.
Adding script to an object has nothing to do with playmaker :)

The script has also a get key down where you can change the keycode if you wish.

Did you import the package?

PolyMad

  • Hero Member
  • *****
  • Posts: 553
Re: Calling function in script
« Reply #4 on: May 03, 2020, 03:15:54 PM »
Yes I imported it.
But what I wanted to do was to call it from Playmaker, but have all the rest managed by Playmaker, included the keypress.
So I would exclude the keypress from the script, and just call the screenshot function after a keypress call from Playmaker.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Calling function in script
« Reply #5 on: May 04, 2020, 04:36:01 AM »
Hi.
best way is to make a custom action.

here's a video on making custom actions :


Else you can use 'Call Method' action,
but then you would potentially also need to use 'Linker Wizard'

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Calling function in script
« Reply #6 on: May 04, 2020, 06:20:09 AM »
Hi.
I had a little extra time today, so i went ahead and made action for this.

You do not need to put any component only install the asset.

Then add the package in the attachment below and look for the 'I360 capture' action.

on the action you can set image width and if you set to 0 or higher thant 8192 it will show a error on the action itself.

default it saves as png, but you can set checkbox 'Save As JPEG' to save as jpeg file.

for Face camera direction, i am not sure what the difference will be, but the asset has this option so i added this as well.

Save name will be the name of the file, do not include Extension (.jpg/.png)

if Overwrite Existing File is Checked it will overwrite the existing file.

for filepath you can set your own file path (or make a setup so player can select directory to save.
if set to none it will use the persistentDataPath

you can optionally select a camera, if none, it will use the main camera.

the file exists event will be triggered IF Overwrite Existing File is not Checked and the file already exists.


PolyMad

  • Hero Member
  • *****
  • Posts: 553
Re: Calling function in script
« Reply #7 on: May 04, 2020, 12:13:32 PM »
Wow! Thank you very very much, man!
This will help me greatly in promotion (I hope).

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Calling function in script
« Reply #8 on: May 04, 2020, 02:20:15 PM »
Hi,
Not sure what you mean by promotion.
But happy to help :)

PolyMad

  • Hero Member
  • *****
  • Posts: 553
Re: Calling function in script
« Reply #9 on: May 04, 2020, 02:56:35 PM »
Taking snapshots to show off my project in the devlog  :D

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Calling function in script
« Reply #10 on: May 05, 2020, 07:20:58 AM »
Hi.
Oh that kind of promotion :D

i was thinking you would get a promotion on your job lol :)

PolyMad

  • Hero Member
  • *****
  • Posts: 553
Re: Calling function in script
« Reply #11 on: May 09, 2020, 07:29:44 AM »
Hi again.
I think the action is working, but I can't find WHERE the screenshots are saved.
I'm trying to save them to C: but there seem to be no way to find them.
I'm almost sure the action is working, because I also send different event if an existing screenshot is found, and there's a micro pause when I hit the button to take the screenshot, so the action is being definitely passed, but where the hellllllll??!?!?!?!?

ch1ky3n

  • Full Member
  • ***
  • Posts: 208
Re: Calling function in script
« Reply #12 on: May 09, 2020, 10:53:46 AM »
user/appdata/localow/<yourcompanyname>
maybe ?


PolyMad

  • Hero Member
  • *****
  • Posts: 553
Re: Calling function in script
« Reply #13 on: May 09, 2020, 10:58:19 AM »
Yeah it's there, I was looking right now, and with a search on C: with windows, I found it.

But then the path field does not work somehow: I tried to input a straight path taken from the Windows Explorer window, and that should work.
Tried with just C: didn't work too.
Don't know what's the problem here.
« Last Edit: May 09, 2020, 12:27:16 PM by PolyMad »