Exemplo n.º 1
0
 private void CopyTo(FirstPersonRotationConfig dest, Shared.Scripts.FirstPersonRotationConfig source)
 {
     dest.HorizontalParam.UpperLimit     = source.HorizontalParam.UpperLimit;
     dest.HorizontalParam.VelCoefficient = source.HorizontalParam.VelCoefficient;
     dest.HorizontalParam.RestoreVel     = source.HorizontalParam.RestoreVel;
     dest.VerticalParam.UpperLimit       = source.VerticalParam.UpperLimit;
     dest.VerticalParam.VelCoefficient   = source.VerticalParam.VelCoefficient;
     dest.VerticalParam.RestoreVel       = source.VerticalParam.RestoreVel;
 }
Exemplo n.º 2
0
        /// <summary>
        /// 第一人称肩射
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public FirstPersonRotationConfig GetFirstPersonSightRotationConofig(int id)
        {
            if (FirstPersonOffsetScript.UpdateOffset)
            {
                var value = new FirstPersonRotationConfig();
                CopyTo(value, FirstPersonOffsetScript.StaticFirstPersonRotation);
                return(value);
            }

            return(GetFristPersonRotationConfigById(id).Item2);
        }
Exemplo n.º 3
0
        static FirstPersonOffsetConfigManager()
        {
            var config = new FirstPersonRotationConfig();

            config.HorizontalParam.UpperLimit     = 4;
            config.HorizontalParam.RestoreVel     = 20;
            config.HorizontalParam.VelCoefficient = 1;
            config.VerticalParam.UpperLimit       = 2;
            config.VerticalParam.RestoreVel       = 10;
            config.VerticalParam.VelCoefficient   = 0.95f;

            _defaultRotationConfig = new Tuple <FirstPersonRotationConfig, FirstPersonRotationConfig>(config, config);
        }
Exemplo n.º 4
0
        private Core.Utils.Tuple <FirstPersonRotationConfig, FirstPersonRotationConfig> CreateRotationTuple(
            FirstPersonOffsetItem data)
        {
            var item1 = new FirstPersonRotationConfig();

            item1.HorizontalParam.UpperLimit     = data.HorizontalUpperLimit;
            item1.HorizontalParam.RestoreVel     = data.HorizontalRestoreVel;
            item1.HorizontalParam.VelCoefficient = data.HorizontalVelCoefficient;
            item1.VerticalParam.UpperLimit       = data.VerticalUpperLimit;
            item1.VerticalParam.RestoreVel       = data.VerticalRestoreVel;
            item1.VerticalParam.VelCoefficient   = data.VerticalVelCoefficient;

            var item2 = new FirstPersonRotationConfig();

            item2.HorizontalParam.UpperLimit     = data.SightHorizontalUpperLimit;
            item2.HorizontalParam.RestoreVel     = data.SightHorizontalRestoreVel;
            item2.HorizontalParam.VelCoefficient = data.SightHorizontalVelCoefficient;
            item2.VerticalParam.UpperLimit       = data.SightVerticalUpperLimit;
            item2.VerticalParam.RestoreVel       = data.SightVerticalRestoreVel;
            item2.VerticalParam.VelCoefficient   = data.SightVerticalVelCoefficient;

            return(new Tuple <FirstPersonRotationConfig, FirstPersonRotationConfig>(item1, item2));
        }