Пример #1
0
        // Called when the Plugin is selected
        public void OnActivate(PluginCameraHelper helper)
        {
            PluginLog.Log("ActionCameraPlugin", "OnActivate");
            timerHelper = new TimerHelper();
            ConfigUtility utility = new ConfigUtility(_settings.configurationName);

            cameraDirector = new ActionCameraDirector(utility.Config, helper, ref timerHelper);

            AvatarManager avatarManager = Resources.FindObjectsOfTypeAll <AvatarManager>().FirstOrDefault();

            avatarRefSignal = avatarManager?.GetPrivateField <AvatarReferenceSignal>("_avatarInstantiated");
            avatarRefSignal?.OnChanged.AddListener(OnAvatarChanged);

            OnAvatarChanged(avatarRefSignal?.Value);
        }
Пример #2
0
        public ActionCameraDirector(ActionCameraConfig pluginSettings, PluginCameraHelper helper, ref TimerHelper timerHelper)
        {
            this.player         = new LivPlayerEntity(helper, ref timerHelper);
            this.timerHelper    = timerHelper;
            this.cameraHelper   = helper;
            this.pluginSettings = pluginSettings;

            randomizer = new System.Random();
            player.SetOffsets(pluginSettings.forwardHorizontalOffset, pluginSettings.forwardVerticalOffset, pluginSettings.forwardDistance);

            OverShoulderCamera   = new ShoulderActionCamera(pluginSettings);
            FullBodyActionCamera = new FullBodyActionCamera(pluginSettings);
            FPSCamera            = new FPSCamera(pluginSettings, 0.2f);
            TacticalCamera       = new TopDownActionCamera(pluginSettings, 0.6f, 6f);

            SetCamera(OverShoulderCamera);
        }
Пример #3
0
 public LivPlayerEntity(PluginCameraHelper helper, ref TimerHelper timerHelper)
 {
     this.pluginCameraHelper = helper;
     this.timerHelper        = timerHelper;
 }