Example #1
0
            public bool exclusiveSlotFilled(EquippableSlotManager slotManager)
            {
                foreach (var exclusiveSlot in this.exclusiveWith)
                {
                    if (slotManager.slots[exclusiveSlot].isFilled())
                    {
                        return(true);
                    }
                }

                return(false);
            }
Example #2
0
        private void Awake()
        {
            // Hopefully there's a player at this point. We need to get their material reference so the shaders look right.
            chestStand.material = ZNetScene.instance.GetPrefab("Player").GetComponent <VisEquipment>().m_bodyModel.material;
            legsStand.material  = chestStand.material;
            legsPole.material   = chestStand.material;

            // If items are equipped this will sort itself out and reset.
            legsStand.gameObject.SetActive(false);
            helmetStand.SetActive(false);

            // This is the wood texture for the stand
            chestStand.material.SetTexture("_MainTex", defaultBodyTexture);
            legsStand.material.SetTexture("_MainTex", defaultBodyTexture);
            legsPole.material.SetTexture("_MainTex", defaultBodyTexture);

            this.m_nview = (UnityEngine.Object) this.m_netViewOverride ? this.m_netViewOverride : this.gameObject.GetComponent <ZNetView>();

            if (this.m_nview.GetZDO() == null)
            {
                return;
            }

            equipmentSlotManager = new EquippableSlotManager(this);
            poseManager          = new PoseManager(this);
            WearNTear component = this.GetComponent <WearNTear>();

            if ((bool)((UnityEngine.Object)component))
            {
                component.m_onDestroyed += new Action(this.OnDestroyed);
            }

            this.m_nview.Register("DropItems", new Action <long>(this.RPC_DropItems));
            this.m_nview.Register("RequestOwn", new Action <long>(this.RPC_RequestOwn));
            this.m_nview.Register("DestroyAttachment", new Action <long>(this.RPC_DestroyAttachment));
            this.m_nview.Register("SetVisualItems", new Action <long>(this.RPC_SetVisualItems));
            this.InvokeRepeating("UpdateVisual", 1f, 4f);
        }