private void RespondToMessage(NewPrefabWasActivatedMessage message) { if (Inspector.Get().ActiveInspectorGUIIdentifier == InspectorGUIIdentifier.ObjectSnapping || Inspector.Get().ActiveInspectorGUIIdentifier == InspectorGUIIdentifier.ObjectPlacement) { DestroyIfExists(); CreateFromActivePrefabIfNotExists(); } }
public void RandomizeActivePrefab() { if (NumberOfPrefabs != 0) { int prefabIndex = UnityEngine.Random.Range(0, NumberOfPrefabs); Prefab newActivePrefab = GetPrefabByIndex(prefabIndex); _prefabs.MarkEntity(newActivePrefab); NewPrefabWasActivatedMessage.SendToInterestedListeners(newActivePrefab); } }
public void SetActivePrefab(Prefab newActivePrefab) { if (newActivePrefab != null && !ContainsPrefab(newActivePrefab)) { return; } if (PrefabActivationValidationCallback != null && !PrefabActivationValidationCallback(newActivePrefab)) { return; } _prefabs.MarkEntity(newActivePrefab); NewPrefabWasActivatedMessage.SendToInterestedListeners(newActivePrefab); }
public static void SendToInterestedListeners(Prefab newActivePrefab) { var message = new NewPrefabWasActivatedMessage(newActivePrefab); MessageListenerDatabase.Instance.SendMessageToInterestedListeners(message); }
private void RespondToMessage(NewPrefabWasActivatedMessage message) { Repaint(); }