public void Init() { SetupAnimator(); rigid = GetComponent <Rigidbody>(); rigid.angularDrag = 999; rigid.drag = 4; rigid.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ; invetoryManager = GetComponent <InventoryManager>(); //invetoryManager.Init(); actionManager = GetComponent <ActionManager>(); actionManager.Init(this); a_hook = activeModel.GetComponent <AnimtorHook>(); if (a_hook == null) { a_hook = activeModel.AddComponent <AnimtorHook>(); } a_hook.Init(this, null); a_hook = activeModel.AddComponent <AnimtorHook>(); a_hook.Init(this, null); gameObject.layer = 8; ignoreLayer = ~(1 << 9); anim.SetBool("onGround", true); }
public void Init() { health = 100; anim = GetComponentInChildren <Animator>(); enTarget = GetComponent <EnemyTarget>(); enTarget.Init(this); rigid = GetComponent <Rigidbody>(); agent = GetComponent <NavMeshAgent>(); rigid.isKinematic = true; a_hook = anim.GetComponent <AnimtorHook>(); if (a_hook == null) { a_hook = anim.gameObject.AddComponent <AnimtorHook>(); } a_hook.Init(null, this); InitRagDoll(); //dataRecolected = GameObject.Find("DataRecolected").GetComponent<DataRecolected>(); ignoreLayers = ~(1 << 9); }