Esempio n. 1
0
        public void Init()
        {
            SetupAnimator();
            rigidBody             = GetComponent <Rigidbody>();
            rigidBody.angularDrag = 999;
            rigidBody.drag        = 4;
            rigidBody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ;

            //boneHelper = gameObject.AddComponent<BoneHelper>();

            inventoryManager = GetComponent <InventoryManager>();
            inventoryManager.Init(this);

            actionManager = GetComponent <ActionManager>();
            actionManager.Init(this);

            a_hook = activeModel.GetComponent <AnimatorHook>();
            if (a_hook == null)
            {
                a_hook = activeModel.AddComponent <AnimatorHook>();
            }
            a_hook.Init(this, null);

            gameObject.layer = 8;
            ignoreLayers     = ~(1 << 9);

            anim.SetBool(StaticStrings.onGround, true);

            characterStats.InitCurrent();

            UIManager.singleton.AffectAll(characterStats.hp, characterStats.fp, characterStats.stamina);
        }
Esempio n. 2
0
        public void Init()
        {
            anim     = GetComponentInChildren <Animator>();
            enTarget = GetComponent <EnemyTarget>();
            enTarget.Init(this);

            rigid             = GetComponent <Rigidbody>();
            navAgent          = this.GetComponent <NavMeshAgent>();
            rigid.isKinematic = true;



            a_hook = anim.GetComponent <AnimatorHook>();
            if (a_hook == null)
            {
                a_hook = anim.gameObject.AddComponent <AnimatorHook>();
            }
            a_hook.Init(null, this);

            InitRagdoll();
            parryIsOn    = false;
            ignoreLayers = ~(1 << 9);
        }