Browse Source

Added Fullscreen command

https://trello.com/c/aA5GQlua
master
chrisgregan 10 years ago
parent
commit
40f2c61a85
  1. 53
      Assets/Fungus/Camera/Scripts/Commands/Fullscreen.cs
  2. 12
      Assets/Fungus/Camera/Scripts/Commands/Fullscreen.cs.meta

53
Assets/Fungus/Camera/Scripts/Commands/Fullscreen.cs

@ -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);
}
}
}

12
Assets/Fungus/Camera/Scripts/Commands/Fullscreen.cs.meta

@ -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…
Cancel
Save