Пример #1
0
    //gets the input for controlling the character
    private void GetInput()
    {
        directions = Vector3.zero;
        CastingSpell CastingSpell = GetComponent <CastingSpell>();

        if (CastingSpell.isCasting == false)
        {
            if (Input.GetKey(KeyCode.W))
            {
                directions = directions + Vector3.forward;
            }
            if (Input.GetKey(KeyCode.A))
            {
                directions = directions + Vector3.left;
            }
            if (Input.GetKey(KeyCode.S))
            {
                directions = directions + Vector3.back;
            }
            if (Input.GetKey(KeyCode.D))
            {
                directions = directions + Vector3.right;
            }
        }
    }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     SetIcons();
     castingSpell        = gameObject.GetComponent <CastingSpell>();
     Spells.instantiator = Instantiate;
 }