Click or drag to resize

SetCallback_Example Class

Example of how to set a OpFunction callback
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          SimpleDemosSetCallback_Example

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

The SetCallback_Example type exposes the following members.

Constructors
  NameDescription
Private methodStatic memberSetCallback_Example
Public methodSetCallback_Example
Initializes a new instance of the SetCallback_Example class
Top
Methods
  NameDescription
Private methodStatic memberCubeCreatedCallback
InstantiateASLObject function's callback
Private methodEndOfDeletionCallback
OpFunction's callback : DeleteObject To add the very last existing position to the set, and to check if all objcest in the current iteration have finished the process (been deleted), If yes, spawns a new set of objects with the new settings.
Private methodEndOfMovementCallback
OpFunction's callback : IncrementLocalPosition To delete the given object
Private methodSetSettings
Generates a new set of settings with the given ranges.
Private methodSpawnObjects
Spawns a specific amount of objects(cubes) within specific positions. If spawning the very first set of objects, the positions are fixed, Otherwise, the positions where spawning objects are read from m_CurrentDeletionPositions and plus randomness.
Private methodStart
Game Logic
Private methodUpdate
Updates cubes' movement in the dictionary If a cube reaches its moving time limit, it will be deleted by the OpFunction callback, Otherwise, keep moving.
Top
Fields
  NameDescription
Private field_shouldRun
Boolean value for determining if a new set of cubes should be spawned.
Private field_shouldSpawn
Boolean value for determining if a new set of cubes should be spawned.
Private fieldm_CurrentAdditiveMovementAmount
Value for the addtive movement amount for this current iteration.
Private fieldm_CurrentCount
Value for number of the iterations have done.
Private fieldm_CurrentDeletionPositions
Set for storing a cube's last existing position when it is deleted.
Private fieldm_CurrentRunningLengthInSecond
Value for the running length in second for this current iteration.
Public fieldm_MaxAdditiveMovementAmount
Pre-derfined max value for movement.
Public fieldm_MaxRunningLengthInSecond
Pre-derfined max value for a cube to be deleted after this amount of moving time.
Public fieldm_MinAdditiveMovementAmount
Pre-derfined min value for movement.
Public fieldm_MinRunningLengthInSecond
Pre-derfined min value for a cube to be deleted after this amount of moving time.
Private fieldStatic memberm_MyCubesAndTimerDictionary
Dictinary for storing cubes and its moving time
Public fieldm_NumOfCubes
Pre-defined value for how many cubes to create.
Public fieldm_RepeatTimes
Pre-defined value for number of iterations for the process (create-move-delete).
Top
See Also