|
- using Svelto.ECS;
- using UnityEngine;
- //using Svelto.Context;
-
- using GamecraftModdingAPI.Commands;
-
- namespace ExtraCommands.Basics
- {
- [CustomCommand("SetFieldOfView")]
- class SetFOVCommandEngine : ICustomCommandEngine
- {
- public string Description => "Set the camera's field of view";
-
- public string Name => "SetFieldOfView";
-
- public EntitiesDB entitiesDB { set; private get; }
-
- public bool isRemovable => true;
-
- public void Ready()
- {
- CommandRegistrationHelper.Register<float>(Name, SetFieldOfViewCommand, Description);
- }
-
- private void SetFieldOfViewCommand(float newFoV)
- {
- Camera.main.fieldOfView = newFoV;
- }
-
- public void Dispose()
- {
- CommandRegistrationHelper.Unregister(Name);
- }
- }
- }
|