Esempio n. 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);

            characterStats.InitCurrent();
            UIManager ui = UIManager.singleton;

            ui.AffectALL(characterStats.hp, characterStats.fp, characterStats.stamina);
            ui.InitSouls(characterStats._souls);
        }
Esempio n. 2
0
        void Start()
        {
            health   = 10000;
            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;
        }