cnsoft / FSceneManager

SceneManager for Futile, a Unity framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FSceneManager

SceneManager for Futile, a Unity framework.

todo

  • Complete loading of tilemaps. Data and tilesets are loaded, but tilelayers are incomplete.
  • Add transitions for switching scenes.
  • Switch Virtual functions to Actions

how-to example

Game.cs

FSceneManager.Instance.SetScene(new SceneStartup());

SceneStartup.cs

using System;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class SceneStartup : FScene
{
	FLayer mLayer;
	
	public SceneStartup()
	{
		mPaused = false;
		
		mLayer = new LayerStartup(this);
		this.AddChild(mLayer);
	}
}

LayerStartup.cs

using System;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class LayerStartup : FLayer
{
	public LayerStartup(FScene _parent) : base(_parent)
	{
		
	}
	
	override public void OnEnter()
	{
		
	}
    
	override public void OnUpdate()
	{
		if(mParent.Paused)
			return;
		
		FSceneManager.Instance.SetScene(new SceneGame());
	}
	
	override public void OnExit()
	{
		
	}
}

Thanks

About

SceneManager for Futile, a Unity framework.