Exemple #1
0
        /**
         *  Factory for an EquipmentGUI
         *
         *  @param GameObject parent The parent GameObject to attach
         *      this component to
         *  @param Equipment equipment The Equipment object
         **/
        public static EquipmentGUI CreateComponent(GameObject parent, Equipment equipment)
        {
            EquipmentGUI equipmentGUI = parent.AddComponent <EquipmentGUI>();

            equipmentGUI.equipment = equipment;
            return(equipmentGUI);
        }
Exemple #2
0
        // Use this for initialization
        void Start()
        {
            equipment             = new Dictionary <EquipmentType, GameObject>();
            equipmentContainer    = GameObjectFactory.NewGameObject("Equipment", gameObject.transform);
            equipmentGUIContainer = GameObjectFactory.NewGameObject("Equipment GUI", gameObject.transform);

            equipmentGUI = EquipmentGUI.CreateComponent(equipmentGUIContainer, this);
        }