{"id":278264,"date":"2016-04-14T12:10:04","date_gmt":"2016-04-14T08:10:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=278264"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=278264","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0432 Unity"},"content":{"rendered":"<p>       \u041a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0432\u0441\u0435, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 Unity. \u041c\u043e\u0436\u043d\u043e \u0434\u043e\u043b\u0433\u043e \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0438 \u0431\u043e\u044f\u0442\u044c\u0441\u044f, \u043d\u043e \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0431\u0435\u0437 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0434 \u043d\u0443\u0436\u0434\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043f\u0440\u043e\u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>  \u042f \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043e\u0447\u0435\u043d\u044c \u0442\u0430\u043b\u0430\u043d\u0442\u043b\u0438\u0432\u043e\u0433\u043e \u0445\u0443\u0434\u043e\u0436\u043d\u0438\u043a\u0430, \u0433\u0434\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u0433\u0440\u044b-\u043a\u0432\u0435\u0441\u0442\u0430 \u0432 \u0440\u0435\u0442\u0440\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044c-\u0430\u0440\u0442 \u0441\u0442\u0438\u043b\u0435. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Unity, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u0430 \u0438\u043c\u0435\u0435\u043c \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0440\u0435\u0434\u0435. \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0440\u0430\u0437\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043a\u0430\u0442-\u0441\u0446\u0435\u043d \u0438 \u0433\u043e\u043b\u043e\u0432\u043e\u043b\u043e\u043c\u043e\u043a, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0447\u0435\u0440\u0435\u0434\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u043a\u0440\u043e\u0432\u044c\u044e \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 Animator Controller \u0438 \u043a\u043b\u0430\u0441\u0441 StateMachineBehaviour \u0438\u0437 Unity 5 \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043d\u043e \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442: \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u0430\u043d\u0438\u043c\u0430\u0442\u043e\u0440\u0430 \u0445\u043e\u0442\u044c \u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u0435\u043d, \u043d\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b \u0431\u044b \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043b\u0438\u0448\u043d\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0434\u043b\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u0430 \u043d\u0430\u043c \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u043b\u0435\u0433\u043a\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u0430\u043a \u0432 \u0442\u0430\u0439\u043c\u043b\u0430\u0439\u043d\u0435 \u0432\u0438\u0434\u0435\u043e-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u0432. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/46d\/c28\/395\/46dc283959a242bb91dfeb709431221b.jpg\"\/><br \/>  <sup>\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Unity, \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u0432\u0448\u0430\u044f \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430<\/sup><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u043c\u0438\u043d\u0443\u0435\u043c\u044b\u043c.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0414\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u044f \u043f\u0438\u0441\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0438 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 MonoBehaviour. \u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043f\u043e\u0434\u0445\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 Unity \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0438\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u044f\u043b\u0441\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0439\u0442\u0438 \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0446\u0435\u043b\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u0441 \u0442\u0430\u0439\u043c\u043b\u0430\u0439\u043d\u043e\u043c. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c: \u0434\u0430, \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u043e, \u043d\u043e \u043d\u0435\u0442, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e, \u0433\u043b\u0430\u0437\u0430 \u0438 \u0441\u043e\u0437\u043d\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u044b\u043a\u0430\u044e\u0442.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0440\u0430\u0437\u0443 \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0435: \u043e\u0441\u043d\u043e\u0432\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0438 \u0441\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<h1>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432<\/h1>\n<p>  \u041b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0415\u0441\u043b\u0438 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u044d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0445 \u0445\u0440\u0430\u043d\u0438\u0442\u044c? \u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 Unity MonoBehaviour \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u043e\u043b\u044f, \u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u0432 \u0441\u0446\u0435\u043d\u0435. \u042d\u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f, \u043d\u043e \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u2014 \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438. \u0414\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0446\u0435\u043b\u0438 \u0432 Unity \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <a href=\"http:\/\/docs.unity3d.com\/Manual\/class-ScriptableObject.html\">ScriptableObject<\/a>, \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 MonoBehaviour \u043d\u043e \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0441\u0446\u0435\u043d\u0435 \u0434\u043b\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430. <\/p>\n<p>  \u0412\u0441\u0435 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u2014 \u044d\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 <a href=\"http:\/\/docs.unity3d.com\/Manual\/Coroutines.html\">\u043a\u043e\u0440\u0443\u0442\u0438\u043d\u0443<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043a\u0430\u0434\u0440\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u043e\u0448\u043b\u043e \u0438 \u043a\u043e\u0433\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0434\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c. \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 (\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u043e\u043b\u043d\u044b\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435):<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Scenario.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">private IEnumerator ExecuteScenario() { \tDebug.Log(&quot;[EventSystem] Started execution of &quot; + gameObject.name); \t_time = 0f;  \tvar totalDuration = _actions.Any () ? _actions.Max (action =&gt; action.EndTime) : 0f;  \tvar isPlaying = true; \t \twhile (isPlaying) \t{ \t\tfor (var i = 0; i &lt; _actions.Count; i++) \t\t{ \t\t\tvar action = _actions.ElementAt(i); \t\t\t\tif (_time &gt;= action.StartTime && _time &lt; action.EndTime) \t\t\t{ \t\t\t\tif (action.NowPlaying) \t\t\t\t\taction.ActionUpdate(ref _time); \/\/ \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \t\t\t\t\t\t\t\t  \/\/ \u0440\u0438\u0441\u043a\u043e\u0432\u043e, \u043d\u043e \u043d\u0435\u043e\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 &quot;\u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430&quot; \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \t\t\t\telse \t\t\t\t\taction.ActionStart(_time);  \t\t\t} \t\t\telse if (_time &gt;= action.EndTime) \t\t\t{ \t\t\t\tif (!action.NowPlaying) continue; \t\t\t\taction.Stop(); \t\t\t} \t\t} \t\t\tif(_time &gt;= totalDuration) \t\t\tisPlaying = false; \t\t \t\t_time += Time.deltaTime; \t\t\tyield return null; \t} \t \tforeach (var eventAction in _actions.Where(eventAction =&gt; eventAction.NowPlaying)) \t\teventAction.Stop(); \/\/ \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c - \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430 \u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 \u043d\u0438\u0445  \t_coroutine = null; \tif(_callback != null) \/\/ \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0445\u043e\u0447\u0435\u0442 - \u0441\u043e\u043e\u0431\u0449\u0438\u043c \u0435\u043c\u0443 \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \t\t_callback(); \tDebug.Log(&quot;[EventSystem] Finished executing &quot; + gameObject.name); \t_canPlay = !PlayOnce; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f EventAction \u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b \u0442\u0440\u0438 \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u044f: \u00ab\u041d\u0430\u0447\u0430\u043b\u043e \u0436\u0438\u0437\u043d\u0438\u00bb, \u00ab\u041c\u043e\u043c\u0435\u043d\u0442 \u043c\u0435\u0436\u0434\u0443\u00bb (\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0430\u0434\u0440) \u0438 \u00ab\u041a\u043e\u043d\u0435\u0446\u00bb. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0442\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u00ab\u0441\u043e\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043c\u0435\u0440\u0443 \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435\u00bb, \u00ab\u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043e\u043a\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u00bb, \u00ab\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u0433\u0440\u043e\u043a\u0443 \u0432 \u043a\u043e\u043d\u0446\u0435\u00bb. \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0435-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">EventAction.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using System; using UnityEngine; #if UNITY_EDITOR using UnityEditor; #endif  namespace Visc { \tpublic abstract class EventAction : ScriptableObject \t{ \t\t\/\/ \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u0441\u0442\u0432\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \t\t[SerializeField] protected string _description; \t\t[SerializeField] protected GameObject _actor; \t\t[SerializeField] protected float _startTime; \t\t[SerializeField] protected float _duration = 1f;  \t\tpublic GameObject Actor { get { return _actor; } } \t\tpublic string Description { get { return _description; } } \t\tpublic float StartTime { get { return _startTime; } set { _startTime = value &gt;= 0f ? value : 0f; } } \t\tpublic float Duration { get { return _duration; } set { _duration = value &gt;= 0.1f ? value : 0.1f; } } \t\tpublic float EndTime { get { return _startTime + _duration; } }  \t\tpublic bool NowPlaying { get; protected set; }  \t\tpublic void ActionStart(float starTime) \t\t{ \t\t\tDebug.Log(&quot;[EventSystem] Started event &quot; + _description); \t\t\tNowPlaying = true; \t\t\tOnStart(starTime); \t\t}  \t\tpublic void ActionUpdate(ref float timeSinceActionStart) { OnUpdate(ref timeSinceActionStart); }  \t\tpublic void Stop() \t\t{ \t\t\tDebug.Log(&quot;[EventSystem] Finished event &quot; + _description); \t\t\tNowPlaying = false; \t\t\tOnStop(); \t\t}  \t\t\/\/ \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \t\t\/\/ \u043d\u0435 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \t\tprotected virtual void OnEditorGui() { } \t\tprotected virtual void OnStart(float startTime) { } \t\tprotected virtual void OnUpdate(ref float currentTime) { } \t\tprotected virtual void OnStop() { } \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043f\u043e\u043a\u043e\u043d\u0447\u0435\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435.<\/p>\n<h1>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432<\/h1>\n<p>  \u0421\u0442\u0430\u0440\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432 Unity \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0441\u0432\u043e\u0451 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043b\u044f gui \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 (\u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 \u043e\u043a\u043e\u043d) \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u043a\u043b\u0438\u043a \u043c\u044b\u0448\u044c\u044e, \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u044f\u0432\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 Repaint()) \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u044b, \u0440\u0438\u0441\u0443\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u0432 \u043e\u043a\u043d\u0435, \u0432\u0441\u0435 \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 GUILayout \u0438 EditorGUILayout, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438\u0445 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0b5\/81e\/539\/0b581e5390d94f00ab829869c2dddae0.png\"\/><br \/>  <sup>\u0411\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/sup><\/p>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u043a\u043d\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 EditorWindow \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 OnGUI():<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ScenarioEditorWindow.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">private void OnGUI() { \tif (CurrentScenario != null) \t{ \t\t\/\/ \u043d\u0430\u0447\u0430\u043b\u043e \u0433\u043e\u0440\u0438\u0437\u0430\u043d\u0442\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 - \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \t\tGUILayout.BeginHorizontal();  \t\tif(Application.isPlaying) \t\t\tif(GUILayout.Button(&quot;PLAY&quot;)) \t\t_currentScenario.Execute();  \t\tGUILayout.BeginHorizontal();  \t\t\/\/ \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \t\tCurrentScenario.VisibleScale = EditorGUILayout.Slider(&quot;Scale&quot;, CurrentScenario.VisibleScale, 0.1f, 100f); \t\tCurrentScenario.MaximumDuration = EditorGUILayout.FloatField(&quot;Max duration (seconds)&quot;, \t\t\tCurrentScenario.MaximumDuration); \t\tGUILayout.EndHorizontal(); \t\tGUILayout.BeginHorizontal(); \t\tCurrentScenario.MaximumTracks = EditorGUILayout.IntField(&quot;Max tracks&quot;, CurrentScenario.MaximumTracks); \t\tBoxHeight = EditorGUILayout.IntSlider(&quot;Track height&quot;, BoxHeight, 20, 50);  \t\tif (_draggedAction == null) \t\t{ \t\t\tvar newVisibleDuration = CurrentScenario.MaximumDuration\/CurrentScenario.VisibleScale; \t\t\tvar newScale = newVisibleDuration*CurrentScenario.VisibleScale\/_visibleDuration; \t\t\t_visibleDuration = newVisibleDuration; \t\t\tCurrentScenario.VisibleScale = newScale; \t\t}  \t\tGUILayout.EndHorizontal();  \t\tGUILayout.BeginHorizontal(); \t\tCurrentScenario.PlayOnce = EditorGUILayout.Toggle(&quot;Play once&quot;, CurrentScenario.PlayOnce); \t\tGUILayout.EndHorizontal();  \t\tif (GUILayout.Button(&quot;Save&quot;)) \t\t\tEditorSceneManager.MarkAllScenesDirty();  \t\tGUILayout.EndHorizontal(); \t} \telse \t{ \t\t_eventActionTypes = null; \t\tGUILayout.Label(&quot;Select scenario&quot;); \t} { <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u043e \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u043c\u043d\u0435, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0431\u043e\u043a\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0434\u043e\u0440\u043e\u0436\u043a\u0430\u0445 \u0438 \u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 (\u0435\u0441\u0442\u044c GUI.Window, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e: \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cs\">\/\/ \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 if(action.EditingTrack &lt; _trackOffset || action.EditingTrack &gt;= _trackOffset + maxVisibleTracks) continue;  var horizontalPosStart = position.width * (action.StartTime \/ duration) - hOffset; var horizontalPosEnd = position.width * (action.EndTime \/ duration) - hOffset; var width = horizontalPosEnd - horizontalPosStart;  \/\/ \u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a var boxRect = new Rect (horizontalPosStart + HandleWidth, offset + BoxHeight * (action.EditingTrack - _trackOffset), width - HandleWidth * 2, BoxHeight); EditorGUIUtility.AddCursorRect (boxRect, MouseCursor.Pan);  \/\/ \u041a\u0440\u0430\u0439\u043d\u0438\u0439 \u043b\u0435\u0432\u044b\u0439 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e &quot;\u0443\u0445\u0432\u0430\u0442\u0438\u0442\u044c\u0441\u044f&quot; var boxStartHandleRect = new Rect (horizontalPosStart, offset + BoxHeight * (action.EditingTrack - _trackOffset), HandleWidth, BoxHeight); EditorGUIUtility.AddCursorRect (boxStartHandleRect, MouseCursor.ResizeHorizontal); GUI.Box (boxStartHandleRect, &quot;&lt;&quot;);  \/\/ \u041f\u0440\u0430\u0432\u044b\u0439 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a var boxEndHandleRect = new Rect (horizontalPosEnd - HandleWidth, offset + BoxHeight * (action.EditingTrack - _trackOffset), HandleWidth, BoxHeight); EditorGUIUtility.AddCursorRect (boxEndHandleRect, MouseCursor.ResizeHorizontal); GUI.Box (boxEndHandleRect, &quot;&gt;&quot;);  \/\/ \u0412\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d, \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e\u0432\u0435\u0440\u0445 action.DrawTimelineGui (boxRect); <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u0431\u043e\u043a\u0441:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/89e\/c47\/f7a\/89ec47f7ad914acdae9ea858d07e2bcd.png\"\/><br \/>  <sup>\u0421\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430<\/sup><\/p>\n<p>  Unity \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u0436\u0430\u0442\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443 (Event.current.type == EventType.MouseDown &#038;&#038; Event.current.button == 0), \u0443\u0437\u043d\u0430\u0442\u044c, \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043b\u0438 \u043a\u0443\u0440\u0441\u043e\u0440 \u0432 \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a (Rect.Contains(Event.current.mousePosition)) \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u0432 \u044d\u0442\u043e\u043c \u043a\u0430\u0434\u0440\u0435 \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e \u043a\u043e\u0434\u0443 (Event.current.Use()). \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u0438\u0445 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435: \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0442\u044c, \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u0434\u043b\u0438\u043d\u0443. \u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043a\u043b\u0438\u043a\u0430\u0435\u0442 \u0438\u043b\u0438 \u0434\u0432\u0438\u0433\u0430\u0435\u0442 \u0431\u043e\u043a\u0441, \u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434 \u0437\u0430 \u043d\u0438\u043c\u0438. \u041f\u043e \u043f\u0440\u0430\u0432\u043e\u043c\u0443 \u043a\u043b\u0438\u043a\u0443 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u0430 \u043f\u0440\u0438 \u0434\u0432\u043e\u0439\u043d\u043e\u043c \u043a\u043b\u0438\u043a\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043a\u043d\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/159\/165\/c07\/159165c074394342a5e972eb4b0523a5.png\"\/><br \/>  \u041e\u0442\u043a\u0443\u0434\u0430 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f? \u0412 EventAction \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0435\u0449\u0435 \u0434\u0432\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0443: OnEditorGui() \u0438 OnDrawTimelineGui() \u2014 \u043e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0442\u0430\u0439\u043c\u043b\u0430\u0439\u043d\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430. <\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u043d\u0435\u043c\u0443: \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0435\u0435 \u0434\u0438\u0430\u043b\u043e\u0433\u0438 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0435\u0439, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u044e\u0449\u0435\u0435 \u0446\u0435\u043b\u044c \u0434\u043b\u044f \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u0436\u0430 \u0438\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0435\u0435 \u0435\u0433\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e, \u0438\u043b\u0438 \u0432\u043e\u0442 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 EventAction, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u043c\u0435\u0440\u044b: \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0437\u0430 \u0438\u0433\u0440\u043e\u043a\u043e\u043c, \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0435, \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">CameraTargetControl.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">#if UNITY_EDITOR using UnityEditor; #endif using UnityEngine;  namespace Platformer { \tpublic class CameraTargetControl : EventAction \t{ \t\t[SerializeField] private bool _turnOffTargetingAtStart; \t\t[SerializeField] private bool _turnOnTargetingAtEnd; \t\t[SerializeField] private bool _targetActorInstedOfPlayerAtStart; \t\t[SerializeField] private bool _targetPlayerInTheEnd; \t\t \t\tprotected override void OnStart(float startTime) \t\t{ \t\t\tif(_turnOffTargetingAtStart) GameManager.CameraController.SetTarget(null); \t\t\telse if (_targetActorInstedOfPlayerAtStart) GameManager.CameraController.SetTarget(_actor.transform); \t\t}  \t\tprotected override void OnStop() \t\t{ \t\t\tif(_turnOnTargetingAtEnd || _targetPlayerInTheEnd) GameManager.CameraController.SetTarget(GameManager.PlayerController.transform); \t\t}   #if UNITY_EDITOR \t\tprotected override void OnEditorGui() \t\t{ \t\t\t_turnOffTargetingAtStart = EditorGUILayout.Toggle(&quot;Camera targeting off&quot;, _turnOffTargetingAtStart);  \t\t\tif (_turnOffTargetingAtStart) \t\t\t\t_turnOnTargetingAtEnd = EditorGUILayout.Toggle(&quot;Targeting on in the end&quot;, _turnOnTargetingAtEnd); \t\t\telse \t\t\t{ \t\t\t\t_turnOnTargetingAtEnd = false; \t\t\t\t_targetActorInstedOfPlayerAtStart = EditorGUILayout.Toggle(&quot;Target actor&quot;, _targetActorInstedOfPlayerAtStart); \t\t\t\tif (_targetActorInstedOfPlayerAtStart) \t\t\t\t\t_targetPlayerInTheEnd = EditorGUILayout.Toggle(&quot;Target player in the end&quot;, _targetPlayerInTheEnd); \t\t\t} \t\t} #endif \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u044b\u0448\u043b\u043e? <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8b5\/64f\/d05\/8b564fd05f6e4c76b028e9516d52b4d6.png\"\/><\/p>\n<p>  <iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/0l12irLlX0Y?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<h1>\u0418\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b<\/h1>\n<p>  Scenario \u0438 EventAction \u2014 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u043c\u044b \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0438 \u043a\u043e\u043c\u043f\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0442\u043e \u0432 \u043d\u043e\u0432\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u042f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u0432\u044f\u0437\u0435\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439-\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043d\u043e \u043f\u043e\u043a\u0430 \u0434\u0443\u043c\u0430\u044e \u043d\u0430\u0434 \u044d\u0442\u0438\u043c. <\/p>\n<h1>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h1>\n<p>  \u042f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0431\u044b\u043b\u0430 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u0430, \u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u0441\u0435 \u0435\u0449\u0435 \u0432\u043f\u0435\u0440\u0435\u0434\u0438, \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043b\u0438\u0440\u043e\u0432\u043a\u0430 \u0438 \u0444\u0438\u043a\u0441 \u0431\u0430\u0433\u043e\u0432, \u043d\u043e \u0443\u0436\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043e\u043d \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0432\u043e\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u043d\u0435\u043c\u0443, \u044f \u0434\u043e\u043b\u0433\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u044b\u0432\u0430\u043b \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0432 \u043d\u0430\u0434\u0435\u0436\u0434\u0435 \u043d\u0430\u0439\u0442\u0438 \u0447\u0442\u043e-\u0442\u043e \u0433\u043e\u0442\u043e\u0432\u043e\u0435, \u043d\u043e \u043d\u0435 \u0441\u043c\u043e\u0433. \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e \u0435\u0433\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0438 \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043a\u043e\u043c\u0443-\u0442\u043e \u043a\u0440\u043e\u043c\u0435 \u043d\u0430\u0441.<\/p>\n<p>  \u041f\u0440\u043e\u0435\u043a\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 \u043f\u043e\u0434 MIT License <a href=\"https:\/\/github.com\/marcellus00\/visc\">github.com\/marcellus00\/visc<\/a>               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/281571\/\"> https:\/\/habrahabr.ru\/post\/281571\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0432\u0441\u0435, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 Unity. \u041c\u043e\u0436\u043d\u043e \u0434\u043e\u043b\u0433\u043e \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0438 \u0431\u043e\u044f\u0442\u044c\u0441\u044f, \u043d\u043e \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0431\u0435\u0437 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u0438 \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u0434 \u043d\u0443\u0436\u0434\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043f\u0440\u043e\u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>  \u042f \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043e\u0447\u0435\u043d\u044c \u0442\u0430\u043b\u0430\u043d\u0442\u043b\u0438\u0432\u043e\u0433\u043e \u0445\u0443\u0434\u043e\u0436\u043d\u0438\u043a\u0430, \u0433\u0434\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u0433\u0440\u044b-\u043a\u0432\u0435\u0441\u0442\u0430 \u0432 \u0440\u0435\u0442\u0440\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044c-\u0430\u0440\u0442 \u0441\u0442\u0438\u043b\u0435. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Unity, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u0430 \u0438\u043c\u0435\u0435\u043c \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0440\u0435\u0434\u0435. \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0440\u0430\u0437\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043a\u0430\u0442-\u0441\u0446\u0435\u043d \u0438 \u0433\u043e\u043b\u043e\u0432\u043e\u043b\u043e\u043c\u043e\u043a, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0447\u0435\u0440\u0435\u0434\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441\u0442\u0440\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u043a\u0440\u043e\u0432\u044c\u044e \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 Animator Controller \u0438 \u043a\u043b\u0430\u0441\u0441 StateMachineBehaviour \u0438\u0437 Unity 5 \u0434\u043b\u044f \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u043d\u043e \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442: \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442 \u0430\u043d\u0438\u043c\u0430\u0442\u043e\u0440\u0430 \u0445\u043e\u0442\u044c \u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u0435\u043d, \u043d\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b \u0431\u044b \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043b\u0438\u0448\u043d\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0434\u043b\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u0430 \u043d\u0430\u043c \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u043b\u0435\u0433\u043a\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043a\u0430\u043a \u0432 \u0442\u0430\u0439\u043c\u043b\u0430\u0439\u043d\u0435 \u0432\u0438\u0434\u0435\u043e-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u0432. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/46d\/c28\/395\/46dc283959a242bb91dfeb709431221b.jpg\"\/><br \/>  <sup>\u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Unity, \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u0432\u0448\u0430\u044f \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430<\/sup><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u043c\u0438\u043d\u0443\u0435\u043c\u044b\u043c.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-278264","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=278264"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278264\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=278264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=278264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=278264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}