Inheritance: MonoBehaviour
	private void Setup(){
		// we'll keep a local reference to the mocap osc interface
		mocapInstance = MoCapOscInterface.instance;

		// create objects for every rigid body that's already in the system
		foreach (MoCapRigidBody current in mocapInstance.rigidbodies) {
			createFollower(current);
		}

		// register an event callback handler that creates new objects for
		// every new rigid body that is introduced to the system at a later time
		MoCapOscInterface.OnNewRigidBody += onNewRigidBody;
	}
    void Awake()
    {
        // Singleton stuff
        if(instance == null){
            instance = this;
        } else {
            Debug.LogError("MoCapOscInterface is a singleton class; only one game object is allowed to have this component");
            Destroy (gameObject);
        }

        rigidbodies = new List<MoCapRigidBody>();
        oscMessageQueue = new List<OscMessage> ();
    }
	// Use this for initialization
	void Start () {
		// start with uninitialized state
		mocapInstance = null;

		// we'll need a rigidBodyObject to initialize
		if (rigidBodyObject == null) {
			Debug.LogWarning ("rigidBodyObject not specified");
			// abort
			return;
		}

		// ok let's get ready
		Setup ();
	}
Exemple #4
0
    private void Setup()
    {
        // we'll keep a local reference to the mocap osc interface
        mocapInstance = MoCapOscInterface.instance;

        // create objects for every rigid body that's already in the system
        foreach (MoCapRigidBody current in mocapInstance.rigidbodies)
        {
            createFollower(current);
        }

        // register an event callback handler that creates new objects for
        // every new rigid body that is introduced to the system at a later time
        MoCapOscInterface.OnNewRigidBody += onNewRigidBody;
    }
Exemple #5
0
    // Use this for initialization
    void Start()
    {
        // start with uninitialized state
        mocapInstance = null;

        // we'll need a rigidBodyObject to initialize
        if (rigidBodyObject == null)
        {
            Debug.LogWarning("rigidBodyObject not specified");
            // abort
            return;
        }

        // ok let's get ready
        Setup();
    }
    void Awake()
    {
        // Singleton stuff
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Debug.LogError("MoCapOscInterface is a singleton class; only one game object is allowed to have this component");
            Destroy(gameObject);
        }

        rigidbodies     = new List <MoCapRigidBody>();
        oscMessageQueue = new List <OscMessage> ();
    }