C# Class tk2dButton, Malisse

Inheritance: MonoBehaviour
Mostra file Open project: Collegiennes/Malisse Class Usage Examples

Public Properties

Property Type Description
buttonDownSound UnityEngine.AudioClip
buttonDownSprite string
buttonPressedSound UnityEngine.AudioClip
buttonPressedSprite string
buttonUpSound UnityEngine.AudioClip
buttonUpSprite string
messageName string
pressedWaitTime float
scaleTime float
targetObject GameObject
targetScale float
viewCamera Camera

Public Methods

Method Description
OnEnable ( ) : void
PlaySound ( AudioClip source ) : void
Start ( ) : void
Update ( ) : void
UpdateSpriteIds ( ) : void

Call this when the sprite names have changed

Private Methods

Method Description
LocalWaitForSeconds ( float seconds ) : IEnumerator
coHandleButtonPress ( int fingerId ) : IEnumerator
coScale ( Vector3 defaultScale, float startScale, float endScale ) : IEnumerator

Method Details

OnEnable() public method

public OnEnable ( ) : void
return void

PlaySound() public method

public PlaySound ( AudioClip source ) : void
source UnityEngine.AudioClip
return void

Start() public method

public Start ( ) : void
return void

Update() public method

public Update ( ) : void
return void

UpdateSpriteIds() public method

Call this when the sprite names have changed
public UpdateSpriteIds ( ) : void
return void

Property Details

buttonDownSound public_oe property

Audio clip to play when the button transitions from up to down state. Requires an AudioSource component to be attached to work.
public AudioClip,UnityEngine buttonDownSound
return UnityEngine.AudioClip

buttonDownSprite public_oe property

The button down sprite. This is resolved by name from the sprite collection of the sprite component.
public string buttonDownSprite
return string

buttonPressedSound public_oe property

Audio clip to play when the button is pressed. Requires an AudioSource component to be attached to work.
public AudioClip,UnityEngine buttonPressedSound
return UnityEngine.AudioClip

buttonPressedSprite public_oe property

The button pressed sprite. This is resolved by name from the sprite collection of the sprite component.
public string buttonPressedSprite
return string

buttonUpSound public_oe property

Audio clip to play when the button transitions from down to up state. Requires an AudioSource component to be attached to work.
public AudioClip,UnityEngine buttonUpSound
return UnityEngine.AudioClip

buttonUpSprite public_oe property

The button up sprite. This is resolved by name from the sprite collection of the sprite component.
public string buttonUpSprite
return string

messageName public_oe property

The message to send to the object. This should be the name of the method which needs to be called.
public string messageName
return string

pressedWaitTime public_oe property

How long to wait before allowing the button to be pressed again, in seconds.
public float pressedWaitTime
return float

scaleTime public_oe property

The length of time the scale operation takes
public float scaleTime
return float

targetObject public_oe property

Target object to send the message to. The event methods below are significantly more efficient.
public GameObject targetObject
return GameObject

targetScale public_oe property

How much to scale the sprite when the button is in the down state
public float targetScale
return float

viewCamera public_oe property

The camera this button is meant to be viewed from. Set this explicitly for best performance.\n The system will automatically traverse up the hierarchy to find a camera if this is not set.\n If nothing is found, it will fall back to the active tk2dCamera.\n Failing that, it will use Camera.main.
public Camera viewCamera
return Camera