Ejemplo n.º 1
0
 private void Awake()
 {
     gameState   = Utils.FindNovaGameController().GetComponent <GameState>();
     audioSource = GetComponent <AudioSource>();
     LuaRuntime.Instance.BindObject(audioControllerName, this);
     gameState.AddRestorable(this);
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     _spriteChanger = GetComponent <SpriteChangerWithFade>();
     LuaRuntime.Instance.BindObject("backgroundController", this);
     gameState = Utils.FindNovaGameController().GetComponent <GameState>();
     gameState.AddRestorable(this);
 }
Ejemplo n.º 3
0
        protected override void Awake()
        {
            base.Awake();

            var controller = Utils.FindNovaGameController();

            gameState         = controller.GameState;
            checkpointManager = controller.CheckpointManager;
            configManager     = controller.ConfigManager;

            scrollRect = myPanel.GetComponentInChildren <ScrollRect>();
            logContent = scrollRect.transform.Find("Viewport/Content").gameObject;

            myPanel.GetComponent <Button>().onClick.AddListener(Hide);

            gameState.DialogueWillChange += OnDialogueWillChange;
            gameState.DialogueChanged    += OnDialogueChanged;
            gameState.AddRestorable(this);

            closeButton.onClick.AddListener(Hide);

            previousVariablesHash = "";

            lastCheckpointLogParamsRef = null;
        }
Ejemplo n.º 4
0
        private void Awake()
        {
            Current = this;

            var text = Resources.Load <TextAsset>("LocalizedResourcePaths");

            if (text)
            {
                LocalizedResourcePaths.UnionWith(text.text.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries));
            }

            cachedAssets = new Dictionary <AssetCacheType, LRUCache <string, CachedAssetEntry> >
            {
                [AssetCacheType.Image]         = new LRUCache <string, CachedAssetEntry>(20, true),
                [AssetCacheType.StandingLayer] = new LRUCache <string, CachedAssetEntry>(20, true),
                [AssetCacheType.Prefab]        = new LRUCache <string, CachedAssetEntry>(1, true),
                [AssetCacheType.Audio]         = new LRUCache <string, CachedAssetEntry>(4, true)
            };

            gameState = Utils.FindNovaGameController().GameState;
            gameState.AddRestorable(this);

            Application.lowMemory += UnloadUnusedAndCachedAssets;
            I18n.LocaleChanged.AddListener(OnLocaleChanged);
        }
Ejemplo n.º 5
0
 private void Awake()
 {
     LuaRuntime.Instance.BindObject(characterVariableName, this, "_G");
     audioSource = GetComponent <AudioSource>();
     gameState   = Utils.FindNovaGameController().GetComponent <GameState>();
     gameState.DialogueChanged    += OnDialogueChanged;
     gameState.DialogueWillChange += OnDialogueWillChange;
     characterAppearance           = transform.Find("Appearance").gameObject;
     gameState.AddRestorable(this);
 }
Ejemplo n.º 6
0
        protected virtual void Awake()
        {
            gameState = Utils.FindNovaGameController().GameState;

            if (!string.IsNullOrEmpty(luaName))
            {
                LuaRuntime.Instance.BindObject(luaName, this);
                gameState.AddRestorable(this);
            }
        }
Ejemplo n.º 7
0
        private void Awake()
        {
            gameState   = Utils.FindNovaGameController().GameState;
            videoPlayer = GetComponent <VideoPlayer>();

            if (!string.IsNullOrEmpty(luaName))
            {
                LuaRuntime.Instance.BindObject(luaName, this);
                gameState.AddRestorable(this);
            }
        }
Ejemplo n.º 8
0
        private void Awake()
        {
            gameState = Utils.FindNovaGameController().GameState;
            cameraPP  = mainCamera.GetComponent <PostProcessing>();

            if (!string.IsNullOrEmpty(luaName))
            {
                LuaRuntime.Instance.BindObject(luaName, this);
                gameState.AddRestorable(this);
            }
        }
Ejemplo n.º 9
0
        private void Awake()
        {
            gameState    = Utils.FindNovaGameController().GameState;
            meshRenderer = GetComponent <MeshRenderer>();
            meshEnabled  = false;

            if (!string.IsNullOrEmpty(luaGlobalName))
            {
                LuaRuntime.Instance.BindObject(luaGlobalName, this, "_G");
                gameState.AddRestorable(this);
            }
        }
Ejemplo n.º 10
0
        private void Awake()
        {
            gameState = Utils.FindNovaGameController().GameState;

            foreach (var config in autoVoiceConfigs)
            {
                var name = config.characterName;
                nameToConfig[name]  = config;
                nameToEnabled[name] = false;
                nameToIndex[name]   = 0;
            }

            if (!string.IsNullOrEmpty(luaName))
            {
                LuaRuntime.Instance.BindObject(luaName, this);
                gameState.AddRestorable(this);
            }
        }
Ejemplo n.º 11
0
        private void Awake()
        {
            Current = this;

            var text = Resources.Load <TextAsset>("LocalizedResourcePaths").text;

            LocalizedResourcePaths.UnionWith(text.Split('\n'));

            cachedAssets = new Dictionary <AssetCacheType, LRUCache <string, CachedAssetEntry> >
            {
                [AssetCacheType.Image]         = new LRUCache <string, CachedAssetEntry>(autoDestroy: true, maxSize: 20),
                [AssetCacheType.StandingLayer] = new LRUCache <string, CachedAssetEntry>(autoDestroy: true, maxSize: 20),
                [AssetCacheType.Timeline]      = new LRUCache <string, CachedAssetEntry>(autoDestroy: true, maxSize: 1),
                [AssetCacheType.Audio]         = new LRUCache <string, CachedAssetEntry>(autoDestroy: true, maxSize: 4)
            };

            gameState = Utils.FindNovaGameController().GameState;
            gameState.AddRestorable(this);

            Application.lowMemory += UnloadUnusedAndCachedAssets;
            I18n.LocaleChanged.AddListener(OnLocaleChanged);
        }
Ejemplo n.º 12
0
 private void Awake()
 {
     gameState = Utils.FindNovaGameController().GameState;
     gameState.BranchOccurs += OnBranchHappen;
     gameState.AddRestorable(this);
 }
Ejemplo n.º 13
0
 private void Awake()
 {
     gameState = Utils.FindNovaGameController().GameState;
     gameState.selectionOccurs.AddListener(RaiseSelectionsCallback);
     gameState.AddRestorable(this);
 }