private void Awake() { Controller = new CharacterController(gameObject.AddComponent <Rigidbody>()); Animator anim = transform.GetComponentInChildren <Animator>(); animatorHook = anim.gameObject.AddComponent <AnimatorHook>(); animatorHook.Init(anim, Controller); Init(); }
public void Init() { SetupAnimator(); rBody = GetComponent <Rigidbody>(); rBody.angularDrag = 999; rBody.drag = 4; rBody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ; a_hook = activeModel.AddComponent <AnimatorHook>(); a_hook.Init(this); gameObject.layer = 8; ignoreLayers = ~(1 << 9); }
public void Init() { animator = model.GetComponent <Animator>(); animator.applyRootMotion = false; rigid = GetComponent <Rigidbody>(); rigid.drag = 4; rigid.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ | RigidbodyConstraints.FreezeRotationY; hook = model.AddComponent <AnimatorHook>(); hook.Init(this); gameObject.layer = 8; ignoreLayers = ~(1 << 9); animator.SetBool("onGround", true); }
void Start() { if (activeModel == null) { Debug.LogError("No active model assigned to the StateManager!"); } animator = activeModel.GetComponent <Animator>(); inputController = GetComponent <InputController>(); animatorHook = activeModel.AddComponent <AnimatorHook>(); animatorHook.Init(this, GetComponent <Rigidbody>()); animator.applyRootMotion = false; }
public void Init() { SetupAnimator(); spawnProjectiles.Init(this); rb = GetComponent <Rigidbody>(); rb.angularDrag = 999; rb.drag = 4; rb.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ; a_hook = activeModel.AddComponent <AnimatorHook>(); a_hook.Init(this); //ignoreLayers = ~(1<<10); anim.SetBool("onGround", true); }
public void Init() { SetupAnimator(); rb = GetComponent <Rigidbody>(); rb.angularDrag = 999; rb.drag = 4; rb.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ; animHook = activeModel.AddComponent <AnimatorHook>(); animHook.Init(this); gameObject.layer = 8; ignoredLayers = ~(1 << 9); anim.SetBool("isGrounded", true); }
private void Start() { health = 100000; anim = GetComponentInChildren <Animator>(); enTarget = GetComponent <EnemyTarget>(); enTarget.Init(this); rigid = GetComponent <Rigidbody>(); a_hook = anim.GetComponent <AnimatorHook>(); if (a_hook == null) { a_hook = anim.gameObject.AddComponent <AnimatorHook>(); } a_hook.Init(null, this); InitRagdoll(); parryIsOn = false; }
public void Init() { SetupAnimator(); rigid = GetComponent <Rigidbody>(); rigid.drag = 4; rigid.angularDrag = 999; rigid.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ; inventoryManager = GetComponent <InventoryManager>(); inventoryManager.Init(this); actionManager = GetComponent <ActionManager>(); actionManager.Init(this); animHook = activeModel.GetComponent <AnimatorHook>(); if (animHook == null) { animHook = activeModel.AddComponent <AnimatorHook>(); } animHook.Init(this, null); gameObject.layer = 8; ignoreLayers = ~(1 << 9); ignoreForGroundCheck = ~(1 << 9 | 1 << 10); animator.SetBool(StaticStrings.animParam_OnGround, true); pickableItemManager = GetComponent <PickableItemsManager>(); UIManager UIManager = UIManager.Instance; characterStats.InitCurrent(); UIManager.EffectAll(characterStats.hp, characterStats.fp, characterStats.stamina); UIManager.InitSouls(characterStats.currentSouls); prevGround = true; DialogueManager.Instance.Init(this.transform); }