void AssignAttacks()
    {
        switch (plyAttState)
        {
        case AttState.selectAtt:
            if (Input.GetKeyDown(KeyCode.Space))
            {
                submitAtt();
            }

            if (Input.GetKeyDown(KeyCode.Escape))
            {
                plyAttState = AttState.selectPart;
            }
            //submit attacks
            break;

        case AttState.selectPart:

            AimMode();
            //goto attmode press space to back to aim press esc

            if (Input.GetKeyDown(KeyCode.Space))
            {
                plyAttState = AttState.selectAtt;
            }

            if (Input.GetKeyDown(KeyCode.Escape))
            {
                plyAttState = AttState.none;
            }
            break;

        case AttState.none:
            //goto aimmode
            if (Input.GetKeyDown(KeyCode.Space))
            {
                plyAttState = AttState.selectPart;
            }



            break;
        }

        if (Input.GetAxis("Mouse ScrollWheel") > 0f) // forward
        {
            if (plyAttState == AttState.selectAtt)
            {
                attIndex += 1;
            }

            if (plyAttState == AttState.selectPart)
            {
                whatPart += 1;
            }
        }
        else if (Input.GetAxis("Mouse ScrollWheel") < 0f) // backwards
        {
            if (plyAttState == AttState.selectAtt)
            {
                attIndex -= 1;
            }

            if (plyAttState == AttState.selectPart)
            {
                whatPart -= 1;
            }
        }

        attIndex = Mathf.Clamp(attIndex, 1, 4);
        whatPart = Mathf.Clamp(whatPart, 0, 7);
    }
Esempio n. 2
0
 void SetTag(IXmlParserContext context, AttState value)
 {
     context.StateTag = (context.StateTag & ~TagMask) | ((int)value << XmlAttributeValueState.TagShift);
 }
		void SetTag (IXmlParserContext context, AttState value)
		{
			context.StateTag = (context.StateTag & ~TagMask) | ((int)value << XmlAttributeValueState.TagShift);
		}