コード例 #1
0
        public void Init()
        {
            SetupAnimator();
            rigid             = GetComponent <Rigidbody> ();
            rigid.angularDrag = 999f;
            rigid.drag        = 4f;
            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);         //присваивает не один слой, а слои с 1 по 8 включительно

            anim.SetBool(StaticStrings.onGround, true);
        }
コード例 #2
0
        public void Init()
        {
            SetupAnimator();
            rigidBody             = GetComponent <Rigidbody>();
            rigidBody.angularDrag = 999;
            rigidBody.drag        = 4;
            rigidBody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ;

            inventoryManager = GetComponent <InventoryManager>();
            inventoryManager.Init();

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

            animatorHook = activeModel.GetComponent <AnimatorHook>();
            if (animatorHook == null)
            {
                animatorHook = activeModel.AddComponent <AnimatorHook>();
            }
            animatorHook.Init(this, null);

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

            animator.SetBool("onGround", true);
        }
コード例 #3
0
        public void Init()
        {
            anim                    = GetComponentInChildren <Animator>();
            audioSource             = this.gameObject.AddComponent <AudioSource>();
            audioSource.maxDistance = 3.5f;
            enTarget                = GetComponent <EnemyTarget>();
            enTarget.Init(this);

            rigid             = GetComponent <Rigidbody>();
            agent             = GetComponent <NavMeshAgent>();
            rigid.isKinematic = true;

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

            enemyCanvas = GetComponentInChildren <Canvas>();

            a_hook.Init(null, this);
            InitRagDoll();
            parryIsOn = false;

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

            lockOnGameObject.SetActive(false);
            healthBar = enemyCanvas.transform.Find("HealthBG").Find("Health").GetComponent <Image>();
            enemyCanvas.gameObject.SetActive(false);
            health = maxHealth;
        }
コード例 #4
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);
        }
コード例 #5
0
        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();
        }
コード例 #6
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();
        }
コード例 #7
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;
        }
コード例 #8
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);
        }
コード例 #9
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);
        }
コード例 #10
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);
        }