public void initialize(ZgManager aZig) { Inst = this; mZig = aZig; mAll = new XboneAll(); mLog = new XboneUnityLogPlugin(); mPLM = new XbonePLM(aZig.mManager); mKinect = new XboneKinect(); mStorage = new XboneStorage(); mEvents = new XboneEvents(); mAll.Start(); mLog.Start(); mPLM.Start(); mKinect.Start(); mEvents.Start(); //TODO DELETE solves nothing //solves some jit problems //System.Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes"); Initialized = true; }
public void initialize(ZgManager aZig) { var mZigObject = ManagerManager.Manager.gameObject; //mZigObject.AddComponent<kinectSpecific>(); mZig = mZigObject.GetComponent <Zig>(); //TODO try this again... /* * mZig = mZigObject.AddComponent<Zig>(); * mZig.inputType = ZigInputType.Auto; * mZig.settings.UpdateDepth = true; * mZig.settings.UpdateImage = true; * mZig.settings.AlignDepthToRGB = false; * mZig.settings.OpenNISpecific.Mirror = true; * mZigObject.AddComponent<ZigEngageSingleUser>(); */ //ZigEngageSingleUser scans for all users but only reports results from one of them (the first I guess) //normally this is set in editor initializers but we don't do that here mZigEngageSingleUser = mZigObject.GetComponent <ZigEngageSingleUser>(); mZigEngageSingleUser.EngagedUsers = new System.Collections.Generic.List <UnityEngine.GameObject>(); mZigEngageSingleUser.EngagedUsers.Add(mZigObject); //this is the only way to get callbacks from ZigEngageSingleUser mZigCallbackBehaviour = mZigObject.AddComponent <ZigCallbackBehaviour>(); mZigCallbackBehaviour.mUpdateUserDelegate += Zig_UpdateUser; mZigCallbackBehaviour.mUpdateInputDelegate += Zig_UpdateInput; }
void Awake() { #if !UNITY_XBOXONE string words = ""; using (StreamReader reader = new StreamReader(Application.dataPath + "/StreamingAssets/language.txt")) { words = reader.ReadLine(); GameConstants.language = System.Convert.ToInt32(words); } #endif Random.seed = System.Environment.TickCount; Application.targetFrameRate = (int)GameConstants.TARGET_FRAMERATE; GameEventDistributor += delegate(string arg1, object[] arg2) { Log("ManagerManager.cs: GAME EVENT: " + arg1); }; Cursor.visible = false; gameObject.AddComponent <AudioListener>(); //Debug.Log("setting up managers"); mReferences = GetComponent <PrefabReferenceBehaviour>(); //mMenuReferences = GetComponent<MenuReferenceBehaviour>(); mNewRef = GetComponent <NewMenuReferenceBehaviour>(); Manager = this; mCharacterBundleManager = new CharacterBundleManager(this); mMusicManager = new MusicManager(this); mZigManager = new ZgManager(this); mProjectionManager = new ProjectionManager(this); mBodyManager = new BodyManager(this); mTransparentBodyManager = new BodyManager(this); mTransparentBodyManager.mMode = 1; //nasty mBackgroundManager = new BackgroundManager(this); mCameraManager = new CameraManager(this); mAssetLoader = new AssetBundleLoader(this); mGameManager = new NewGameManager(this); mTransitionCameraManager = new TransitionCameraManager(this); mMetaManager = new MetaManager(this); if (mStartDelegates != null) { /* CAN DELETE * var time = Time.time; * string output = ""; * foreach(var e in mStartDelegates.GetInvocationList()) * { * e.DynamicInvoke(); * output += e.ToString() + " took: " + (Time.time - time) + "\n"; * time = Time.time; * } * Debug.Log(output);*/ mStartDelegates(); } ManagerManager.Log("ManagerManager.cs: AWAKE() COMPLETE"); }
public void match_body_location_to_projection(ZgManager aManager) { Vector3 position = Vector3.zero; if (!aManager.using_nite()) { position = aManager.Joints[ZgJointId.Waist].Position; } else { position = aManager.Joints[ZgJointId.Torso].Position; } position.z = 0; position.y = 0; position.x *= -1; if (Mathf.Abs(position.x) < 10) { position.x = 0; //fake snapping, TODO this should probbaly be in grading manager if anywhere... } SoftPosition = position / 1.5f + mOffset; }
//if MonoBehaviours are needed, they can be added to the aZig.gameObject public void initialize(ZgManager aZig) { }