Beispiel #1
0
 // Start is called before the first frame update
 void Start()
 {
     rb2            = GetComponentInParent <Rigidbody2D>();
     _gadgetManager = FindObjectOfType <GadgetManager>();
     _gadgetManager.ActivateGadget(DashAbilityName);
     ObstacleLayer   = LayerMask.GetMask(ObstaclesLayerName);
     _curDashCounter = _maxDashCount;
 }
Beispiel #2
0
 private void Cooldown()
 {
     if (_curTime > 0f)
     {
         _curTime -= Time.deltaTime;
         GadgetManager.Timer(_curTime, _maxTime, _gadgetName);
     }
 }
Beispiel #3
0
 private void Start()
 {
     _gadgetManager = FindObjectOfType <GadgetManager>();
     if (QuestValues.Instance.GetStage(GadgetName) == -1)
     {
         QuestValues.Instance.Add(GadgetName);
         Debug.Log($"{GadgetName} module quest given");
     }
 }
Beispiel #4
0
 public GadgetInstance(string gadgetSystemName, Guid userId, byte row, byte column, byte rowSpan, byte columnSpan)
     : this()
 {
     this.Gadget     = GadgetManager.GetByName(gadgetSystemName);
     this.UserId     = userId;
     this.Row        = row;
     this.Column     = column;
     this.RowSpan    = rowSpan;
     this.ColumnSpan = columnSpan;
 }
Beispiel #5
0
 //Icon should appear after binded gadget activated
 private void Gadget_OnGadgetActivate(object sender, GadgetManager.OnGadgetActivateEventArgs e)
 {
     if (_gadgetName == e.name)
     {
         _visual.SetActive(true);
         GadgetManager gadget = FindObjectOfType <GadgetManager>();
         gadget.OnGadgetCooldown += OnGadgetCooldown;
         gadget.OnGadgetActivate -= Gadget_OnGadgetActivate;
     }
 }
Beispiel #6
0
    private void Start()
    {
        _canActivate = QuestValues.Instance.GetStage(_gadgetName) > 0;
        _visual.SetActive(_canActivate);

        GadgetManager gadget = FindObjectOfType <GadgetManager>();

        if (_canActivate)
        {
            gadget.OnGadgetCooldown += OnGadgetCooldown;
        }
        else
        {
            gadget.OnGadgetActivate += Gadget_OnGadgetActivate;
        }

        _isFilling = false;
    }
Beispiel #7
0
    private void Update()
    {
        if (_isActive)
        {
            Disappear();
            _curTime -= Time.deltaTime;
            GadgetManager.Timer(_curTime, _maxTime, _gadgetName);
            if (_curTime <= 0f)
            {
                _isActive   = false;
                _isChanging = true;
            }
        }

        if (!_isActive)
        {
            Appear();
        }
    }
        protected virtual void Start()
        {
            gadgetManager = GetComponent <GadgetManager>();
            cc            = GetComponent <vThirdPersonController>();

            if (cc != null)
            {
                cc.Init();
            }

            if (vThirdPersonController.instance == cc || vThirdPersonController.instance == null)
            {
#if UNITY_5_4_OR_NEWER
                SceneManager.sceneLoaded += OnLevelFinishedLoading;
#endif

                StartCoroutine(CharacterInit());
            }
        }
Beispiel #9
0
        private void GadgetSelectedEventHandler(object sender, RoutedEventArgs e)
        {
            Button btn = sender as Button;

            ClientCommon.Common cmnClass = new ClientCommon.Common();

            //const string gNamespace = "Ewav";

            GadgetManager gm = new GadgetManager();

            string btnName;//= btn.Name.ToString();

            if (btn.Tag != null)
            {
                btnName = btn.Tag.ToString();
            }
            else
            {
                btnName = btn.Name.ToString();
            }


            UserControl uc = gm.LoadGadget(btnName);

            uc.Name = cmnClass.GenerateControlName(uc, dgCanvas);


            if (uc is XYChartControl && btn.Tag != null)
            {
                // ((XYChartControl)uc).ChartName = ((Ewav.ContextMenu.MenuItem)(sender)).Text.Replace(" ","");
                ((XYChartControl)uc).SetChartTitle(btn.Name.ToString().Replace(" ", ""));
            }

            cmnClass.AddControlToCanvas(uc, 10, 10, applicationViewModel.LayoutRoot);

            spButtons.Visibility = System.Windows.Visibility.Collapsed;
        }
Beispiel #10
0
        void AddGadget(object sender, MouseButtonEventArgs e)
        {
            Ewav.ContextMenu.MenuItem thisMenuItem = sender as Ewav.ContextMenu.MenuItem;

            GadgetManager gm = new GadgetManager();
            UserControl   uc = gm.LoadGadget(thisMenuItem.ControlID);

            double mouseHorizontalPosition, mouseVerticalPosition;

            uc.Name = ControlNameGenerator(uc);

            mouseVerticalPosition   = contextMenuRightClickCoords.Y - 55;
            mouseHorizontalPosition = contextMenuRightClickCoords.X;

            if (uc is XYChartControl)
            {
                ((XYChartControl)uc).SetChartTitle(((Ewav.ContextMenu.MenuItem)(sender)).Text.Replace(" ", ""));
            }

            cmnClass.AddControlToCanvas(uc, mouseVerticalPosition, mouseHorizontalPosition, applicationViewModel.LayoutRoot);
            MenuPopup(this, new EventArgs());

            root.Children.Remove(popupMenu);
        }
Beispiel #11
0
 public void Awake()
 {
     GadgetManager = FindObjectOfType <GadgetManager>();
     GadgetManager.OnGadgetActivate += GadgetManager_OnGadgetActivate;
 }
Beispiel #12
0
        public ActionResult Create(FormCollection form)
        {
            try
            {
                var appToAdd = gadgetDB.CreateObject <App>(); //new SampleWeb.Models.App();

                // Deserialize (Include white list!)
                TryUpdateModel(appToAdd, new string[] { "Name", "SourceUrl" }, form.ToValueProvider());

                appToAdd.CreateDate = DateTime.UtcNow;
                appToAdd.UpdateDate = DateTime.UtcNow;
                // Validate
                if (String.IsNullOrEmpty(appToAdd.Name))
                {
                    ModelState.AddModelError("Name", "Name required!");
                }
                if (String.IsNullOrEmpty(appToAdd.SourceUrl))
                {
                    ModelState.AddModelError("SourceUrl", "SourceUrl is required!");
                }

                // If valid, save movie to database
                if (ModelState.IsValid)
                {
                    gadgetDB.AddToApps(appToAdd);
                    gadgetDB.SaveChanges();
                }
                else
                {
                    return(View(appToAdd));
                }

                Gadget gadget = gadgetDB.CreateObject <Gadget>();
                gadget.AppID      = appToAdd.AppId;
                gadget.SourceUrl  = appToAdd.SourceUrl;
                gadget.CreateDate = appToAdd.CreateDate;
                gadget.UpdateDate = appToAdd.UpdateDate;

                gadgetDB.AddToGadgets(gadget);
                gadgetDB.SaveChanges();

                appToAdd.LatestGadgetID = gadget.GadgetID;


                GadgetMaster gMaster = GadgetManager.FetchGadget(appToAdd.SourceUrl);

                GadgetContent gContent = gadgetDB.CreateObject <GadgetContent>();
                gContent.GadgetID     = gadget.GadgetID;
                gContent.CreateDate   = appToAdd.CreateDate;
                gContent.UpdateDate   = appToAdd.UpdateDate;
                gContent.RecordTypeID = RecordTypeValues.GadgetXML;
                gContent.Content      = gMaster.RawTag;

                gadgetDB.AddToGadgetContents(gContent);
                gadgetDB.SaveChanges();

                if (gMaster.HasExternalMessageBundles())
                {
                    gContent = gadgetDB.CreateObject <GadgetContent>();
                    gContent.RecordTypeID = RecordTypeValues.MessageBundle;
                    gContent.CreateDate   = appToAdd.CreateDate;
                    gContent.UpdateDate   = appToAdd.UpdateDate;
                    gContent.Content      = gMaster.GetConsolidatedMessageBundles();
                    gadgetDB.AddToGadgetContents(gContent);
                    gadgetDB.SaveChanges();
                }

                appToAdd.LatestGadgetID = gadget.GadgetID;
                gadgetDB.SaveChanges();

                return(RedirectToAction("Details/" + appToAdd.AppId.ToString()));
            }
            catch
            {
                return(View());
            }
        }