コード例 #1
0
    // Use this for initialization
    void Start()
    {
        if (GetComponentInChildren <LookAtIK>() != null)
        {
            m_IKLookAtSolver = GetComponentInChildren <LookAtIK>().solver;
        }

        GlobalEventManager.RegisterHandler("Teacher.GazePlayer", GazePlayer);
        GlobalEventManager.RegisterHandler("Teacher.CancelGaze", CancelGaze);
        GlobalEventManager.RegisterHandler("Teacher.DressUp", DressUp);
    }
コード例 #2
0
        protected override void OnEnable()
        {
            base.OnEnable();

            animator = GetComponent <Animator>();
            Assert.IsNotNull(animator, "Animator not found");

            var biped = GetComponent <BipedIK>();

            Assert.IsNotNull(biped, "Biped IK not found");

            rightHand = biped.solvers.rightHand;
            Assert.IsNotNull(rightHand, "Right Hand not found");
            Assert.IsNotNull(rightHand.target, "Right Hand target not set");

            lookAt = biped.solvers.lookAt;
            Assert.IsNotNull(lookAt, "Look At not found");
            Assert.IsNotNull(lookAt.target, "Look At target not set");

            var spell = wizard.GetSpellToCast();

            StartCoroutine(Cast(spell));
        }