public void Die()
    {
        aliveStatus = false;
        EventInfo ei = new EventInfo(gameObject, "Die");

        AnimationEventController.SetAnimTrigger(ei);
    }
예제 #2
0
        public void Initialize(AnimationEventController data)
        {
            animationEventController = data;

            selectedKeyframeEvent = null;

            InitializeSubView();
        }
        public static void OpenWindow(AnimationEventController data)
        {
            Instance = GetWindow <AnimationEventControllerEditorWindow>();
            Instance.titleContent = new GUIContent("AnimationEventController");

            Instance.Initialize(data);

            Instance.Show();
        }
    protected override void CommandCompleted()
    {
        timer = 0f;
        PlayerCommand.CommandComplete();
        AnimationBoolEvent abe = new AnimationBoolEvent(playerTrans.gameObject, "Run", false);

        AnimationEventController.SetAnimBool(abe);
        ChangeRotation(startPos, endPos);
    }
예제 #5
0
        public void Initialize(AnimationEventController data)
        {
            animationEventController  = data;
            runtimeAnimatorController = animationEventController.animator.runtimeAnimatorController;

            InitializeAllAnimationsPopup();
            InitializeEventAnimationsPopup();

            AnimationEventControllerEditorWindow.Instance.SelectAnimationEvent(AnimationEventControllerEditorWindow.Instance.current.eventAnimationIndex);
        }
    public override void ExecuteCommand()
    {
        timer += Time.deltaTime * 0.7f;
        ChangeRotation(endPos, playerTrans.position);
        AnimationBoolEvent abe = new AnimationBoolEvent(playerTrans.gameObject, "Run", true);

        AnimationEventController.SetAnimBool(abe);
        playerTrans.position = Vector3.Lerp(startPos, endPos, timer);
        if (timer > 1)
        {
            CommandCompleted();
        }
    }
        private void RefreshEditorWindow()
        {
            GameObject activeGameObject = Selection.activeGameObject;

            AnimationEventController data = activeGameObject != null?activeGameObject.GetComponent <AnimationEventController>() : null;

            if (data != null)
            {
                //&& data.animator != null && data.animator.runtimeAnimatorController != null
                Initialize(data);
                Update();
                Repaint();
            }
        }
예제 #8
0
    public override void Display()
    {
        base.Display();
        Animator anim = gameObject.GetComponent <Animator>();

        animEvent = gameObject.GetComponent <AnimationEventController>();
        animTime  = anim.GetCurrentAnimatorStateInfo(0).length;

        animEvent.ClearAnimationClipEvent();
        animEvent.AddAnimationClipEvent((tag) =>
        {
            if (OnEventCallBack != null)
            {
                OnEventCallBack.Invoke();
                OnEventCallBack = null;
            }
        });
    }
예제 #9
0
 public override void ExecuteCommand()
 {
     animationTimer -= Time.deltaTime;
     if (!animationstarted)
     {
         EventInfo ei = new EventInfo(performer, trigger);
         AnimationEventController.SetAnimTrigger(ei);
         animationstarted = true;
     }
     else if (animationTimer < 0)
     {
         IDamageable dmgTarget = target.GetComponent <IDamageable>();
         if (dmgTarget != null)
         {
             dmgTarget.TakeDamage(damage);
         }
         CommandCompleted();
     }
 }
        public void Initialize(AnimationEventController data)
        {
            animationEventController = data;
            if (animationEventController == null || animationEventController.animator == null || animationEventController.animator.runtimeAnimatorController == null || animationEventController.metaFile == null)
            {
                return;
            }
            //TODO
            if (animationEventController.animationEvents == null)
            {
                animationEventController.animationEvents = new List <AnimationEventController.AdvancedAnimationEvent>();
            }

            InitializeSerializedObject();
            //TODO : Meta파일 기반으로 이전 기록된 로그 데이터 뽑아내기
            InitializeAllClipInAnimator();
            CompareWithClipNameInAnimator();
            InitializeKeyframeEventsInClip();
            CheckEventAnimationClipName();

            InitializeView();
        }
        public void OnEnable()
        {
            origin = (AnimationEventController)target;

            if (origin != null)
            {
                origin.animator = origin.gameObject.GetComponent <Animator>();

                if (origin.animator != null)
                {
                    if (origin.animator.runtimeAnimatorController != null)
                    {
                        RuntimeAnimatorController controller = origin.animator.runtimeAnimatorController;
                        allAnimationCount = controller.animationClips.Length;

                        InitializeAllAnimationNames(controller.animationClips);

                        InitializeRegisteredEventNames();
                    }
                }
            }
        }
예제 #12
0
 public override void ExecuteCommand()
 {
     if (!active)
     {
         active       = true;
         myProjectile = ProjectileObjectPool.GetProjectile(projectile);
         EventInfo ei = new EventInfo(Origin.gameObject, Trigger);
         AnimationEventController.SetAnimTrigger(ei);
         myProjectile.SetActive(true);
         myProjectile.transform.position = Origin.position;
         myProjectile.transform.rotation = Origin.rotation;
         startPos = myProjectile.transform.position;
     }
     else
     {
         travelTime += Time.deltaTime * SpeedModifier;
         myProjectile.transform.position = Vector3.Lerp(startPos + heighReglation, Target.position + heighReglation, travelTime);
         if (travelTime > 1)
         {
             CommandCompleted();
         }
     }
 }
예제 #13
0
        public void Initialize(AnimationEventController data)
        {
            animationEventController = data;

            selectedIndexes = new int[AnimationEventControllerEditorWindow.Instance.mismatchEvents.Count];
            for (int i = 0; i < selectedIndexes.Length; i++)
            {
                selectedIndexes[i] = 0;
            }

            int length = 0;

            for (int i = 0; i < animationEventController.animator.runtimeAnimatorController.animationClips.Length; i++)
            {
                if (animationEventController.animator.runtimeAnimatorController.animationClips[i] == null)
                {
                    continue;
                }

                length++;
            }

            int count = 0;

            allAnimationNames = new string[length];
            for (int i = 0; i < animationEventController.animator.runtimeAnimatorController.animationClips.Length; i++)
            {
                if (animationEventController.animator.runtimeAnimatorController.animationClips[i] == null)
                {
                    continue;
                }

                allAnimationNames[count++] = animationEventController.animator.runtimeAnimatorController.animationClips[i].name;
            }

            InitializeExpectationList();
        }