chrisgregan
10 years ago
2 changed files with 65 additions and 0 deletions
@ -0,0 +1,53 @@
|
||||
using UnityEngine; |
||||
using System; |
||||
using System.Collections; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Camera", |
||||
"Fullscreen", |
||||
"Sets the application to fullscreen, windowed or toggles the current state.")] |
||||
[AddComponentMenu("")] |
||||
public class Fullscreen : Command |
||||
{ |
||||
public enum FullscreenMode |
||||
{ |
||||
Toggle, |
||||
Fullscreen, |
||||
Windowed |
||||
} |
||||
|
||||
public FullscreenMode fullscreenMode; |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
switch (fullscreenMode) |
||||
{ |
||||
case FullscreenMode.Toggle: |
||||
Screen.fullScreen = !Screen.fullScreen; |
||||
break; |
||||
case FullscreenMode.Fullscreen: |
||||
Screen.fullScreen = true; |
||||
break; |
||||
case FullscreenMode.Windowed: |
||||
Screen.fullScreen = false; |
||||
break; |
||||
} |
||||
|
||||
Debug.Log("Fullscreen:" + fullscreenMode); |
||||
|
||||
Continue(); |
||||
} |
||||
|
||||
public override string GetSummary() |
||||
{ |
||||
return fullscreenMode.ToString(); |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(216, 228, 170, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2 |
||||
guid: 083836d4b33584c1aaf7d1eb57b02ba0 |
||||
timeCreated: 1434460163 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
Loading…
Reference in new issue