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); } } } } }
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); } }
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; } }