Are you sure you want to report the post shown below? This will send an email to the ATVO administrators. Please include a short reason for reporting.
Users reporting for no reason may be locked out.
using System;
using ATVO.ThemesSDK;
using ATVO.ThemeEditor.ThemeModels;
using ATVO.ThemeEditor.Scripting.DotNET;
using ATVO.ThemesSDK.Data.Entity;
namespace Scripts
{
public class ChangeFocus : IScript
{
private IEntity _selectedEntity;
public object Execute(ThemeContentItem item, object value, string parameter, ISimulation sim)
{
var picker = item.Theme.DriverPickers.Find("DriverPicker1");
var entity = picker.SelectedEntity;
// Is anyone selected, and did the selection change?
if (entity != null && entity != _selectedEntity)
{
// Change camera focus
sim.CameraManager.Show(entity);
// Remember this is the newly selected entity
_selectedEntity = entity;
}
return null;
}
}
}