Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,ShortName,ControllerName,AOTableName,CreationDate,Notes")] AOType aOType)
        {
            if (id != aOType.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    aOType.LastEditDate = DateTime.Now;

                    _context.Update(aOType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AOTypeExists(aOType.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(aOType));
        }
 private void OnEnable()
 {
     _cam            = Camera.main;
     sampleDirs_HBAO = null;
     InitAOData();
     oldType = _AOType;
 }
Beispiel #3
0
 public PCIe6323(string deviceName, AIReadTriggerType aiReadTrigger)
 {
     AI            = new AIType(deviceName);
     AO            = new AOType(deviceName);
     DO            = new DOType(deviceName);
     CO            = new COType(deviceName);
     _deviceName   = deviceName;
     AiReadTrigger = aiReadTrigger;
 }
Beispiel #4
0
        public async Task <IActionResult> Create([Bind("ID,Name,ShortName,ControllerName,AOTableName,Notes")] AOType aOType)
        {
            if (ModelState.IsValid)
            {
                aOType.CreationDate = DateTime.Now;

                _context.Add(aOType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(aOType));
        }
 // Update is called once per frame
 void Update()
 {
     if (oldType != _AOType)
     {
         InitAOData();
         oldType = _AOType;
     }
     if (oldsampleDirNum != sampleDirNum)
     {
         GenerateSampleDir_HBAO();
         oldsampleDirNum = sampleDirNum;
     }
 }
    public void Update_AO(Camera mainCamera, bool enabled, AOType aoType, float aoRadius, float aoIntensity, bool ambientOnly, Color aoColor, AmbientOcclusionQuality aoQuality)
    {
        AmbientOcclusion ao;

        GameObject.Find("Post Processing Global Volume").GetComponent <PostProcessVolume>().sharedProfile.TryGetSettings(out ao);

        if (enabled)
        {
            if (aoType == AOType.Classic)
            {
                ao.enabled.overrideState     = true;
                ao.enabled.value             = true;
                ao.mode.overrideState        = true;
                ao.mode.value                = AmbientOcclusionMode.ScalableAmbientObscurance;
                ao.radius.overrideState      = true;
                ao.radius.value              = aoRadius;
                ao.ambientOnly.overrideState = true;
                ao.ambientOnly.value         = ambientOnly;
                ao.color.overrideState       = true;
                ao.color.value               = aoColor;
                ao.intensity.overrideState   = true;
                ao.intensity.value           = aoIntensity;
                ao.quality.overrideState     = true;
                ao.quality.value             = aoQuality;
            }
            if (aoType == AOType.Modern)
            {
                ao.enabled.overrideState     = true;
                ao.enabled.value             = true;
                ao.mode.overrideState        = true;
                ao.mode.value                = AmbientOcclusionMode.MultiScaleVolumetricObscurance;
                ao.radius.overrideState      = true;
                ao.radius.value              = aoRadius;
                ao.ambientOnly.overrideState = true;
                ao.ambientOnly.value         = ambientOnly;
                ao.color.overrideState       = true;
                ao.color.value               = aoColor;
                ao.intensity.overrideState   = true;
                ao.intensity.value           = aoIntensity;
            }
        }
        else
        {
            ao.enabled.overrideState = true;
            ao.enabled.value         = false;
        }
    }
    public float attenuation_Plus = 2; //衰减系数

    // Start is called before the first frame update
    void Start()
    {
        _cam = Camera.main;
        InitAOData();
        oldType = _AOType;
    }
 public AnalogOutputControl(ushort index, decimal value, AOType type)
 {
     Index = index;
     Value = value;
     Type  = type;
 }