Exemplo n.º 1
0
        private bool FirePlugin(Type type, int level)
        {
            SpaceAddonMonoBehaviour atr = AttributeUtils.GetTypeAttribute <SpaceAddonMonoBehaviour>(type);

            if (atr != null)
            {
                if ((int)atr.EntryPoint == level)
                {
                    GameObject go = new GameObject(type.Name);
                    go.transform.position = Vector3.zero;
                    go.transform.rotation = Quaternion.identity;
                    go.AddComponent(type);

                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 2
0
        private bool FirePlugin(Type type)
        {
            int currentScene = SceneManager.GetActiveScene().buildIndex;

            SpaceAddonMonoBehaviour atr = AttributeUtils.GetTypeAttribute <SpaceAddonMonoBehaviour>(type);

            if (atr != null)
            {
                if ((int)atr.EntryPoint == currentScene)
                {
                    GameObject go = new GameObject(type.Name);
                    go.transform.position = Vector3.zero;
                    go.transform.rotation = Quaternion.identity;
                    go.AddComponent(type);

                    return(true);
                }
            }

            return(false);
        }