Giter VIP home page Giter VIP logo

sssystem's People

Contributors

anh-pham-kayac avatar anhpham avatar quan-nguyen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sssystem's Issues

OnShow() method of SSController is called before Awake(), Start() methods.

In my app, OnShow() method of SSSController is called before Awake(), Start() methods so I'm getting null reference error.
( I get a reference to a gameobject in Awake() and use the gameobject in Start() and OnShow()).,

I put logging in your demo app to make sure, then OnShow() is called after Awake() but before Start().

using UnityEngine;
using System.Collections;

public class DemoScreen1 : SSController
{
    public void OnNextButtonTap()
    {
        SSSceneManager.Instance.AddScreen("DemoScreen2");
    }

    public override void Awake()
    {
        Debug.Log ("Awake *********************************************************");
        base.Awake ();
    }

    public override void Start()
    {
        Debug.Log ("Start *********************************************************");
        base.Start ();
    }

    public override void OnShow()
    {
        Debug.Log ("OnShow *********************************************************");
        base.OnShow ();
    }

}

Please fix it so the order is always Awake(), Start() then OnShow()...

Thanks.

Weird behavior with Unity 5.5

Hi there,

Let me report a weird behavior I found with Unity 5.5.

gameObject.name = Path.GetFileNameWithoutExtension(UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene().name);

Although the name of the gameobject is updated in Hierarchy of UnityEditor with the code above, it (the name of the gameobject) is somehow NOT saved internally so SSSystem calls SSApplication#OnLoaded with the gameobject having its old name.
Then it causes "KeyNotFoundException: The given key was not present in the dictionary." at the following code.

if (m_OnLoaded[root.name] != null)

Thanks.

a bunch of SSEmpty.unity scenes in Build Settings on Windows.

Everytime when I open a scene attached SSSceneManager.cs in Unity Editor, SSEmpty.unity is added to Build Settings so It ends up with the full of SSEmpty.unity scenes.

At line 1931 of SSSceneManager.cs, string emptyScene = SSFile.GetPathTemplateFile("SSEmpty.unity");

The directory separator in the emptyScene is (backslash) on Windows OS but one in the scene in EditorBuildSettings.scenes is /(slash) even on Windows OS.
So "if (scene.path.CompareTo(emptyScene) == 0) { return; }" is always failed on Windows OS and SSEmpty.unity is added to the Build Settings.

plz do something like emptyScene = emptyScene.Replace('', '/'); at line 1932 to normalize.

Thanks for this great framework !

Load scenes from AssetBundle

Hi there,

Unity's official asset, AssetBundle Manager, supports loading a scene from AssetBundle by something like 'yield return StartCoroutine( AssetBundleManager.LoadLevelAsync ("test", "sample", false));'.
https://www.assetstore.unity3d.com/jp/#!/content/45836

Do you have any plans to support AssetBundleManager.LoadLevelAsync(...) to load a scene in SSSystem ?
I wish you will...please :)

Cheers

Not issue but question.

I'm kinda wondering where I should put codes to clean up resources used in my popup windows and screens.
I used to disconnect a database connection in the OnDisable method of a derived class of SSController (used as a popup)
but found out the memory was leaking.
That was because the OnDisable method never gets called even though the popup is closed or no matter IsCache flag is true or false.
Thus, I tested which methods are called when they're opened, closed with the IsCache flag is true or false.

โ–  Opening a popup window using SSSceneManager#PopUp method.

** SSController.IsCache = true

  • When the popup is opened for the first time :
    Awake
    OnSet (data = ...)
    OnFocus (isFocus = True)
    OnShow
  • When the popup is closed :
    OnFocus (isFocus = False)
    OnHide
  • When the popup is opened again :
    Awake
    OnSet (data = ...)
    OnFocus (isFocus = True)
    OnShow

** SSController.IsCache = false

  • When the popup is opened for the first time :
    Awake
    OnSet (data = ...)
    OnFocus (isFocus = True)
    OnShow
  • When the popup is closed :
    OnFocus (isFocus = False)
    OnHide
  • When the popup is opened again :
    OnSet (data = ...)
    OnFocus (isFocus = True)
    OnShow

Summary

  1. The difference between them is only the Awake method is called or not when the popup is opened again.
  2. The Start method of a derived class of SSController is not called even though the derived one overrides the Start method. This is really weird and I don't know why... Do you know ?
  3. Disable method never gets called.

โ–  Opening a screen using SSSceneManager#AddScreen method.

** SSController.IsCache = true

  • When the screen is opened for the first time :
    Awake
    OnEnable
    OnSet (data = ...)
    Start
    OnEnableFS
    OnFocus (isFocus = True)
    OnShow
  • When the screen is closed :
    OnFocus (isFocus = False)
    OnHide
    OnDisable
  • When the screen is opened again :
    OnEnable
    OnEnableFS
    OnSet (data = ...)
    OnFocus (isFocus = True)
    OnShow

** SSController.IsCache = false

  • When the screen is opened for the first time :
    Awake
    OnEnable
    OnSet (data = ...)
    Start
    OnEnableFS
    OnFocus (isFocus = True)
    OnShow
  • When the screen is closed :
    OnFocus (isFocus = False)
    OnHide
    OnDisable
  • When the screen is opened again :
    OnEnable
    OnEnableFS
    OnSet (data = ...)
    OnFocus (isFocus = True)
    OnShow

Summary

  1. They are exactly the same. Doesn't IsCache flag work since the screen is created by AddScreen method ?
  2. Start, OnDisable method is called unlike a popup.

So, only Awake, OnFocus, OnShow and OnHide methods are always called in all cases,
are they the right places to put initialization and cleanup codes you recommend ?

Request

Hi there,

This is a feature request.
I'd like to have a method of SSSceneManager which returns a scene name currently shown on the display and hopefully its state (currently shown, closing, loading, preparing to show or something else)

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.