protected override ActionBlock[] GetBlocks() { return(new [] { new ActionBlock("Kick", () => { vector = EditorGUILayout.Vector2Field("Value", vector); Kickable tool = (Kickable)target; if (GUILayout.Button("Kick")) { tool.Kick(vector); } }), }); }
void Kick() { playerSound.PlayKick(); Collider2D collider = Physics2D.OverlapBox(transform.position + (LookingDirection * Vector3.right * 2f), Vector2.one, 0f, propsLayerMask); if (collider) { Kickable kickable = collider.GetComponent <Kickable>(); if (kickable) { CameraShaker.Instance.ShakeOnce(3f, 5f, .1f, .2f); kickable.Kick(LookingDirection * Vector2.right * 5f); } } }