playMaker

Author Topic: Check for sprite value of none [SOLVED]  (Read 54 times)

playsteven

  • Junior Playmaker
  • **
  • Posts: 61
    • View Profile
Check for sprite value of none [SOLVED]
« on: November 14, 2017, 04:53:01 AM »
Hi,

I've got a sprite in my action and I want to check if the inputed value is none. I've tried null but that doesn't seem to work.

Currently I'm using a bool value to see if I need to change the sprite, but if I can check if the sprite is none then I don't need the bool (just tidying code a little).

Code: [Select]
public FsmBool SecondImage;
[ObjectType(typeof(UnityEngine.Sprite))]
public FsmObject SecondImageSprite;

Thanks,
Steven
« Last Edit: November 15, 2017, 07:35:39 AM by djaydino »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2254
    • View Profile
    • jinxtergames
Re: Check for sprite value of none
« Reply #1 on: November 14, 2017, 02:38:38 PM »
Hi,
Have you tried :
Code: [Select]
if(SecondImageSprite.Value == null)
if it is a required thing you can use :
Code: [Select]
[RequiredField]above the variable.

playsteven

  • Junior Playmaker
  • **
  • Posts: 61
    • View Profile
Re: Check for sprite value of none
« Reply #2 on: November 15, 2017, 03:55:17 AM »
Thanks @djaydino I thought I had tried that, but obviously I didn't  :o Can't even blame tiredness when you make mistakes in the morning!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2254
    • View Profile
    • jinxtergames
Re: Check for sprite value of none
« Reply #3 on: November 15, 2017, 07:35:23 AM »
Hi,
Coding is all about making errors :P
Anytime of the day :)