37 lines
1 KiB
C#
37 lines
1 KiB
C#
using System;
|
|
using RobocraftX.GUI.CommandLine;
|
|
using RobocraftX.Multiplayer;
|
|
using RobocraftX.StateSync;
|
|
using RobocraftX.Character;
|
|
using Svelto.ECS;
|
|
using Unity.Entities;
|
|
using UnityEngine;
|
|
using uREPL;
|
|
using Svelto.Context;
|
|
using RobocraftX;
|
|
|
|
namespace ExtraCommands.Basics
|
|
{
|
|
[CustomCommand("SetFieldOfView")]
|
|
class SetFOVCommandEngine : CustomCommandEngine
|
|
{
|
|
public SetFOVCommandEngine(UnityContext<FullGameCompositionRoot> ctxHolder, EnginesRoot enginesRoot, World physW, Action reloadGame, MultiplayerInitParameters mpParams) : base(ctxHolder, enginesRoot, physW, reloadGame, mpParams)
|
|
{
|
|
}
|
|
|
|
public override void Ready()
|
|
{
|
|
CustomCommandUtility.Register<float>("SetFieldOfView", SetFieldOfViewCommand, "Set the camera's field of view");
|
|
}
|
|
|
|
private void SetFieldOfViewCommand(float newFoV)
|
|
{
|
|
Camera.main.fieldOfView = newFoV;
|
|
}
|
|
|
|
public override void Dispose()
|
|
{
|
|
CustomCommandUtility.Unregister("SetFieldOfView");
|
|
}
|
|
}
|
|
}
|