Ejemplo n.º 1
0
    private void OnInputEvent(GameInputManager.EventData data)
    {
        if (data.used)
        {
            return;
        }

        // If user left clicked, check to see what he clicked.
        if (data.mouse == 0)
        {
            RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);

            if (hit.collider != null)
            {
                if (hit.collider.tag == "Skill")
                {
                    ISkill action = hit.collider.gameObject.GetComponent <ISkill>();
                    if (action.Requirements(this, transform))
                    {
                        if (InterruptSkill != null)
                        {
                            InterruptSkill();
                        }
                        action.Init(transform);
                        action.Execute(action, gameObject);
                    }
                }
            }
        }
    }
Ejemplo n.º 2
0
 private void OnInputEvent(GameInputManager.EventData data)
 {
     if (fishing)
     {
         Debug.Log("Caught the fish!");
         Inventory.instance.Add(fish[1].itemId);
         AddXpToSkill(SkillType.Fishing, fish[1].xp);
     }
 }
Ejemplo n.º 3
0
    protected void OnInputEvent(GameInputManager.EventData data)
    {
        if (data.used)
        {
            return;
        }

        if (data.axis == "Horizontal")
        {
            Horizontal = data.value;
            data.used  = true;
        }
        if (data.axis == "Vertical")
        {
            Vertical  = data.value;
            data.used = true;
        }
    }