Ejemplo n.º 1
0
            public static dynamic GetTSObject(InputTypeEnum dynEnum)
            {
                var tsType = TSActivator.CreateInstance("Tekla.Structures.Model.InputItem.InputTypeEnum").GetType();

                switch (dynEnum)
                {
                case InputTypeEnum.INPUT_1_POINT:
                    return(System.Enum.Parse(tsType, "INPUT_1_POINT"));

                case InputTypeEnum.INPUT_2_POINTS:
                    return(System.Enum.Parse(tsType, "INPUT_2_POINTS"));

                case InputTypeEnum.INPUT_POLYGON:
                    return(System.Enum.Parse(tsType, "INPUT_POLYGON"));

                case InputTypeEnum.INPUT_1_OBJECT:
                    return(System.Enum.Parse(tsType, "INPUT_1_OBJECT"));

                case InputTypeEnum.INPUT_N_OBJECTS:
                    return(System.Enum.Parse(tsType, "INPUT_N_OBJECTS"));

                default:
                    throw new DynamicAPIException(dynEnum.ToString() + "- enum value is not implemented");
                }
            }
 public InputBinding(GameInputsEnum inputName, InputTypeEnum inputType, string inputButton, KeyCode inputKey, int mouseButton)
 {
     this.InputName        = inputName;
     this.InputType        = inputType;
     this.InputButton      = inputButton;
     this.InputKey         = inputKey;
     this.InputMouseButton = mouseButton;
 }
Ejemplo n.º 3
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        EditorGUILayout.LabelField("Raise Event");
        InputManager inputManager = (InputManager)target;

        selected = (InputTypeEnum)EditorGUILayout.EnumPopup("selected event", selected);
        if (GUILayout.Button("raise"))
        {
            inputManager.RaiseEvent(selected);
        }
    }
Ejemplo n.º 4
0
    // Send input data every so often
    IEnumerator SendInputCoroutine()
    {
        while (true)
        {
            yield return(new WaitForSeconds(0.1f));

            // Anything to do?
            if (m_hostId == -1 || m_serverConnectionId == -1)
            {
                continue;
            }

            InputTypeEnum input = InputTypeEnum.KeyNone;
            float         f;
            f = Input.GetAxis("Horizontal");
            if (f > 0.0f)
            {
                input |= InputTypeEnum.KeyUp;
            }
            if (f < 0.0f)
            {
                input |= InputTypeEnum.KeyDown;
            }
            f = Input.GetAxis("Vertical");
            if (f > 0.0f)
            {
                input |= InputTypeEnum.KeyRight;
            }
            if (f < 0.0f)
            {
                input |= InputTypeEnum.KeyLeft;
            }
            if (Input.GetKey(KeyCode.Space))
            {
                input |= InputTypeEnum.KeyJump;
            }

            if (input == InputTypeEnum.KeyNone)
            {
                continue;
            }

            // Send data out
            byte[] buffer = new byte[1];
            buffer[0] = (byte)input;
            byte error;
            NetworkTransport.Send(m_hostId, m_serverConnectionId, reliableChannel, buffer, buffer.Length, out error);
        }
    }
Ejemplo n.º 5
0
        private void Start()
        {
            inputType = InputTypeEnum.Hololens;
            // Create our arcball objects
            arcball                 = new GameObject("ArcBall").transform;
            arcballParent           = new GameObject("ArcBallParent").transform;
            targetRotationTransform = new GameObject("TargetRotationTransform").transform;
            arcball.parent          = arcballParent;

            // Check to see if we have a controller plugged in
            // TEMP make multiple input sources true by default
            //if (InputSources.Instance.hidGamepad.IsPresent()) {
            multipleInputSources = true;
            //}
        }
Ejemplo n.º 6
0
    void ProcessClientInput(int connectionId, byte[] buffer)
    {
        ClientData cd = clientList.FirstOrDefault(item => item.connectionId == connectionId);

        if (cd == null)
        {
            Debug.Log("Client that we didn't know about!?");
            return;
        }

        InputTypeEnum input  = (InputTypeEnum)buffer[0];
        float         deltaX = 0.0f;
        float         deltaZ = 0.0f;

        if ((input & InputTypeEnum.KeyUp) == InputTypeEnum.KeyUp)
        {
            deltaX = 1.0f;
        }
        if ((input & InputTypeEnum.KeyDown) == InputTypeEnum.KeyDown)
        {
            deltaX = -1.0f;
        }
        if ((input & InputTypeEnum.KeyRight) == InputTypeEnum.KeyRight)
        {
            deltaZ = 1.0f;
        }
        if ((input & InputTypeEnum.KeyLeft) == InputTypeEnum.KeyLeft)
        {
            deltaZ = -1.0f;
        }
        Vector3 movement = new Vector3(deltaX, 0, deltaZ);

        movement  = transform.TransformDirection(movement);
        movement *= 10.0f;
        cd.obj.GetComponent <CharacterController>().Move(movement * Time.deltaTime);
    }
Ejemplo n.º 7
0
 public void Start()
 {
     inputType = InputTypeEnum.Hololens;
 }
Ejemplo n.º 8
0
        public static IMES.FisObject.FA.Product.IProduct GetProductByInput(string inputNo, InputTypeEnum InputType)
        {
            var productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IMES.FisObject.FA.Product.IProduct>();
            IMES.FisObject.FA.Product.IProduct currentProduct = null;

            switch (InputType)
            {
                case InputTypeEnum.CustSN:
                    currentProduct = productRepository.GetProductByCustomSn(inputNo);
                    if (currentProduct == null && inputNo.Length > 1)
                    {
                        currentProduct = productRepository.GetProductByCustomSn(inputNo.Substring(0, inputNo.Length - 1));
                    }
                    break;
                case InputTypeEnum.Carton:
                    List<string> productIDList = productRepository.GetProductIDListByCarton(inputNo);
                    if (productIDList == null || productIDList.Count == 0 && inputNo.Length > 1)
                    {
                        productIDList = productRepository.GetProductIDListByCarton(inputNo.Substring(0, inputNo.Length - 1));
                    }
                    if (productIDList != null && productIDList.Count != 0)
                    {
                        currentProduct = productRepository.Find(productIDList[0]);
                    }
                    break;
                case InputTypeEnum.ProductIDOrCustSN:
                    currentProduct = productRepository.FindOneProductWithProductIDOrCustSN(inputNo);
                    if (currentProduct == null && inputNo.Length > 1)
                    {
                        currentProduct = productRepository.FindOneProductWithProductIDOrCustSN(inputNo.Substring(0, inputNo.Length - 1));
                    }
                    break;
                case InputTypeEnum.ProductIDOrCustSNOrCarton:
                    currentProduct = productRepository.FindOneProductWithProductIDOrCustSNOrCarton(inputNo);
                    if (currentProduct == null && inputNo.Length > 1)
                    {
                        currentProduct = productRepository.FindOneProductWithProductIDOrCustSNOrCarton(inputNo.Substring(0, inputNo.Length - 1));
                    }
                    break;
                case InputTypeEnum.ProductIDOrCustSNOrPallet:
                    currentProduct = productRepository.FindOneProductWithProductIDOrCustSNOrPallet(inputNo);
                    if (currentProduct == null && inputNo.Length > 1)
                    {
                        currentProduct = productRepository.FindOneProductWithProductIDOrCustSNOrPallet(inputNo.Substring(0, inputNo.Length - 1));
                    }
                    break;

            }

            if (currentProduct == null)
            {
                FisException fe = new FisException("CHK079", new string[] { inputNo });
                throw fe;
            }
            return currentProduct;
        }
Ejemplo n.º 9
0
 public void RaiseEvent(InputTypeEnum inputType)
 {
     inputEventDictionary[inputType].Invoke();
 }
Ejemplo n.º 10
0
 public void Initialise()
 {
     LastInputType  = InputType;
     SelectedMethod = InputTypes[InputType];
 }
Ejemplo n.º 11
0
		public void Initialise()
		{
			LastInputType = InputType;
			SelectedMethod = InputTypes[InputType];
		}