egInt GameLength = 300; //in seconds // Use this for initialization void egAwake() { print("egAwake"); // initialize SUKI if (Skeleton == null) { Skeleton = GameObject.Find("Tracking Avatar").GetComponent <SkeletonData> (); } if (netskeleton == null) { netskeleton = GameObject.Find("Tracking Avatar").GetComponent <NetworkSkeleton> (); } suki = Suki.SukiInput.Instance; suki.Skeleton = Skeleton; print("egAwake:Trying to connect..."); // connect the client skeleton to the server skeleton (running in the enablegames launcher app) string address = PlayerPrefs.GetString(egParameterStrings.LAUNCHER_ADDRESS); print("Address= " + address); NetworkClientConnect.Instance.Connect(address); print("egAwake:after connect."); // Bind Speed to the variable "STARTING SPEED" from the settings menu //NOTE:Binding will be skipped if ParameterHandler not loaded (i.e. running this scene //without first running MainMenu scene) //Also, parameters must be added to DefaultParameters.json file (located in StreamingAssets folder). VariableHandler.Instance.Register(ParameterStrings.STARTING_SPEED, Speed); //VariableHandler.Instance.Register (ParameterStrings.GRAVITY, Gravity); VariableHandler.Instance.Register(egParameterStrings.GAME_LENGTH, GameLength); print("Speed=" + Speed); //print ("Gravity=" + Gravity); print("GameLength=" + GameLength); }
// Use this for initialization void egAwake() { print("egAwake"); // initialize SUKI if (Skeleton == null) { Skeleton = GameObject.Find("Tracking Avatar").GetComponent <SkeletonData>(); } if (netskeleton == null) { netskeleton = GameObject.Find("Tracking Avatar").GetComponent <NetworkSkeleton>(); } suki = Suki.SukiInput.Instance; suki.Skeleton = Skeleton; print("egAwake:Trying to connect..."); // connect the client skeleton to the server skeleton (running in the enablegames launcher app) string address = PlayerPrefs.GetString(egParameterStrings.LAUNCHER_ADDRESS); print("Address= " + address); NetworkClientConnect.Instance.Connect(address); print("egAwake:after connect."); //Bind Speed to the variable "STARTING SPEED" from the settings menu //NOTE:Binding will be skipped if ParameterHandler not loaded (i.e. running this scene //without first running MainMenu scene VariableHandler.Instance.Register(CBParameterStrings.STARTING_SPEED, Speed); VariableHandler.Instance.Register(CBParameterStrings.BALL_SIZE_WIDTH, maxSize); VariableHandler.Instance.Register(egParameterStrings.GAME_LENGTH, GameLength); PlayerObject.localScale += new Vector3(0, maxSize, 0); print("Speed=" + Speed); print("GameLength=" + GameLength); }
public void Init() { if (m_Initialized) { return; } m_Initialized = true; sync = target as NetworkSkeleton; m_Target = serializedObject.FindProperty("m_Target"); if (sync.GetComponent <NetworkTransform>() == null) { if (LogFilter.logError) { Debug.LogError("NetworkSkeleton must be on the root object with the NetworkTransform, not on the child node"); } m_Target.objectReferenceValue = null; } m_InterpolateRotation = serializedObject.FindProperty("m_InterpolateRotation"); m_InterpolateMovement = serializedObject.FindProperty("m_InterpolateMovement"); m_RotationSyncCompression = serializedObject.FindProperty("m_RotationSyncCompression"); m_SyncLevel = serializedObject.FindProperty("m_SyncLevel"); m_NetworkChannel = serializedObject.FindProperty("m_NetworkChannel"); m_DrawOnServer = serializedObject.FindProperty("m_DrawOnServer"); m_NetworkSendIntervalProperty = serializedObject.FindProperty("m_SendInterval"); m_NetworkSendIntervalLabel = new GUIContent("Network Send Rate (seconds)", "Number of network updates per second"); EditorGUI.indentLevel += 1; m_InterpolateRotationLabel = new GUIContent("Interpolate Rotation Factor"); m_InterpolateMovementLabel = new GUIContent("Interpolate Movement Factor"); m_RotationSyncCompressionLabel = new GUIContent("Compress Rotation"); m_SyncLevelLabel = new GUIContent("SyncLevel", "The number of levels of skeleton heirarchy to synchronize. Zero means synchronize all bones."); m_NetworkChannelLabel = new GUIContent("NetworkChannel"); EditorGUI.indentLevel -= 1; }