Exemple #1
0
    public void LoadGame()
    {
        try
        {
            GearManager.instance.SetGears((int)NPBinding.CloudServices.GetLong(GearsKey));
            SwapManager.PlayerIdx     = (int)NPBinding.CloudServices.GetLong(PlayerIdxKey);
            SwapManager.BackgroundIdx = (int)NPBinding.CloudServices.GetLong(BackgroundIdxKey);
            SwapManager.MusicIdx      = (int)NPBinding.CloudServices.GetLong(MusicIdxKey);
            SwapManager.ObstacleIdx   = (int)NPBinding.CloudServices.GetLong(ObstacleIdxKey);
            SwapManager.ProjectileIdx = (int)NPBinding.CloudServices.GetLong(ProjectileIdxKey);

            SwapManager.PlayerUnlocks     = GetUnlocks(PlayerUnlocksKey);
            SwapManager.BackgroundUnlocks = GetUnlocks(BackgroundUnlocksKey);
            SwapManager.MusicUnlocks      = GetUnlocks(MusicUnlocksKey);
            SwapManager.ObstacleUnlocks   = GetUnlocks(ObstacleUnlocksKey);

            SwapManager.AddDefaults();

            player.Score().SetHighscores((int)NPBinding.CloudServices.GetLong(HighscoreKey), (int)NPBinding.CloudServices.GetLong(HighDistanceKey));
            player.InitUnlock();
        }
        catch (Exception e)
        {
            prompt.SetPrompt("Error Getting Data!", "There was a critical error while retreiving your data, try restarting the game.");
        }
    }
Exemple #2
0
    private WeaponManager wm;       //handles weapon swapping

    //Called when script is enabled
    void Start()
    {
        lineRenderer = GetComponent <LineRenderer>();
        fpsCam       = GetComponentInParent <Camera>();
        player       = GameObject.Find("Player");
        sm           = player.GetComponent <SwapManager>();
        wm           = player.GetComponent <WeaponManager>();
    }
Exemple #3
0
 private void Awake()
 {
     swapManager    = FindObjectOfType <SwapManager>();
     inventorySlots = GetComponent <InventorySlotsHandler>();
     if (inventorySlots != null)
     {
         inventorySlots.OnInventoryClosed = RemoveSwappableIfInventoryItem;
     }
 }
Exemple #4
0
    private AudioSource[] source; //Added ArrayList of AudioSources, make sure to add two Audio Sources into a weapon + first one has to be the fire sound, second is reload

    //Called when script is enabled
    void Start()
    {
        lineRenderer = GetComponent <LineRenderer>();
        fpsCam       = GetComponentInParent <Camera>();
        player       = GameObject.Find("Player");
        sm           = player.GetComponent <SwapManager>();
        wm           = player.GetComponent <WeaponManager>();
        source       = GetComponents <AudioSource>();   //Added line here
    }
Exemple #5
0
        public SwapWindow(SwapManager swapManger, bool launchGame)
        {
            _launchGame = launchGame;
            SwapManager = swapManger;

            InitializeComponent();

            InitWindow(launchGame);
        }
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Application.Quit();
     }
 }
 private async void OnSwapReceivedEventHandler(object sender, SwapEventArgs args)
 {
     try
     {
         await SwapManager
         .HandleSwapAsync(args.Swap)
         .ConfigureAwait(false);
     }
     catch (Exception e)
     {
         OnError(TerminalService.Exchange, e);
     }
 }
Exemple #8
0
        private void ButtonRemoveB_OnClick(object sender, RoutedEventArgs e)
        {
            SwapManager.RemoveReserveEntity();
            SubscriptionB = null;

            UpdateTargetB();
            TextBlockPathAlt.GetBindingExpression(TextBlock.TextProperty)?.UpdateTarget();

            HideB();
            ButtonAddB.Visibility    = Visibility.Visible;
            ButtonRemoveB.Visibility = Visibility.Collapsed;

            Settings.Default.ReserveDat = string.Empty;
            Settings.Default.Save();
        }
Exemple #9
0
    //Called when script is enabled
    void Start()
    {
        cur_spr = min_spr;

        lineRenderer = GetComponent <LineRenderer>();
        fpsCam       = GetComponentInParent <Camera>();
        player       = GameObject.Find("Player");
        sm           = player.GetComponent <SwapManager>();
        source       = GetComponents <AudioSource>();   //Added line here
        tracer       = GetComponent <ShootScript>();

        pMenu     = GameObject.Find("UICanvas").transform.Find("PauseMenu").gameObject;
        oMenu     = GameObject.Find("UICanvas").transform.Find("OptionsMenu").gameObject;
        goScreen  = GameObject.Find("UICanvas").transform.Find("GameOverScreen").gameObject;
        winScreen = GameObject.Find("UICanvas").transform.Find("WinScreen").gameObject;
        ammoCount = GameObject.Find("HUD").transform.Find("Ammo Counter").GetComponent <TextMeshProUGUI>();
    }
Exemple #10
0
    public void Initialize()
    {
        swapManager = SwapManager.instance;

        SubscribeFunctionality();

        groundCheck  = transform.GetChild(0);
        whatIsGround = LayerMask.NameToLayer("TransparentFX");

        rigidBody2D  = GetComponent <Rigidbody2D>();
        gravityScale = rigidBody2D.gravityScale;

        EventManager.instance.playerDeath += Die;

        A_UI = GetComponentInChildren <Canvas>().transform.GetChild(0).gameObject;
        B_UI = GetComponentInChildren <Canvas>().transform.GetChild(1).gameObject;
        X_UI = GetComponentInChildren <Canvas>().transform.GetChild(2).gameObject;
        Y_UI = GetComponentInChildren <Canvas>().transform.GetChild(3).gameObject;

        AGrey_UI = GetComponentInChildren <Canvas>().transform.GetChild(4).gameObject;
        BGrey_UI = GetComponentInChildren <Canvas>().transform.GetChild(5).gameObject;
        XGrey_UI = GetComponentInChildren <Canvas>().transform.GetChild(6).gameObject;
        YGrey_UI = GetComponentInChildren <Canvas>().transform.GetChild(7).gameObject;

        A_UI.SetActive(a_isEnabled);
        B_UI.SetActive(b_isEnabled);
        X_UI.SetActive(x_isEnabled);
        Y_UI.SetActive(y_isEnabled);

        AGrey_UI.SetActive(!a_isEnabled);
        BGrey_UI.SetActive(!b_isEnabled);
        XGrey_UI.SetActive(!x_isEnabled);
        YGrey_UI.SetActive(!y_isEnabled);

        A_Animator = A_UI.GetComponent <Animator>();
        B_Animator = B_UI.GetComponent <Animator>();
        X_Animator = X_UI.GetComponent <Animator>();
        Y_Animator = Y_UI.GetComponent <Animator>();

        pickupSlot = transform.GetChild(2);

        graphicsSlot  = transform.GetChild(3);
        charAnimation = graphicsSlot.GetChild(0).GetComponent <Animator>();
        audioManager  = FindObjectOfType <AudioManager>();
    }
Exemple #11
0
    public void DefaultLoad()
    {
        GearManager.instance.SetGears(0);

        SwapManager.PlayerIdx     = 0;
        SwapManager.BackgroundIdx = 0;
        SwapManager.MusicIdx      = 0;
        SwapManager.ObstacleIdx   = 0;

        SwapManager.PlayerUnlocks     = new List <int>();
        SwapManager.BackgroundUnlocks = new List <int>();
        SwapManager.MusicUnlocks      = new List <int>();
        SwapManager.ObstacleUnlocks   = new List <int>();

        SwapManager.AddDefaults();

        player.Score().SetHighscores(0, 0);

        player.InitUnlock();
    }
Exemple #12
0
 private void Awake()
 {
     i = this;
 }
Exemple #13
0
 private void Awake()
 {
     swapManager = FindObjectOfType <SwapManager>();
 }
Exemple #14
0
 private void InitSwapManager()
 {
     SwapManager = new SwapManager(_setup.DatFile, Settings.Default.ReserveDat);
 }
Exemple #15
0
 private void Start()
 {
     swapper = FindObjectOfType <SwapManager>();
 }