public void OnSetCamera(Shot shot) { ShotManager sm = ShotManager.Instance; int shotIndex = sm.GetShotIndex(shot); ShotManagerActionInfo oldInfo = new ShotManagerActionInfo { action = ShotManagerAction.UpdateShot, shotIndex = shotIndex, camera = shot.camera, }; ShotManagerActionInfo info = oldInfo.Copy(); info.camera = CameraManager.Instance.ActiveCamera; new CommandShotManager(oldInfo, info).Submit(); // Update Camera UI Button ShotItem uiItem = GetShotItem(shotIndex); if (null != info.camera) { uiItem.cameraNameLabel.Text = info.camera.name; } else { uiItem.cameraNameLabel.Text = ""; } }
public void OnUpdateShotEnd(Shot shot, float value) { ShotManager sm = ShotManager.Instance; int intValue = Mathf.FloorToInt(value); int startValue = shot.start; if (intValue < startValue) { intValue = startValue; } // Send network message ShotManagerActionInfo oldInfo = new ShotManagerActionInfo { action = ShotManagerAction.UpdateShot, shotIndex = sm.GetShotIndex(shot), shotEnd = shot.end, }; ShotManagerActionInfo info = oldInfo.Copy(); info.shotEnd = intValue; shot.end = intValue; new CommandShotManager(oldInfo, info).Submit(); UpdateShotItemsColors(GlobalState.Animation.CurrentFrame); }
public void OnUpdateShotColor(Shot shot, Color value) { ShotManager sm = ShotManager.Instance; // Send network message ShotManagerActionInfo oldInfo = new ShotManagerActionInfo { action = ShotManagerAction.UpdateShot, shotIndex = sm.GetShotIndex(shot), shotColor = shot.color }; ShotManagerActionInfo info = oldInfo.Copy(); info.shotColor = value; shot.color = value; new CommandShotManager(oldInfo, info).Submit(); }
public void OnUpdateShotName(Shot shot, string value) { ShotManager sm = ShotManager.Instance; // Send network message ShotManagerActionInfo oldInfo = new ShotManagerActionInfo { action = ShotManagerAction.UpdateShot, shotIndex = sm.GetShotIndex(shot), shotName = shot.name }; ShotManagerActionInfo info = oldInfo.Copy(); info.shotName = value; shot.name = value; new CommandShotManager(oldInfo, info).Submit(); OnShotManagerChanged(); }
public void OnUpdateShotEnabled(Shot shot, bool value) { Assert.IsTrue(ShotManager.Instance.ActiveShotIndex >= 0); // TODO: voir si le probleme persiste une fois que le rayon fonctionne. ShotManager sm = ShotManager.Instance; // Send network message ShotManagerActionInfo oldInfo = new ShotManagerActionInfo { action = ShotManagerAction.UpdateShot, shotIndex = sm.GetShotIndex(shot), shotEnabled = shot.enabled ? 1 : 0 }; ShotManagerActionInfo info = oldInfo.Copy(); info.shotEnabled = value ? 1 : 0; shot.enabled = value; new CommandShotManager(oldInfo, info).Submit(); }