// Use this for initialization
        void Initialize()
        {
            tr        = this.transform;
            rg        = GetComponent <Rigidbody>();
            coll      = GetComponent <CharacterController>();
            anim      = GetComponentInChildren <Animator>();
            ik        = GetComponentInChildren <IkHandler>();
            inventary = GetComponent <InventaryController>();
            ragdoll   = GetComponentInChildren <RagdollController>();

            ik.LookAtPosition = LookAt;
            cam = Camera.main.transform;

            inventary.Initiliaze(Player, this);

            life   = new Stat("life", this.Stats.MaxLife, this.Stats.MaxLife);
            shield = new Stat("shield", this.Stats.MaxLife, 0);
            armor  = new Stat("armor", this.Stats.MaxLife, 0);

            Active = true;

            initialized = true;
        }
示例#2
0
 private void OnEnable()
 {
     mesh         = GetComponent <SkinnedMeshRenderer>();
     maskManagers = this.transform.parent.GetComponentsInChildren <BodyMaskManager>();
     ragdoll      = this.transform.parent.GetComponent <RagdollController>();
 }