Playmaker Forum
PlayMaker Updates & Downloads => Share New Actions => Topic started by: Groo Gadgets 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!
// (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
-
Works very good, thanks!
-
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.
-
Looks like it works fine Unity 5.23