playMaker

Author Topic: Set Antialiasing Level  (Read 5248 times)

Groo Gadgets

  • Beta Group
  • Full Member
  • *
  • Posts: 175
Set Antialiasing Level
« on: August 23, 2012, 10:38:47 PM »
Hey guys,

I've created an action that lets you set the antialiasing level of your game, even at runtime!

Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2012. All rights reserved.

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.RenderSettings)]
[Tooltip("Sets the antialiasing level.")]
public class SetAntialiasingLevel : FsmStateAction
{
[RequiredField]
[Tooltip("AntiAliasing filter can be set to either 0,2,4 or 8. This coresponds to the number of multisamples used per pixel.")]
public FsmInt antialiasingLevel;

public override void Reset()
{
antialiasingLevel = 0;
}

public override void OnEnter()
{
DoSetantialiasingLevel();

}

public override void OnUpdate()
{
DoSetantialiasingLevel();
}

void DoSetantialiasingLevel()
{
QualitySettings.antiAliasing = antialiasingLevel.Value;
}
}
}

Let me know how it goes  :-)

Simon

A3DStudio

  • Playmaker Newbie
  • *
  • Posts: 43
    • A3DStudio
Re: Set Antialiasing Level
« Reply #1 on: August 27, 2012, 01:52:15 AM »
Works very good, thanks!

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: Set Antialiasing Level
« Reply #2 on: July 19, 2015, 12:59:38 AM »
For me it works strange. If I use it once. This value of anti aliasing gets stuck at that number, and changing quality settings doesn't affect anti aliasing anymore. When I set up timer to use this action and set that number let's say in 5 seconds. Game start to act super weird. Last time I did it, it just started blinking.
« Last Edit: July 19, 2015, 02:00:47 AM by Gua »

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: Set Antialiasing Level
« Reply #3 on: December 12, 2015, 09:57:09 AM »
Looks like it works fine Unity 5.23