LogoLogo
Scripting DocsSupport
Scripting
Scripting
  • Sinespace Scripting Documentation
  • Client Scripting
    • Viewer
      • SDialogues
      • SInput
      • SShared
      • SUI
    • Network
      • SChat
      • SNetwork
      • SPhotos
      • SVideos
      • SWebService
    • Player
      • SEconomy
      • SGroup
      • SInventory
      • SProfile
      • SQuests
    • Region
      • SCameraManager
      • SGrid
      • SHost
      • SPersistence
      • SPhysics
      • SPostFX
      • SScene
      • SScript
      • SRenderSettings
    • Components
      • SAnimation
      • SAnimator
      • SAudioReactiveAnimation
      • SAudioReactiveBase
      • SAudioReactiveLight
      • SAudioReactiveMaterial
      • SAudioReactiveParticleSystem
      • SAudioReactiveTransform
      • SAudioSource
      • SBoxCollider
      • SBrowserSurface
      • SCamera
      • SCanvasGroup
      • SCapsuleCollider
      • SCharacterController
      • SClickable
      • SCloth
      • SCollider
      • SContentSizeFitter
      • SEmbeddedVideo
      • SEventCalendar
      • SFurniture
      • SGraphicRaycaster
      • SHingeJoint
      • SLight
      • SLineRenderer
      • SMeshRenderer
      • SModularVehicle
      • SNavMeshAgent
      • SNavMeshObstacle
      • SNetworking
      • SParticleSystem
      • SPlayableDirector
      • SPostProcessVolume
      • SRectTransform
      • SReflectionProbe
      • SRenderer
      • SRigidbody
      • SRoomFloor
      • SSceneBackgroundMusic
      • SScriptingData
      • SScriptingEvents
      • SScriptingResources
      • SScriptingRuntime
      • SSeat
      • SSkinnedMeshRenderer
      • SSphereCollider
      • SStateMachine
      • STerrain
      • STrailRenderer
      • SUIButton
      • SUICanvas
      • SUIDropdown
      • SUIImage
      • SUIInputField
      • SUILayout
      • SUIRawImage
      • SUIScrollbar
      • SUISlider
      • SUIText
      • SUIToggle
      • SUIToolTipHint
      • SVirtualCamera
      • SVoiceZone
    • Types
      • SAnimationState
      • SAnimatorStateInfo
      • SAvatar
      • SAvatarAppearance
      • SChatMessage
      • SColor
      • SCommandBuffer
      • SDateTime
      • SGameObject
      • SGenre
      • SGroupInfo
      • SInventoryItem
      • SJointLimits
      • SJointMotor
      • SJointSpring
      • SLandmark
      • SLayerMask
      • SMaterial
      • SMath
      • SMusicDirectory
      • SMusicStation
      • SMusicStationList
      • SNetworkMessageLua
      • SOutfit
      • SParticle
      • SPhysicsHit
      • SPublicRegion
      • SQuaternion
      • SRay
      • SRect
      • SResource
      • SScore
      • SScoreRank
      • SString
      • SSubRegion
      • STrackInfo
      • STuneIn
      • SUIRaycastResult
      • SUserRegions
      • SVector
      • SUserProfile
      • SSocialMedia
      • SWebResponse
  • Server Scripting
    • Library
      • SMath
    • Network
      • SShared
      • SWebservice
    • Region
      • SAvatar
      • SCell
      • SObject
      • SParcel
      • SParcelManager
      • SRegionScript
      • SScene
    • Storage
      • SDatabase
  • Guides
    • Persistence
    • Server Scripts
  • Sample Projects
    • Smart Lights
    • Trivia Box
  • Changelog
    • API Changelog
  • Support
    • Report An Issue
Powered by GitBook

Sinespace® is a registered trademark of Sine Wave Entertainment Ltd, All Rights Reserved.

On this page
  • Index
  • Functions Index
  • Properties Index
  • Functions
  • NextState
  • PrevState
  • SetState
  • BindToUI
  • Properties
  • Enabled
  • StateCount
  • StateNames
  • CurrentState
  • CurrentStateName
  • ComponentName
  • GameObject

Was this helpful?

Export as PDF
  1. Client Scripting
  2. Components

SStateMachine

Index

Functions Index

Function Name

Properties Index

Property Name

Functions

NextState

void NextState ()

Enter the next state

Space.Host.ExecutingObject.StateMachine.NextState()

PrevState

void PrevState ()

Space.Host.ExecutingObject.StateMachine.PrevState()

SetState

void SetState (int state) void SetState (string state)

Enters the state of being set that its order is "state"

Parameter
Type
Description

state

int

The index of the state. First state is 1.

state

string

The name of the state as set in the State Machine component.

Space.Host.ExecutingObject.StateMachine.SetState(2)
--or
Space.Host.ExecutingObject.StateMachine.SetState('A State Name')

BindToUI

The state machine will bind itself to all Toggles, Buttons, Dropdowns and Sliders on the SGameObject it is in or on a specified SGameObject.

Binding to Button : Clicking button will call NextState() Binding to Toggle: Toggle On sets State to 1, Toggle Off sets state to 2 Binding to Dropdown: Selecting will set State to that selection's caption text Binding to Slider: Moving slider changes State to slider value

Parameter
Type
Description

go

SGameObject

A specific SGameObject which this State Machine will bind to.

Space.Host.ExecutingObject.StateMachine.BindToUI()
----or
Space.Host.ExecutingObject.StateMachine.BindToUI(Space.Host.GetReference("a reference"))

Properties

Enabled

bool Enabled get set

Whether the simple state machine component is Enabled or not

Space.Host.ExecutingObject.StateMachine.Enabled = false

StateCount

int StateCount get

Total number of States.

numberOfStates = Space.Host.ExecutingObject.StateMachine.StateCount

StateNames

string[] StateNames get

A list of the names of all States.

tableStateNames = Space.Host.ExecutingObject.StateMachine.StateNames

CurrentState

int CurrentState get

The index number of the current state.

currentState = Space.Host.ExecutingObject.StateMachine.CurrentState

CurrentStateName

string CurrentStateName get

The name of the current state, or null if no state.

currentStateName = Space.Host.ExecutingObject.StateMachine.CurrentStateName

ComponentName

string ComponentName get

The name of this component.

componentName = Space.Host.ExecutingObject.StateMachine.ComponentName

GameObject

The GameObject this component is attached to. A component is always attached to a GameObject.

theGameObject = Space.Host.ExecutingObject.StateMachine.GameObject
PreviousSSphereColliderNextSTerrain

Last updated 2 years ago

Was this helpful?

void ()

void ()

void (int state) void (string state)

void () void (SGameObject go)

bool get set

int get

string[] get

int get

string get

string get

SGameObject get

void BindToUI () void BindToUI ( go)

GameObject get

SGameObject
SGameObject
NextState
PrevState
SetState
SetState
BindToUI
BindToUI
Enabled
StateCount
StateNames
CurrentState
CurrentStateName
ComponentName
GameObject