コード例 #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.AddComponent <AnimatorHook>();
            if (a_hook == null)
            {
                a_hook = activeModel.AddComponent <AnimatorHook>();
            }
            a_hook.Init(this, null);

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

            anim.SetBool("onGround", true);
        }
コード例 #2
0
ファイル: EnemyStates.cs プロジェクト: Roonsine/Sundered-Soul
        void Start()
        {
            health      = characterStats.hp;
            anim        = GetComponentInChildren <Animator>();
            enemyTarget = GetComponent <EnemyTarget>();
            enemyTarget.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();
            parryable = false;
        }