Пример #1
0
        internal void Initialize(InventaryController inventaryController)
        {
            inventary = inventaryController;
            foreach (InventaryGroupViewer v in viewers)
            {
                if (!mappedViewers.ContainsKey(v.SlotType))
                {
                    mappedViewers.Add(v.SlotType, v);
                    InventaryGroup group = inventaryController.GetGroup(v.SlotType);
                    if (group != null)
                    {
                        v.Initialize(this, group);
                    }
                }
            }

            SceneViewer.Initialize(this, new InventaryGroup()
            {
                MaxCapacity = MaxSceneItems
            });
            Scroll.Initialize();
        }
Пример #2
0
        // 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;
        }