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

            a_hook = activeModel.AddComponent <AnimatorHook>();
            a_hook.Init(this);

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

            anim.SetBool("onGround", true);
        }
        private void Start()
        {
            health      = 100;
            anim        = GetComponentInChildren <Animator>();
            enemyTarget = GetComponent <EnemyTarget>();
            enemyTarget.Init(this);

            body = GetComponent <Rigidbody>();

            aHook = anim.GetComponent <AnimatorHook>();
            if (aHook == null)
            {
                aHook = anim.gameObject.AddComponent <AnimatorHook>();
            }
            aHook.Init(null, this);
            InitRagdoll();
        }
Example #3
0
        public void Init()
        {
            r_manager.Init();

            mTransform = gameObject.transform;
            SetupAnimator();
            SetupRigidbody();
            controllerCollider = GetComponent <Collider>();
            SetupRagdoll();

            ignoreLayers    = ~(1 << 9);
            ignoreForGround = ~(1 << 9 | 1 << 10);

            a_hook = activeModel.AddComponent <AnimatorHook>();
            a_hook.Init(this);
            Init_WeaponManager();
            SetupCharacter();
        }
Example #4
0
        void Start()
        {
            health   = 1000;
            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;
        }
Example #5
0
        //-----------------------------------------------------------------------

        //-------------------setters--------------------------
        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);

            pickManager = GetComponent <PickableItemsManager>();

            a_hook = activeModel.GetComponent <AnimatorHook>();
            if (a_hook == null)
            {
                // add AnimatorHook component to the active model.
                a_hook = activeModel.AddComponent <AnimatorHook>();
            }

            a_hook.Init(this, null);

            audio_source = activeModel.GetComponent <AudioSource>();

            // ignore the damage collider LayerMask when in contact.
            gameObject.layer = 8;
            ignoreLayers     = ~(1 << 9);

            anim.SetBool("onGround", true);

            characterStats.InitCurrent();

            UIManager ui = UIManager.singleton;

            ui.AffectAll(characterStats.hp, characterStats.fp, characterStats.stamina);
            ui.InitSouls(characterStats._souls);

            DialogueManager.singleton.Init(this.transform);
        }
Example #6
0
        public void Init()
        {
            SetupAnimator();
            rigid             = GetComponent <Rigidbody> ();
            rigid.angularDrag = Mathf.Infinity;
            rigid.drag        = 4;
            rigid.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ;

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

            a_hook = activeModel.AddComponent <AnimatorHook>();
            a_hook.Init(this);

            gameObject.layer = 9;
            ignoreLayers     = ~(1 << 10);
            anim.SetBool("onGround", true);
        }
Example #7
0
        public void Init()
        {
            mTransform = this.transform;
            SetupAnimator();
            rigidbody             = GetComponent <Rigidbody>();
            rigidbody.angularDrag = 999;
            rigidbody.drag        = 4;
            rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ;


            gameObject.layer     = 8;
            ignoreLayers         = ~(1 << 9);
            ignoreForGroundCheck = ~(1 << 9 | 1 << 10);
            a_hook = activeModel.AddComponent <AnimatorHook>();
            if (a_hook == null)
            {
                a_hook = activeModel.AddComponent <AnimatorHook>();
            }

            a_hook.Init(this);
        }