Exemple #1
0
        private void Awake()
        {
            _sortingGroup = GetComponent <SortingGroup>();

            Animator = new NPCAnimator(this)
            {
                TimeScale = AnimatorTimeScale
            };
            Animator.OnEvent.Subscribe(OnAnimatorEvent);
        }
Exemple #2
0
        private void Awake()
        {
            _sortingGroup = GetComponent <SortingGroup>();
            _touchHandler = GetComponentInChildren <TouchHandler>();

            _touchHandler.OnClick
            .Merge(_touchHandler.OnDoubleClick)
            .Merge(_touchHandler.OnMultipleClick)
            .Subscribe(_ => PlayAnimation(NPCAnimation.Type.Touch_01))
            .AddTo(gameObject);

            Animator = new NPCAnimator(this)
            {
                TimeScale = AnimatorTimeScale
            };
            Animator.OnEvent.Subscribe(OnAnimatorEvent);
        }