Exemplo n.º 1
0
 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);
             }
         }),
     });
 }
Exemplo n.º 2
0
    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);
            }
        }
    }