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

            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);
        }
Example #2
0
        // Use this for initialization
        void Start()
        {
            health   = 100;
            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;
        }