Click or drag to resize

ASLObject Class

ASLObject_LocalFunctions: ASLObject Partial Class containing all of the functions and variables relating to local actions - actions that affect a single player instead of all players
ASLObject: ASLObject Partial Class containing all of the functions and variables relating to server actions - actions that affect all players instead of just a single player. Use this class to communicate object information to other players. If you are looking for where to create an object for all users at runtime, check out InstantiateASLObject(String, Vector3, Quaternion) and it's other variations. You must call the functions this class provides to synchronize the called actions amongst all players. See each function's documentation for a use case example.
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          ASLASLObject

Namespace:  ASL
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
public class ASLObject : MonoBehaviour

The ASLObject type exposes the following members.

Constructors
  NameDescription
Public methodASLObject
Initializes a new instance of the ASLObject class
Top
Properties
  NameDescription
Public propertym_AnchorID
The anchor point for AR applications for this object
Public propertym_ASLGameObjectCreatedCallback
Callback to be executed after an ASL Object is instantiated - this callback is only ever executed by the creator of the object
Public propertym_ClaimCallback
Callback to be executed once a player successfully claims this object
Public propertym_ClaimCancelledRecoveryCallback
Callback to be executed when a claim is rejected
Public propertym_FloatCallback
Callback to be executed when a user passes a float value
Public propertym_Id
The unique id of this object. This id is synced with all other players
Public propertym_Mine
Flag indicating whether or not this player currently owns this object or not
Public propertym_OutstandingClaimCallbackCount
The number of outstanding claims for this object.
Public propertym_OutStandingClaims
Flag indicating whether or not there are any outstanding (not recognized by other users) claims on this object
Public propertym_PostDownloadFunction
Callback to be executed after a Texture2D download is successful
Public propertym_ReleaseFunction
Callback to be executed when an object is released. After the callback is executed, it will be set to null to prevent multiple callback's from stacking on this object after each release. To ensure you aren't attempting to execute this callback after its been set to null, make sure you always reset the callback when you obtain it if is important to have a release function of some sort
Public propertym_ResolvedCloudAnchor
Flag indicating if the cloud anchor that is attempting to be resolved has been resolved yet or not
Top
Methods
  NameDescription
Public method_LocallyRemoveClaimCallbacks
Removes any outstanding claim callbacks for this object as well as sets the outstanding claim flag to false
Public method_LocallyRemoveReleaseCallback
This function will only update the local player, not all players. Removes any release functions that may be attached to this object
Public method_LocallySetAnchorID
This function should NOT be called by the user as it will only update the local player, it will not update all players. Sets the anchor point for this ASL Object. This function is used when an incoming packet from the relay server needs to update the anchor point of this objects.
Public method_LocallySetClaim
This function should NOT be called by the user as it will only update the local player, it will not update all players. Claim the object as our own or give up the object. This function is used when an incoming packet from the relay server needs to update the claim of this objects.
Public method_LocallySetClaimCancelledRecoveryCallback
This function will only update the local player, not all players. Sets the claim cancelled recovery callback function for this object.
Public method_LocallySetCloudAnchorResolved
Locally sets the flag that allows this object to continue processing the cloud anchor
Public methodCode example_LocallySetFloatCallback
This function will only update the local player, not all players. Sets the float callback function for this object.
Public method_LocallySetGameObjectCreatedCallback
This function will only update the local player, not all players. Sets callback function that will be called upon object creation for this object.
Public method_LocallySetID
This function should NOT be called by the user as it will only update the local player, it will not update all players. Set the unique ID of this object. This function is used when an incoming packet from the relay server needs to update the id of this object, this happens when the object is created.
Public method_LocallySetPostDownloadFunction
This function will only update the local player, not all players. It sets the function to be called after an image as been downloaded from the server
Public method_LocallySetReleaseFunction
This function will only update the local player, not all players. Set the release function to be executed upon this object's release (when claim switches to false)
Private methodAwake
Function that is executed upon object initialization
Public methodCode exampleDeleteObject
Deletes this object for all users
Private methodOnDestroy
Gets called right before an object is destroyed. Used to remove this object from the dictionary
Public methodCode exampleSendAndIncrementLocalPosition
Sends and adds to the local transform of this object for all users
Public methodCode exampleSendAndIncrementLocalRotation
Sends and adds to the local rotation of this object for all users
Public methodCode exampleSendAndIncrementLocalScale
Send and add to the local scale of this object for all users
Public methodCode exampleSendAndIncrementWorldPosition
Sends and adds to the world transform of this object for all users
Public methodCode exampleSendAndIncrementWorldRotation
Sends and adds to the world rotation of this object for all users
Public methodCode exampleSendAndIncrementWorldScale
Send and add to the world scale of this object for all users. To set world scale, the object must be de-parented and then have its scale set, then re-parented. It is not advised to use this function as its behavior, especially when the parent object is rotated, can cause strange, though correct, behavior.
Public methodCode exampleSendAndSetAnchorID
Send and set the AR anchor id for this object for all users. Normally, you will not need to call this function as creating an AR Anchor is done through CreateARCoreCloudAnchor(NullablePose, ASLObject, ASLObjectPostCreateCloudAnchorFunction, Boolean, Boolean) But if for some reason you want to change Anchors, you can do so via this function
Public methodSendAndSetClaim(ASLObjectClaimCallback)
Claims an object for the user until someone steals it or the passed in claim time is reached. Changing the time you hold onto an object and deciding to reset or not the current amount of time you have held it is generally not recommended, but does have occasional applications
Public methodSendAndSetClaim(ASLObjectClaimCallback, GameLiftManagerOpFunctionCallback)
Claims an object for the user until someone steals it or the passed in claim time is reached. Changing the time you hold onto an object and deciding to reset or not the current amount of time you have held it is generally not recommended, but does have occasional applications
Public methodCode exampleSendAndSetClaim(ASLObjectClaimCallback, Int32, Boolean, GameLiftManagerOpFunctionCallback)
Claims an object for the user until someone steals it or the passed in claim time is reached. Changing the time you hold onto an object and deciding to reset or not the current amount of time you have held it is generally not recommended, but does have occasional applications
Public methodCode exampleSendAndSetLocalPosition
Sends and sets the local transform for this object for all users
Public methodCode exampleSendAndSetLocalRotation
Sends and sets the local rotation for this object for all users
Public methodCode exampleSendAndSetLocalScale
Send and set the local scale for this object for all users
Public methodCode exampleSendAndSetObjectColor
Send and sets this objects color for the user who called this function and for all other players
Public methodCode exampleSendAndSetTag
Send and set the tag for this object for all users. As Unity does not all users to create tags at runtime, all players must have this tag defined
Public methodCode exampleSendAndSetTexture2D
Sends a Texture2D to other users and then calls the sent function once it is successfully recreated
Public methodCode exampleSendAndSetWorldPosition
Sends and sets the world position for this object for all users
Public methodCode exampleSendAndSetWorldRotation
Sends and sets the world rotation for this object for all users
Public methodCode exampleSendAndSetWorldScale
Send and set the world scale for this object for all users. To set world scale, the object must be de-parented and then have its scale set, then re-parented. It is not advised to use this function as its behavior, especially when the parent object is rotated, can cause strange, though correct, behavior.
Public methodSendARPlaneAsMesh
Send and set an AR Plane's vertices on a Mesh. The Vector3 array of vertices of the AR Plane mesh to be sent to others
Public methodSendCloudAnchorToResolve
Used by ASLHelper to send information about the Cloud Anchor that was just created to all users so that they can resolve it and handle it accordingly on their end
Public methodCode exampleSendFloatArray
Send and set up to a maximum of 1000 float value(s). The float value(s) will then be processed by a user defined function. If you need to send more than 1000 floats with this object, or you need this object to perform more than one action with this function, then a switch statement is a good way to implement what you need.
Private methodStart
Function that is executed upon object start
Private methodUpdate
Currently counts down this object's claim time and releases the object back to the relay server after the specified amount of time has passed. Update is called once per frame
Top
Fields
  NameDescription
Private fieldm_ClaimReleaseTimer
How long a claim has been active on this object. This gets reset, unless otherwise specified, every time a player claims an object
Private fieldm_ClaimTime
How long a claim can be held for this object. This gets set every time a player claims an object
Private fieldm_HaventSetACloudAnchor
Flag indicating if this ASL object has been used to set/send a cloud anchor. Since cloud anchors are asynchronous, this prevents an ASL object from potentially being used set to multiple anchors and causing errors once those anchors are created
Top
See Also

Reference