Skip to content
This repository has been archived by the owner on Sep 30, 2019. It is now read-only.

Commit

Permalink
Reformatted code.
Browse files Browse the repository at this point in the history
  • Loading branch information
xyonico committed May 22, 2018
1 parent 16dc793 commit 9a3c096
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions CameraPlus/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Plugin : IPlugin
public static readonly Ini Ini = new Ini(Path.Combine(Environment.CurrentDirectory, "cameraplus.cfg"));
private bool _init;
private FileSystemWatcher _iniWatcher;

public string Name
{
get { return "Camera+"; }
Expand All @@ -24,7 +24,7 @@ public string Version
{
get { return "v1.0"; }
}

public void OnApplicationStart()
{
if (_init) return;
Expand All @@ -36,16 +36,16 @@ public void OnApplicationStart()
Ini.WriteValue("positionSmooth", "10.0");
Ini.WriteValue("rotationSmooth", "5.0");

Ini.WriteValue("posx", "0.0");
Ini.WriteValue("posy", "2.0");
Ini.WriteValue("posz", "-1.0");
Ini.WriteValue("posx", "0.0");
Ini.WriteValue("posy", "2.0");
Ini.WriteValue("posz", "-1.0");

Ini.WriteValue("rotw", "1.0");
Ini.WriteValue("rotx", "0.25");
Ini.WriteValue("roty", "0.0");
Ini.WriteValue("rotz", "0.0");
Ini.WriteValue("rotw", "1.0");
Ini.WriteValue("rotx", "0.25");
Ini.WriteValue("roty", "0.0");
Ini.WriteValue("rotz", "0.0");

Ini.WriteValue("fixed", "false");
Ini.WriteValue("fixed", "false");
Ini.Save();
}

Expand All @@ -71,11 +71,13 @@ private void SceneManagerOnActiveSceneChanged(Scene arg0, Scene scene)
{
Object.Destroy(_cameraPlus.gameObject);
}

var mainCamera = Object.FindObjectsOfType<Camera>().FirstOrDefault(x => x.CompareTag("MainCamera"));
if (mainCamera == null)
{
return;
}

var gameObj = new GameObject("CameraPlus");
CameraPlusBehaviour.MainCamera = mainCamera;
_cameraPlus = gameObj.AddComponent<CameraPlusBehaviour>();
Expand All @@ -90,22 +92,18 @@ private void IniWatcherOnChanged(object sender, FileSystemEventArgs fileSystemEv

public void OnLevelWasLoaded(int level)
{

}

public void OnLevelWasInitialized(int level)
{

}

public void OnUpdate()
{

}

public void OnFixedUpdate()
{

}
}
}

0 comments on commit 9a3c096

Please sign in to comment.