๐ŸŽฎ Unity Study/Unity

[Unity] Timeline, Playable Director, Binding, Clear Bindings

ibelieveinme 2021. 9. 17. 14:57
728x90

 

* Timeline

: ๋ณตํ•ฉ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์ œ์ž‘ํ•  ๋•Œ ์“ฐ๋Š” Tool (Playable Director์— ์˜์กด)

Object์— Playabel Director Component๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ  ๋งŒ๋“  Timeline์€ playable ์†์„ฑ์œผ๋กœ ๋“ค๊ฐ„๋‹ค.

 

* PlaybleDirector

: Timeline Asset์˜ ํŠธ๋ž™๊ณผ ๊ฒŒ์ž„ ์˜ค๋ธŒ์ ํŠธ๋ฅผ ์—ฐ๊ฒฐํ•ด์ฃผ๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ

 

* Bindings

Timeline ์—์…‹ ํŠธ๋ž™์— ์—ฐ๊ฒฐ๋œ Audio, Animation ๋“ฑ์˜ ์ •๋ณด๋“ค

 

 

[Binding ์ •๋ฆฌ]

๊ฐ์ฒด์— ํ•ด๋‹น ์Šคํฌ๋ฆฝํŠธ ๋‹ฌ์•„์„œ ์“ฐ์ด์ง€ ์•Š๋Š” binidng๋“ค ์ •๋ฆฌํ•˜๊ธฐ

#if UNITY_EDITOR
        [Sirenix.OdinInspector.Button]
        void ClearBinding() {
        	var directors = Object.FindObjectsOfType<PlayableDirector>();
        	foreach (var director in directors){
        		var dirSO = new SerializedObject(director);
        		var sceneBindings = dirSO.FindProperty("m_SceneBindings");
        		for (var i = sceneBindings.arraySize - 1; i >= 0; i--){
        			var binding = sceneBindings.GetArrayElementAtIndex(i);
          			var key = binding.FindPropertyRelative("key");
        			if (key.objectReferenceValue == null)
        				sceneBindings.DeleteArrayElementAtIndex(i);
        		}
        		dirSO.ApplyModifiedProperties();
        	}
        }
#endif

 

 

[Unity ๊ณต์‹ Document ์ฐธ๊ณ ]

 

ํƒ€์ž„๋ผ์ธ ๊ฐœ์š” - Unity ๋งค๋‰ด์–ผ

ํƒ€์ž„๋ผ์ธ ์—๋””ํ„ฐ ์ฐฝ ์„ ์‚ฌ์šฉํ•˜์—ฌ ์”ฌ์˜ ๊ฒŒ์ž„ ์˜ค๋ธŒ์ ํŠธ์— ์—ฐ๊ฒฐ๋œ ํŠธ๋ž™๊ณผ ํด๋ฆฝ์„ ์‹œ๊ฐ์ ์œผ๋กœ ์ •๋ ฌํ•˜๊ณ  ์ปท์”ฌ, ์‹œ๋„ค๋งˆํ‹ฑ ์˜์ƒ, ๊ฒŒ์ž„ํ”Œ๋ ˆ์ด ์‹œํ€€์Šค๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

docs.unity.cn

 

Unity - Manual: Playable Director component

Playable Director component The Playable Director component stores the link between a Timeline instance and a Timeline Asset. The Playable Director component controls when the Timeline instance plays, how the Timeline instance updates its clock, and what h

docs.unity3d.com

 

728x90