예제 #1
0
        public void Update()
        {
            if (!inMinigame)
            {
                UserInput();
                if (character.CurrentAction != ActionType.STUNNED)
                {
                    if (IsGrounded)
                    {
                        GetInput();
                        // Turn();
                    }
                }
#if UNITY_EDITOR
                if (Input.GetKeyDown(KeyCode.Backspace))
                {
                    debugMode = !debugMode;
                }
                if (debugMode)
                {
                    //Debug.Log("Character Control of :" + this.gameObject.name + " is in Debug Mode!");
                    if (Input.GetKeyDown(KeyCode.P))
                    {
                        //Debug.Log("Growing!");
                        // ANIMATION ADJUSTMENT HERE!
                        Parameters param = new Parameters();
                        param.AddParameter <bool>("Grow", true);
                        param.AddParameter <int>("EvolutionIndex", +1);
                        // TODO: INSERT ANIMATION CALLER HERE for the FINISH GROWTH
                        character.UpdateAnimator("Grow", param);
                    }
                }
#endif
            }
        }
예제 #2
0
        public ShopSection createShopSection(string title, string user_id)
        {
            method = "POST";
            URI    = "sections";
            var parameters = new Parameters();

            parameters.AddParameter("title", title);
            parameters.AddParameter("user_id", user_id);

            var response = SendRequest <ShopSection>(parameters);

            return(response == null ? null: response.results[0]);
        }
    public void CreateStats()
    {
        statList.ClearStatPanels();
        for (int i = 0; i < thisObjectCharacter.CharacterStats.Count; i++)
        {
            Parameters param = new Parameters();
            param.AddParameter <string>("StatName", thisObjectCharacter.CharacterStats[i].Name);
            param.AddParameter <int>("curLevel", thisObjectCharacter.CharacterStats[i].CurrentLevel);

            statList.AddStat(param);
        }
        StatInitialize = true;
    }
예제 #4
0
파일: User.cs 프로젝트: seanlinmt/tradelr
        public IEnumerable <ShippingTemplate> findAllUserShippingTemplates(string user_id = "", string fields = null, string includes = null)
        {
            method     = "GET";
            URI        = "/users/:user_id/shipping/templates";
            id.user_id = user_id;
            var parameters = new Parameters();

            parameters.AddParameter("fields", fields);
            parameters.AddParameter("includes", includes);

            var response = SendRequest <ShippingTemplate>(parameters);

            return(response == null ? null : response.results);
        }
예제 #5
0
        // listings
        public Resources.Listing createListing(int quantity, string title, string description, decimal price,
                                               string tags, long shipping_template_id, string materials = "", long?shop_section_id = null)
        {
            method = "POST";
            URI    = "/listings";
            var parameters = new Parameters();

            parameters.AddParameter("quantity", quantity.ToString());
            parameters.AddParameter("title", title);
            parameters.AddParameter("description", description);
            parameters.AddParameter("price", price.ToString());
            parameters.AddParameter("tags", tags);
            parameters.AddParameter("shipping_template_id", shipping_template_id.ToString());
            if (!string.IsNullOrEmpty(materials))
            {
                parameters.AddParameter("materials", materials);
            }
            if (shop_section_id.HasValue)
            {
                parameters.AddParameter("shop_section_id", shop_section_id.Value.ToString());
            }
            var response = SendRequest <Resources.Listing>(parameters);

            return(response == null ? null : response.results[0]);
        }
예제 #6
0
파일: User.cs 프로젝트: seanlinmt/tradelr
        public Resources.User getUser(string user_id = "", string fields = null, string includes = null)
        {
            method     = "GET";
            URI        = "/users/:user_id";
            id.user_id = user_id;
            var parameters = new Parameters();

            parameters.AddParameter("fields", fields);
            parameters.AddParameter("includes", includes);

            var response = SendRequest <Resources.User>(parameters);

            return(response == null? null: response.results[0]);
        }
예제 #7
0
        public Resources.Listing getListing(long listing_id, string fields = null, string includes = null)
        {
            method        = "GET";
            URI           = "/listings/:listing_id";
            id.listing_id = listing_id.ToString();
            var parameters = new Parameters();

            parameters.AddParameter("fields", fields);
            parameters.AddParameter("includes", includes);

            var response = SendRequest <Resources.Listing>(parameters);

            return(response == null ? null : response.results[0]);
        }
예제 #8
0
        public IEnumerable <Resources.Listing> findAllShopListingsExpired(long shopid, int offset = 0, string includes = "", int limit = Constants.LIMIT_ENTRIES)
        {
            method     = "GET";
            URI        = "/shops/:shop_id/listings/expired";
            id.shop_id = shopid.ToString();
            var parameters = new Parameters();

            parameters.AddParameter("includes", includes);
            parameters.AddParameter("offset", offset.ToString());
            parameters.AddParameter("limit", limit.ToString());

            var response = SendRequest <Resources.Listing>(parameters);

            return(response == null ? null : response.results);
        }
예제 #9
0
        public virtual void Start()
        {
            Parameters p = new Parameters();

            p.AddParameter <GameObject>("player", this.gameObject);
            EventBroadcaster.Instance.PostEvent(EventNames.SET_UI_PLAYER_REFERENCE, p);
            characterCenter = GetComponent <CapsuleCollider>();
            justJumped      = false;
            targetRotation  = transform.rotation;
            if (GetComponent <Rigidbody>())
            {
                rBody = GetComponent <Rigidbody>();
            }
            else
            {
                Debug.LogError("Character Needs Rigidbody!");
            }

            if (GetComponent <BareboneCharacter>())
            {
                character = GetComponent <BareboneCharacter>();
            }
            else
            {
                Debug.LogError("Character has no BareboneCharacter! Cant Check Current States!!");
            }
            forwardInput = turnInput = jumpInput = 0;

            // ANIMATION
        }
예제 #10
0
        public void OnTriggerExit(Collider collision)
        {
            if (!collision.isTrigger)
            {
                BareboneCharacter collidingPlayer = (collision.transform.GetComponent <BareboneCharacter>()) ? collision.transform.GetComponent <BareboneCharacter>() : null;

                if (collidingPlayer == null)
                {
                    return;
                }

                Parameters p = new Parameters();
                p.AddParameter <MGColliderHelper>("Checker", this);
                p.UpdateParameter <bool>("Entering", false);
                if (playersWithinRange != null)
                {
                    if (!playersWithinRange.Contains(collidingPlayer))
                    {
                        return;
                    }
                    SwitchFX(0);
                    Debug.Log("Exit");
                    EventBroadcaster.Instance.PostEvent(EventNames.NOTIFY_PLAYER_INTERACTION, p);
                    playersWithinRange.Remove(collidingPlayer);
                }
            }
        }
예제 #11
0
        public override void Evolve()
        {
            // DISABLE ALL CURRENT EVOLUTION
            for (int i = 0; i < evolutions[currentEvolution].EvolutionParts.Length; i++)
            {
                evolutions[currentEvolution].EvolutionParts[i].SetActive(false);
            }

            // ENABLE NEW EVOLUTION
            currentEvolution += 1;

            for (int i = 0; i < evolutions[currentEvolution].EvolutionParts.Length; i++)
            {
                evolutions[currentEvolution].EvolutionParts[i].SetActive(true);
            }
            // SET THEM AS NEW ANIMATORS
            SetCurrentAnimators(evolutions[currentEvolution].EvolutionParts);

            //  stateMachine.UpdateAnimator();
            // Starts  Growth
            Parameters param = new Parameters();

            param.AddParameter <bool>("FinishGrowing", false);
            // TODO: INSERT ANIMATION CALLER HERE for the FINISH GROWTH
            UpdateAnimator("FinishGrowing", param);
        }
예제 #12
0
        public void ShowToolTip(string mesg)
        {
            Parameters p = new Parameters();

            p.AddParameter <string>("Mesg", mesg);

            EventBroadcaster.Instance.PostEvent(EventNames.SHOW_TOOLTIP_MESG, p);
        }
예제 #13
0
        public void ShowPriceToolTip()
        {
            Parameters p        = new Parameters();
            string     curCoins = "Current: " + PlayerGameManager.GetInstance.playerData.coins.ToString();

            p.AddParameter <string>("Mesg", curCoins);
            EventBroadcaster.Instance.PostEvent(EventNames.SHOW_TOOLTIP_MESG, p);
        }
예제 #14
0
        public ShippingTemplateEntry createShippingTemplateEntry(long shipping_template_id, int?destination_country_id,
                                                                 decimal primary_cost, decimal secondary_cost, int?destination_region_id)
        {
            method = "POST";
            URI    = "shipping/templates/entries";
            var parameters = new Parameters();

            parameters.AddParameter("shipping_template_id", shipping_template_id.ToString());
            parameters.AddParameter("destination_country_id", destination_country_id.ToString());
            parameters.AddParameter("primary_cost", primary_cost.ToString());
            parameters.AddParameter("secondary_cost", secondary_cost.ToString());
            parameters.AddParameter("destination_region_id", destination_region_id.ToString());

            var data = SendRequest <ShippingTemplateEntry>(parameters);

            return(data == null ? null : data.results[0]);
        }
예제 #15
0
            protected override Expression VisitConstantExpression(ConstantExpression expression)
            {
                var namedParameter = m_parameters.AddParameter(expression.Value);

                Statement.AppendFormat("@{0}", namedParameter.Name);

                return(expression);
            }
예제 #16
0
        // Collision to Check who's getting hit.
        public void OnTriggerEnter(Collider other)
        {
            BareboneObject receiver = other.transform.GetComponent <BareboneObject>();

            // if Weapon is not active
            if (!this.active)
            {
                return;
            }
            //Check if the hit item is an Object
            if (!receiver)
            {
                return;
            }
            if (receiver.Team != team)
            {
                // if Collision isLiving
                if (receiver.ObjectType == ObjectType.Living)
                {
                    Parameters parameters = new Parameters();
                    parameters.Initialize();
                    // Adds all the Damage the weapon can send
                    for (int i = 0; i < bareboneDamages.Count; i++)
                    {
                        BareboneDamage damage = new BareboneDamage();
                        parameters.AddParameter <BareboneDamage>("DamageType" + i, new BareboneDamage().Copy(bareboneDamages[0]));
                    }
                    // Checks if the weapon has an owner, if so, the owner is also passed as a parameter.
                    if (Owner != null)
                    {
                        if (Owner.GetComponent <BareboneCharacter>())
                        {
                            parameters.AddParameter <BareboneCharacter>("DamageDealer", Owner);
                        }
                    }
                    // Add Effects
                    receiver.ReceiveDamage(parameters);
                    active = false;
                }
            }
            if (environmentWeapon)
            {
                StartCoroutine(ResetActive());
            }
        }
예제 #17
0
        public void ShowRepairAmountTooltip()
        {
            string     mesg = "Repair Cost " + myBuilding.buildingInformation.repairPrice.ToString() + ".";
            Parameters p    = new Parameters();

            p.AddParameter <string>("Mesg", mesg);

            EventBroadcaster.Instance.PostEvent(EventNames.SHOW_TOOLTIP_MESG, p);
        }
        public void ShowToolTip()
        {
            if (!allowToolTip)
            {
                return;
            }
            string     mesg = resourceDataCount.ToString();
            Parameters p    = new Parameters();

            p.AddParameter <string>("Mesg", mesg);
            EventBroadcaster.Instance.PostEvent(EventNames.SHOW_TOOLTIP_MESG, p);
        }
예제 #19
0
        public IEnumerable <Category> findAllTopCategory(string fields = "")
        {
            method = "GET";
            URI    = "/taxonomy/categories";
            var parameters = new Parameters();

            parameters.AddParameter("fields", fields);

            var response = SendRequest <Category>(parameters);

            return(response == null? null: response.results);
        }
예제 #20
0
        public Shop getShop()
        {
            method = "GET";
            URI    = "/shops/:shop_id";
            var parameters = new Parameters();

            parameters.AddParameter("includes", "Listings,Sections");

            var response = SendRequest <Shop>(parameters);

            return(response == null ? null : response.results[0]);
        }
예제 #21
0
        /// <summary>
        /// Parameter를 추가한다.
        /// </summary>
        /// <param name="requestParamNames"></param>
        public virtual void AddParamArray(params string[] requestParamNames)
        {
            if (requestParamNames == null || requestParamNames.Length == 0)
            {
                return;
            }

            foreach (string paramName in requestParamNames)
            {
                Parameters.AddParameter(paramName);
            }
        }
예제 #22
0
        public void Movement()
        {
            if (character.TargetObject == null)
            {
                RotateAndMoveWithDirection();
            }
            else
            {
                RotateWithAandD();
            }

            /*if (Mathf.Abs(forwardInput) > inputSettings.inputDelay)
             * {
             *  //Debug.Log("Touching Ground : " + IsGrounded);
             *  //move
             * }
             * else
             * {
             *  Turn();
             * }*/
            //FORWARD ANIMATION PARAMETERS
            Parameters param = new Parameters();

            param.AddParameter <float>("ForwardInput", forwardInput);
            if (forwardInput > 0)
            {
                param.AddParameter <bool>("Forward", true);
            }
            else if (forwardInput < 0)
            {
                param.AddParameter <bool>("Backward", true);
            }
            else
            {
                param.AddParameter <bool>("Backward", false);
                param.AddParameter <bool>("Forward", false);
            }
            // SET CURRENT ANIMATOR CONDITION HERE
        }
예제 #23
0
    public void RemoveUnitToControlled(UnitBaseBehaviourComponent unit)
    {
        if (!controlledUnits.Contains(unit))
        {
            return;
        }

        controlledUnits.Remove(unit);

        Parameters p = new Parameters();

        p.AddParameter <UnitBaseBehaviourComponent>("UnitControlled", unit);
    }
예제 #24
0
        public Resources.Listing updateListing(long listing_id, bool renew, int quantity, string title, string description, decimal price,
                                               string tags, long?shipping_template_id = null, string materials = "", long?shop_section_id = null, string state = "active")
        {
            method        = "PUT";
            URI           = "/listings/:listing_id";
            id.listing_id = listing_id.ToString();
            var parameters = new Parameters();

            parameters.AddParameter("renew", renew?"true":"false");
            parameters.AddParameter("state", state);
            parameters.AddParameter("quantity", quantity.ToString());
            parameters.AddParameter("title", title);
            parameters.AddParameter("description", description);
            parameters.AddParameter("price", price.ToString());
            parameters.AddParameter("tags", tags);
            parameters.AddParameter("shipping_template_id", shipping_template_id.ToString());
            parameters.AddParameter("materials", materials);
            parameters.AddParameter("shop_section_id", shop_section_id.ToString());
            var response = SendRequest <Resources.Listing>(parameters);

            return(response == null ? null : response.results[0]);
        }
예제 #25
0
        public IEnumerable <Category> findAllSubCategoryChildren(string tag, string subtag, string fields = "")
        {
            method       = "GET";
            URI          = "/taxonomy/categories/:tag/:subtag";
            id.tag_id    = tag;
            id.subtag_id = subtag;
            var parameters = new Parameters();

            parameters.AddParameter("fields", fields);

            var response = SendRequest <Category>(parameters);

            return(response == null ? null : response.results);
        }
예제 #26
0
        public override void FinishEvolve(Animator selfAnim = null)
        {
            //Debug.Log("Evolve Finish : " + this.gameObject.name);
            // Finishes Growth
            Parameters param = new Parameters();

            param.AddParameter <bool>("FinishGrowing", true);
            //stateMachine.SetAnimatorCondition(param);
            if (selfAnim != null)
            {
                UpdateAnimator("FinishGrowing", param);
            }
            else
            {
                UpdateAnimator("FinishGrowing", param);
            }
        }
예제 #27
0
        private void ProcessOptionName(string uciData)
        {
            if (uciData.Contains(OptionNalimovPath))
            {
                IsNalimovPathSupported = true;
            }

            if (OptionReceived != null)
            {
                UCIMessageEventArgs e = new UCIMessageEventArgs(uciData);
                OptionReceived(this, e);
            }
            if (IsLoadParametersRequired)
            {
                Parameters.AddParameter(uciData);
            }
        }
예제 #28
0
    public void OnMouseEnter()
    {
        if (EventSystem.current.IsPointerOverGameObject())
        {
            return;
        }
        if (!isClickable)
        {
            return;
        }

        if (!string.IsNullOrEmpty(mesg) && !isInteractingWith)
        {
            Parameters p = new Parameters();
            p.AddParameter <string>("Mesg", mesg);
            EventBroadcaster.Instance.PostEvent(EventNames.SHOW_TOOLTIP_MESG, p);
        }
    }
예제 #29
0
    public void AddUnitToControlled(UnitBaseBehaviourComponent unit)
    {
        if (controlledUnits.Contains(unit))
        {
            return;
        }
        if (unit.unitAffiliation == UnitAffiliation.Player)
        {
            controlledUnits.Insert(0, unit);
        }
        else
        {
            controlledUnits.Add(unit);
        }
        Parameters p = new Parameters();

        p.AddParameter <UnitBaseBehaviourComponent>("UnitControlled", unit);
        EventBroadcaster.Instance.PostEvent(EventNames.UPDATE_CONTROLLED_UNITS, p);
    }
예제 #30
0
        public void CheckAndSetManualUnit(int index)
        {
            if (controlledUnits.Count > index)
            {
                if (manualControlledUnit == controlledUnits[index])
                {
                    CameraController.CameraController.GetInstance.FocusOnManualSelectedUnit();
                }
                if (controlledUnits[index] != null)
                {
                    if (manualControlledUnit != null)
                    {
                        // Set Color to Green
                        manualControlledUnit.InitializeSelected();
                    }

                    manualControlledUnit = controlledUnits[index];
                    if (!unitSelected.Contains(manualControlledUnit))
                    {
                        foreach (UnitBaseBehaviourComponent item in unitSelected)
                        {
                            item.RemoveFromSelected();
                        }
                        unitSelected.Clear();
                        unitSelected.Add(manualControlledUnit);
                    }

                    // Set Color to Blue
                    Parameters p = new Parameters();
                    p.AddParameter <UnitBaseBehaviourComponent>("ManualUnit", manualControlledUnit);
                    manualControlledUnit.InitializeManualSelected();
                    comboComponent.SetUnitDoingCombo(manualControlledUnit);

                    UIPlayerInGameManager.GetInstance.characterHandler.SetNewManualUnitControlled(p);           // Lower Left Visual Representation of 4 Units
                    UIPlayerInGameManager.GetInstance.inventoryHandler.SwapUnitInventory(manualControlledUnit); // Inventory
                    UIPlayerInGameManager.GetInstance.statHandler.SwapUnitStats(manualControlledUnit);          // Character Stats
                }
                else
                {
                    Debug.Log("Unit Selected is not!");
                }
            }
        }