public SavedInteractableObject(int[] tileID, Vector3 position, Quaternion rotation, InteractableObjectType objectType) { this.tileID = tileID; this.position = position; this.rotation = rotation; this.objectType = objectType; }
protected override void setFieldWithElementValues() { if (element != null) { Item item = element.databaseModelToItem(resourcesList); databaseID = item.databaseID; itemName = item.name; itemIcon = item.itemIcon; itemModel = item.itemModel; isConsomable = item.isConsomable; isStackable = item.isStackable; canBeRecycle = item.canBeRecycle; maxStackableSize = item.maxStackableSize; interactableType = item.interactibleType; itemType = item.itemType; targetType = item.targetType; numberOfEffect = item.effects.Count; effects = item.effects; effectsIndex.updateSize(effects.Count); for (int i = 0; i < effects.Count; i++) { effectsIndex[i] = EffectList.getIndexfor(effects[i].effect.getName()); } } }
public void ChangeCreatedInteractableObjectType(int t) { InteractableObjectType type = (InteractableObjectType)t; Debug.LogFormat("GameManager ChangeCreatedInteractableObjectType: Changing object type to {0}", type); ObjectManager.Instance.CurrentCreatableObjectType = type; }
public InteractableObject(int entryId, WowMapId mapId, WowZoneId zoneId, Vector3 position, InteractableObjectType objectType, MailboxFactionType factionType = MailboxFactionType.None) { EntryId = entryId; MapId = mapId; ZoneId = zoneId; Position = position; ObjectType = objectType; FactionType = factionType; }
protected override void displayForm() { formScrollPos = EditorGUILayout.BeginScrollView(formScrollPos); EditorGUILayout.BeginVertical(); GUI.enabled = false; databaseID = EditorGUILayout.IntField("Database ID : ", databaseID); GUI.enabled = true; itemName = EditorGUILayout.TextField("Name : ", itemName); itemIcon = (Sprite)EditorGUILayout.ObjectField("Icon : ", itemIcon, typeof(Sprite), false); itemModel = (GameObject)EditorGUILayout.ObjectField("Model : ", itemModel, typeof(GameObject), false); isConsomable = EditorGUILayout.Toggle("Is Consomable : ", isConsomable); isStackable = EditorGUILayout.Toggle("Is Stackable : ", isStackable); if (isStackable) { maxStackableSize = EditorGUILayout.IntField("Max stack size : ", maxStackableSize); } canBeRecycle = EditorGUILayout.Toggle("Can be recycle : ", canBeRecycle); interactableType = (InteractableObjectType)EditorGUILayout.EnumPopup("Interactible type : ", interactableType); itemType = (ItemType)EditorGUILayout.EnumPopup("Item type : ", itemType); targetType = (ItemTargetType)EditorGUILayout.EnumPopup("Target type : ", targetType); numberOfEffect = EditorGUILayout.IntField("Number Of effect :", numberOfEffect); updateEffectsListsSize(numberOfEffect); if (numberOfEffect != 0) { for (int i = 0; i < numberOfEffect; i++) { EditorGUILayout.LabelField("Effect n° " + i + " : ", centerTitle); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Effect :"); effectsIndex[i] = EditorGUILayout.Popup(effectsIndex[i], EffectList.getEffectsNames()); effects[i].effect = EffectList.effects[effectsIndex[i]]; EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Value :"); effects[i].value = EditorGUILayout.FloatField(effects[i].value); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Starting time :"); effects[i].usedBy = (EffectUseBy)EditorGUILayout.EnumPopup(effects[i].usedBy); EditorGUILayout.EndHorizontal(); } } displayFormButtons(); EditorGUILayout.EndVertical(); EditorGUILayout.EndScrollView(); }
private T GetInteractableObject <T>(InteractableObjectType type) where T : class { var interactableObjects = _context.GetTriggers(type); T behaviour = default; foreach (var trigger in interactableObjects) { if (trigger.IsInteractable) { behaviour = trigger as T; } } return(behaviour); }
private T GetInteractableObject <T>(InteractableObjectType type) where T : class { var interactableObjects = _context.GetTriggers(type); T behaviour = default; foreach (var trigger in interactableObjects) { if (trigger.IsInteractable) { CustomDebug.Log(trigger.Description); } } return(behaviour); }
protected override void clearForm() { base.clearForm(); element = null; databaseID = database.getFreeId(); itemName = ""; itemIcon = null; itemModel = null; isConsomable = true; isStackable = true; canBeRecycle = false; maxStackableSize = 10; numberOfEffect = 0; interactableType = default; targetType = default; effects = new List <ItemEffectAndValue>(); }
public void AddTriggers(InteractableObjectType type, ITrigger trigger) { if (!_interactables.Contains(trigger)) { _interactables.Add(trigger); } if (_onTriggers.ContainsKey(type)) { _onTriggers[type].Add(trigger); } else { _onTriggers.Add(type, new List <IInteractable> { trigger }); } trigger.DestroyHandler = DestroyHandler; AddObjectHandler.Invoke(trigger); }
public void AddTriggers(InteractableObjectType InteractionType, ITrigger TriggerInterface) { if (!_interactables.Contains(TriggerInterface)) { _interactables.Add(TriggerInterface); } if (_onTriggers.ContainsKey(InteractionType)) { _onTriggers[InteractionType].Add(TriggerInterface); } else { _onTriggers.Add(InteractionType, new List <IInteractable> { TriggerInterface }); } TriggerInterface.DestroyHandler = DestroyHandler; AddObjectHandler.Invoke(TriggerInterface); }
public List <IInteractable> GetTriggers(InteractableObjectType type) { return(_onTriggers.ContainsKey(type) ? _onTriggers[type] : _onTriggers[type] = new List <IInteractable>()); }
public List <T> GetTriggers <T>(InteractableObjectType type) where T : class, IInteractable { return(_onTriggers.ContainsKey(type) ? _onTriggers[type].Select(trigger => trigger as T).ToList() : null); }
private void DestroyHandler(ITrigger obj, InteractableObjectType type) { _onTriggers[type].Remove(obj); _interactables.Remove(obj); }
private void DestroyHandler(ITrigger TriggerInterface, InteractableObjectType InteractionType) { _onTriggers[InteractionType].Remove(TriggerInterface); _interactables.Remove(TriggerInterface); }
public void addInteraction(InteractableObjectType interactionType, PlayerInteraction interact, InputAction inputAction) { playerInteractionTable.Add(new InteractionTableItem(interactionType, interact, inputAction)); }
public InteractionTableItem(InteractableObjectType interactionType, PlayerInteraction interact, InputAction inputAction) { this.interactionType = interactionType; this.interact = interact; this.inputAction = inputAction; }