// Start is called before the first frame update
 void Start()
 {
     spawnManagerScript    = GameObject.Find("Game Manager").GetComponent <SpawnManager>();
     teleportManagerScript = GameObject.Find("Teleport Manager").GetComponent <TeleportManager>();
     pauseMenuScript       = GameObject.Find("Pause Menu Canvas").GetComponent <PauseMenu>();
     actionsText           = GameObject.Find("Actions Text").GetComponent <TextMeshProUGUI>();
 }
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
 void Destroy()
 {
     if (Instance == this)
     {
         Instance = null;
     }
 }
Exemple #4
0
 public void Initialize(DalamudPluginInterface pluginInterface)
 {
     Interface = pluginInterface;
     Config    = pluginInterface.GetPluginConfig() as Configuration ?? new Configuration();
     Config.Initialize(pluginInterface);
     AetheryteDataManager.Init(pluginInterface);
     Manager = new TeleportManager(this);
     Interface.CommandManager.AddHandler("/tp", new CommandInfo(CommandHandler)
     {
         HelpMessage = "<name> - Teleport to <name>"
     });
     Interface.CommandManager.AddHandler("/tpt", new CommandInfo(CommandHandler)
     {
         HelpMessage = "<name> - Teleport to <name> using Aetheryte Tickets if possible"
     });
     Interface.CommandManager.AddHandler("/tpm", new CommandInfo(CommandHandler)
     {
         HelpMessage = "<mapname> - Teleport to <mapname>"
     });
     Interface.CommandManager.AddHandler("/tptm", new CommandInfo(CommandHandler)
     {
         HelpMessage = "<mapname> - Teleport to <mapname> using Aetheryte Tickets if possible"
     });
     Gui = new PluginUi(this);
     Interface.Framework.Gui.Chat.OnChatMessage += Gui.LinksWindow.ChatOnChatMessage;
 }
Exemple #5
0
 // Start is called before the first frame update
 void Start()
 {
     rb = GetComponent <Rigidbody2D>();
     teleportManagerScript = GameObject.Find("Teleport Manager").GetComponent <TeleportManager>();
     spawnManagerScript    = GameObject.Find("Game Manager").GetComponent <SpawnManager>();
     pauseMenuScript       = GameObject.Find("Pause Menu Canvas").GetComponent <PauseMenu>();
 }
 private void Start()
 {
     buttonPos.line            = line;
     buttonPos.column          = column;
     _lvlGeneratorReference    = GameObject.Find("LevelGenerator").GetComponent <LevelGenerator>();
     _teleportManagerReference = GameObject.Find("TeleportManager").GetComponent <TeleportManager>();
 }
Exemple #7
0
        private void SetupTeleported()
        {
            var      tpList = TeleportManager.GetTeleportList(ChunkNumber);
            GameUnit unit   = null;

            foreach (var npcName in tpList)
            {
                var pos2Int = GetFreePos();
                var pos3Int = new Vector3Int(pos2Int.x, pos2Int.y, 1);
                if (npcName.Contains("npc"))
                {
                    unit = SetupUnit(npcName, pos3Int, PlayersManager.GetMyPlayer());
                }
                else if (npcName.Contains("item") || npcName.Contains("building"))
                {
                    SetupItem(npcName, pos3Int, PlayersManager.GetMyPlayer());
                }
            }

            if (unit != null)
            {
                CameraMove.SetCameraAt(new Vector2Int(unit.CurrentPos.x, unit.CurrentPos.y));
            }
            TeleportManager.SetTeleported(ChunkNumber);
        }
	void Start () {
        //theres olny one Gamemanager Obj during the lifetime of the game so we olny need to find the manager component once and we store it in a static variable(Class Variable).
        if(manager == null)
        {
            manager = GameObject.Find("GameManager").GetComponent<TeleportManager>();
        }
	}
 void Start()
 {
     //theres olny one Gamemanager Obj during the lifetime of the game so we olny need to find the manager component once and we store it in a static variable(Class Variable).
     if (manager == null)
     {
         manager = GameObject.Find("GameManager").GetComponent <TeleportManager>();
     }
 }
    private void Start()
    {
        //_colectableToSpawn = GameObject.Find
        _lvlGeneratorReference = GameObject.Find("LevelGenerator").GetComponent <LevelGenerator>();
        _teleportReference     = GameObject.Find("TeleportManager").GetComponent <TeleportManager>();

        roomPos.column = GetRoomColumn();
        roomPos.line   = GetRoomLine();
    }
Exemple #11
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Exemple #12
0
    // Start is called before the first frame update
    void Start()
    {
        playerMng = PlayerManager.instance;
        pauseMenu = PauseMenuManager.instance;
        teleport  = TeleportManager.instance;
        tracker   = ProgressionTracker.instance;
        collider  = GetComponent <CircleCollider2D>();

        teleportPosition = transform.position;
        teleporter       = GetComponent <Teleporter>();
    }
 private void Awake()    //Singleton
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
 void OnTriggerEnter(Collider c)
 {
     if (active && destination != null && !skipOne)
     {
         if ((targetTag != "" && c.transform.root.tag == targetTag) || (target != null && c.transform.root == target))
         {
             c.transform.root.position = destination.position + (c.transform.root.position - transform.position);
             TeleportManager tm = destination.transform.GetComponent <TeleportManager> ();
             if (tm)
             {
                 tm.skipOne = true;
             }
         }
     }
 }
Exemple #15
0
        public override void Initialize()
        {
            _prefabIdentifier = GetComponent <PrefabIdentifier>().Id ?? GetComponentInParent <PrefabIdentifier>().Id;
            _spinTitle        = Animator.StringToHash("SpinTitle");

            var target = gameObject.FindChild("targetPos");

            if (target == null)
            {
                QuickLogger.Error("Cant find trigger targetPos");
                return;
            }

            if (_buildable == null)
            {
                _buildable = GetComponentInParent <Constructable>() ?? GetComponent <Constructable>();
            }

            if (ColorManager == null)
            {
                ColorManager = new ColorManager();
            }

            ColorManager.Initialize(gameObject, QuantumTeleporterBuildable.BodyMaterial);

            TeleportManager.Initialize();

            if (NameController == null)
            {
                NameController = gameObject.EnsureComponent <NameController>();
            }


            if (AnimationManager == null)
            {
                AnimationManager = gameObject.GetComponent <AnimationManager>();
            }

            if (DisplayManager == null)
            {
                DisplayManager = gameObject.GetComponent <QTDisplayManager>();
            }

            if (SubRoot == null)
            {
                SubRoot = GetComponentInParent <SubRoot>();
            }

            if (Manager == null)
            {
                Manager = BaseManager.FindManager(SubRoot);
            }

            if (AudioManager == null)
            {
                AudioManager = new AudioManager(gameObject.GetComponent <FMOD_CustomLoopingEmitter>());
            }

            AudioManager.LoadFModAssets("/env/use_teleporter_use_loop", "use_teleporter_use_loop");

            if (PowerManager == null)
            {
                PowerManager = new QTPowerManager(this);
            }

            //var pingInstance = gameObject.GetComponent<PingInstance>() ??
            //                   gameObject.GetComponentInChildren<PingInstance>();

            //if (QTPingManager == null)
            //    QTPingManager = new QTPingManager();

            //QTPingManager.Initialize(pingInstance);

            DisplayManager.Setup(this);

            NameController.Initialize(QuantumTeleporterBuildable.Submit(), Mod.FriendlyName);
            NameController.SetCurrentName(GetNewName(), DisplayManager.GetNameTextBox());
            NameController.OnLabelChanged += OnLabelChanged;
            Manager.OnBaseUnitsChanged    += OnBaseUnitsChanged;
            AddToManager();

            AnimationManager.SetBoolHash(_spinTitle, true);

            if (QTDoorManager == null)
            {
                QTDoorManager = gameObject.FindChild("model").FindChild("anims").FindChild("door").AddComponent <QTDoorManager>();
            }
            QTDoorManager.Initalize(this);

            var trigger = target.AddComponent <QTTriggerBoxManager>();

            trigger.OnPlayerExit += QTDoorManager.OnPlayerExit;
            _target = target.transform;

            IsInitialized = true;
        }
Exemple #16
0
 internal static void Postfix(ref Player __instance)
 {
     TeleportManager.Update();
 }
 private void Awake()
 {
     instance = this;
 }
 private void Start()
 {
     teleport = teleport ?? gameObject.AddComponent <TeleportManager>();
 }
Exemple #19
0
 // Start is called before the first frame update
 void Start()
 {
     teleport = FindObjectOfType <TeleportManager>();
     this.transform.position = cameraPosition.transform.position;
 }
Exemple #20
0
 void Start()
 {
     teleportManager = FindObjectOfType <TeleportManager>();
 }