Research on concepts and computational methods of causality has a long history, and there are various concepts of causality as well as corresponding computing algorithms based on measured data. Here, by considering causes and effects from a dynamical perspective, we present a unified mathematical framework for the so-called dynamical causality (DC), which can detect causal interactions over time; notably, this framework covers Granger causality, transfer entropy, embedding causality and their conditional versions. Based on this framework, we further propose a causality criterion called embedding entropy (EE) to measure the DC between two variables. Moreover, its conditional version, conditional embedding entropy (cEE), is also derived for detecting conditional/direct causality. The significant advantages of EE and cEE are that they can be employed for solving not only nonlinear causal inference but also the non-separability problem, and they can reduce the scale bias in numerical calculation. The performance and robustness of EE and cEE were demonstrated through numerical simulations, and causal inference on various real-world datasets validated their effectiveness.