Ejemplo n.º 1
0
 void Awake()
 {
     _pointManager = GameObject.Find("Point Manager").GetComponent<PointManager>();
     _equipmentManager = GameObject.Find("Equipment Manager").GetComponent<EquipmentManager>();
     _weaponText = GameObject.Find("Weapon Upgrade Level Text").GetComponent<Text>();
     _timerText = GameObject.Find("Beard Upgrade Level Text").GetComponent<Text>();
     _healthText = GameObject.Find("Helmet Upgrade Level Text").GetComponent<Text>();
     UpdateText();
 }
Ejemplo n.º 2
0
    public void SetItemInfo(ShopGui owner, Item item, EquipmentManager.ItemCategory itemCategory)
    {
        this.NameLabel.text = item.ItemName;
        this.PriceLabel.text = item.Cost.ToString("N0");
        if (itemCategory == EquipmentManager.ItemCategory.Weapon)
        { 
            this.InfoLabel.text = (item as Weapon).Damage.ToString("N0");
            this.InfoIcon.spriteName = "DamageIcon";
        }
        else
        { 
            this.InfoLabel.text = (item as Armor).ArmorValue.ToString("N0");
            this.InfoIcon.spriteName = "ArmorIcon";
        }

        this.owner = owner;
        this.item = item;
        this.itemCategory = itemCategory;
    }
Ejemplo n.º 3
0
 private void Start()
 {
     uiManager        = UIManager.Instance;
     rt               = GetComponent <RectTransform>();
     equipmentManager = EquipmentManager.Instance;
 }
Ejemplo n.º 4
0
    void Awake()
    {
        this.Ammunition = new Dictionary <AmmoTypes, int>();

        this.equipmentManager = this.GetComponent <EquipmentManager>();
    }
Ejemplo n.º 5
0
    /// <summary>
    /// ボタンがハイライトされているときの処理を設定
    /// </summary>
    void settingSelectButton(Button button, EquipmentManager.Equipment selectEquipment)
    {
        string[] paramStr = new string[8];
        paramStr[0] = "HP";
        paramStr[1] = "MP";
        paramStr[2] = "Atk";
        paramStr[3] = "Def";
        paramStr[4] = "Int";
        paramStr[5] = "Mgr";
        paramStr[6] = "Agl";
        paramStr[7] = "Luc";

        int[] currentParams = new int[8];
        currentParams[0] = PlayerManager.selectPlayer.HP;
        currentParams[1] = PlayerManager.selectPlayer.MP;
        currentParams[2] = PlayerManager.selectPlayer.Atk;
        currentParams[3] = PlayerManager.selectPlayer.Def;
        currentParams[4] = PlayerManager.selectPlayer.Int;
        currentParams[5] = PlayerManager.selectPlayer.Mgr;
        currentParams[6] = PlayerManager.selectPlayer.Agl;
        currentParams[7] = PlayerManager.selectPlayer.Luc;

        button.OnDisableAsObservable()
        .Where(_ => !firstSelect)
        .Subscribe(_ => {
            firstSelect = true;
        })
        .AddTo(this);

        button.OnUpdateSelectedAsObservable()
        //.Where(_ => firstSelect)
        .Subscribe(_ => {
            var selectPlayer       = PlayerManager.selectPlayer;
            var currentEquipmentID = selectPlayer.BaseParam.currentEquipment[(int)part];
            var currentEquipment   = EquipmentManager.getEquipment(currentEquipmentID);

            int[] deltaParams = new int[8];
            deltaParams[0]    = selectEquipment.HP - currentEquipment.HP;
            deltaParams[1]    = selectEquipment.MP - currentEquipment.MP;
            deltaParams[2]    = selectEquipment.Atk - currentEquipment.Atk;
            deltaParams[3]    = selectEquipment.Def - currentEquipment.Def;
            deltaParams[4]    = selectEquipment.Int - currentEquipment.Int;
            deltaParams[5]    = selectEquipment.Mgr - currentEquipment.Mgr;
            deltaParams[6]    = selectEquipment.Agl - currentEquipment.Agl;
            deltaParams[7]    = selectEquipment.Luc - currentEquipment.Luc;

            for (int i = 0; i < deltaParams.Length; ++i)
            {
                if (deltaParams[i] == 0)
                {
                    paramTexts[i].text  = currentParams[i].ToString();
                    paramTexts[i].color = Color.black;
                    continue;
                }

                paramTexts[i].text = currentParams[i].ToString() + "  ->  " + (currentParams[i] + deltaParams[i]).ToString();

                if (deltaParams[i] < 0)
                {
                    paramTexts[i].color = Color.red;
                    continue;
                }
                paramTexts[i].color = Color.blue;
            }
            firstSelect = false;
        })
        .AddTo(this);
    }
Ejemplo n.º 6
0
 void Start()
 {
     eqManager = EquipmentManager.instance;
     inventory = Inventory.instance;
 }
Ejemplo n.º 7
0
 void Start()
 {
     inventoryManagerScript = GameObject.Find("InventoryManager").GetComponent<InventoryManager>();
     shopManagerScript = inventoryManagerScript.GetComponent<ShopManager>();
     equipmentManagerScript = inventoryManagerScript.GetComponent<EquipmentManager>();
 }
Ejemplo n.º 8
0
 private void Awake()
 {
     instance = this;
 }
Ejemplo n.º 9
0
	private void buyMemoryCard(EquipmentManager.Equipment<EquipmentManager.MemCardData> memCard) {
		// If it's not already owned and the player has enough money
		if (memCard.data.owned == false && PlayerProfile.profile.money >= memCard.data.cost) {
			PlayerProfile.profile.money -= memCard.data.cost;
			memCard.data.owned = true;

			if (PlayerProfile.profile.memoryCardCapacity < memCard.data.capacity) {
				PlayerProfile.profile.memoryCardCapacity = memCard.data.capacity;
			}

			// Check to see if this should unlock the "Memento" achievement
			if (memCard.data.capacity == 32) {
				achievementManager.SetProgressToAchievement ("Memento", 1f);
			}

			PlayerProfile.profile.save ();
			equipManager.saveEquipment ();

			// Refresh the buttons to ensure they look correct after purchase
			configureMemoryCardButtons ();
		}
	}
Ejemplo n.º 10
0
 /// <summary>
 ///
 /// </summary>
 public abstract void MainRelease(EquipmentManager manager);
Ejemplo n.º 11
0
 /// <summary>
 /// Off hand action. Right Click
 /// </summary>
 public abstract void SecondaryAction(EquipmentManager manager);
Ejemplo n.º 12
0
    public void UpdateItem(Item item, EquipmentManager.ItemCategory category)
    {
        if (category == EquipmentManager.ItemCategory.Weapon)
        {
            this.CurrentWeapon = (item as Weapon);
            this.weaponRenderer.sprite = this.CurrentWeapon.Sprite;
        }
        else if (category == EquipmentManager.ItemCategory.Armor)
        { 
            this.CurrentArmor = (item as Armor);
            this.armorRenderer.sprite = this.CurrentArmor.Sprite;
        }
        else if (category == EquipmentManager.ItemCategory.Boots)
        { 
            this.CurrentBoots = (item as Armor);
            this.bootsRenderer.sprite = this.CurrentBoots.Sprite;
        }
        else if (category == EquipmentManager.ItemCategory.Helmet)
        { 
            this.CurrentHelmet = (item as Armor);
            this.helmetRenderer.sprite = this.CurrentHelmet.Sprite;
        }

        this.totalArmorValue = this.CurrentArmor.ArmorValue + this.CurrentBoots.ArmorValue + this.CurrentHelmet.ArmorValue;
        
        PlayerInfoGui.Instance.UpdateDamageLabel(this.CurrentWeapon.Damage);
        PlayerInfoGui.Instance.UpdateArmorLabel(this.totalArmorValue);
    }
Ejemplo n.º 13
0
 /// <summary>
 /// Main hand action. Left click
 /// </summary>
 public abstract void MainAction(EquipmentManager manager);
Ejemplo n.º 14
0
    private void SwitchItemCategory(EquipmentManager.ItemCategory newCategory)
    {
        if (this.currentCategory == newCategory)
        { return; }

        this.currentCategory = newCategory;
        this.Scrollbar.value = 0f;

        for (int i = 0; i < this.listOfWeapons.Count; i++)
        { this.listOfWeapons[i].SetActive(this.currentCategory == EquipmentManager.ItemCategory.Weapon); }
        for (int i = 0; i < this.listOfArmors.Count; i++)
        { this.listOfArmors[i].SetActive(this.currentCategory == EquipmentManager.ItemCategory.Armor); }
        for (int i = 0; i < this.listOfBoots.Count; i++)
        { this.listOfBoots[i].SetActive(this.currentCategory == EquipmentManager.ItemCategory.Boots); }
        for (int i = 0; i < this.listOfBoots.Count; i++)
        { this.listOfHelmets[i].SetActive(this.currentCategory == EquipmentManager.ItemCategory.Helmet); }
    }
Ejemplo n.º 15
0
    private GameObject SpawnItem(int counter, Item item, EquipmentManager.ItemCategory itemCategory)
    {
        Vector3 spawnPos = Vector3.up * ((counter * -49) - 25f);
        GameObject go = Instantiate(this.ItemObj, Vector3.zero, Quaternion.identity) as GameObject;
        go.GetComponent<ItemShopGui>().SetItemInfo(this, item, itemCategory);
        go.transform.parent = this.ItemContainer;
        go.transform.localPosition = spawnPos;
        go.transform.localScale = Vector3.one;

        return go;
    }
Ejemplo n.º 16
0
 void Awake()
 {
     _equipmentManager = GameObject.Find("Equipment Manager").GetComponent<EquipmentManager>();
     _sprites = Resources.LoadAll<Sprite>(_loadPath);
     _spriteRenderer = GetComponent<SpriteRenderer>();
 }
Ejemplo n.º 17
0
    void Awake()
    {
        instance = this;

        inventory = InventoryManager.instance;
    }
Ejemplo n.º 18
0
 void Start()
 {
     m_PostProcessVolume = GetComponent <PostProcessVolume>();
     equipmentManager    = gameManager.GetComponent <EquipmentManager>();
     playerStats         = GetComponent <PlayerStats>();
 }
Ejemplo n.º 19
0
 private void Awake()
 {
     manager = gameManager.GetComponent <EquipmentManager>();
     temp    = icon.sprite;
 }
Ejemplo n.º 20
0
 public override void MainRelease(EquipmentManager manager)
 {
     reloading = false;
 }
Ejemplo n.º 21
0
 /// <summary>
 ///
 /// </summary>
 public abstract void SecondaryRelease(EquipmentManager manager);
Ejemplo n.º 22
0
 void Awake()
 {
     _equipmentManager = GameObject.Find("Equipment Manager").GetComponent<EquipmentManager>();
 }
Ejemplo n.º 23
0
 public override void SecondaryRelease(EquipmentManager manager)
 {
     //no release action
 }
Ejemplo n.º 24
0
 // Start is called before the first frame update
 void Start()
 {
     equipmentManager = GetComponent <EquipmentManager>();
 }
 protected override void SlotClicked()
 {
     Debug.Log("Equipment Slot Clicked");
     EquipmentManager.GetInstance().Unequip((Equipment)item);
 }
Ejemplo n.º 26
0
        public async Task <ActionResult> DeleteEquipment(long equipmentId)
        {
            await EquipmentManager.DeleteEquipment(equipmentId);

            return(RedirectToAction("ManageEquipment"));
        }
Ejemplo n.º 27
0
 public void SetEquipmentManager(EquipmentManager playerEquipmentManager)
 {
     equipmentManager = playerEquipmentManager;
     Initialize();
 }
Ejemplo n.º 28
0
        public async Task <ActionResult> ManageEquipment()
        {
            var model = new ManageEquipmentViewModel(await EquipmentManager.GetAllEquipment());

            return(View(model));
        }
Ejemplo n.º 29
0
 private void Start()
 {
     equipmentManager = EquipmentManager.instance;
     playerInput      = GetComponent <PlayerInput>();
 }
Ejemplo n.º 30
0
 void Awake()
 { instance = this; }
Ejemplo n.º 31
0
 private void Start()
 {
     //Sets equipmentManager to the EquipmentManager instance.
     equipmentManager = EquipmentManager.instance;
 }
Ejemplo n.º 32
0
 void OnDestroy()
 { instance = null; }
Ejemplo n.º 33
0
 // Start is called before the first frame update
 void Start()
 {
     equipmentManager = EquipmentManager.instance;
 }
Ejemplo n.º 34
0
        public void UpdateImageURL(string uuid, string type, string imageURL)
        {
            switch (type.ToUpper())
            {
            case "EVENT":
                EventManager evtManager = new EventManager(Globals.DBConnectionKey, this.GetAuthToken(Request));
                var          eres       = evtManager.Get(uuid);
                if (eres.Code != 200)
                {
                    return;
                }

                Event e = (Event)eres.Result;
                if (e != null)
                {
                    e.Image = imageURL;
                    evtManager.Update(e);
                }
                break;

            case "PROFILEMEMBER":

                break;

            case "PROFILE":
                ProfileManager profileManager = new ProfileManager(Globals.DBConnectionKey, Request.Headers.Authorization?.Parameter);
                var            res2           = profileManager.Get(uuid);
                if (res2.Code != 200)
                {
                    return;
                }

                var tmp = (Profile)res2.Result;
                tmp.Image = imageURL;
                profileManager.UpdateProfile(tmp);

                break;

            case "ACCOUNT":
                AccountManager am  = new AccountManager(Globals.DBConnectionKey, this.GetAuthToken(Request));
                var            res = am.Get(uuid);
                if (res.Code != 200)
                {
                    return;
                }

                Account a = (Account)res.Result;
                if (a != null)
                {
                    a.Image = imageURL;
                    am.Update(a);
                }
                break;

            case "USER":
                UserManager um    = new UserManager(Globals.DBConnectionKey, this.GetAuthToken(Request));
                var         res52 = um.Get(uuid);
                if (res52.Code != 200)
                {
                    return;
                }
                User u = (User)res52.Result;

                u.Image = imageURL;
                um.UpdateUser(u, true);

                break;

            case "ITEM":
                InventoryManager im = new InventoryManager(Globals.DBConnectionKey, this.GetAuthToken(Request));
                var res3            = im.Get(uuid);
                if (res3.Code != 200)
                {
                    return;
                }
                InventoryItem i = (InventoryItem)res3.Result;

                i.Image = imageURL;
                im.Update(i);
                break;

            case "PLANT":
            case "BALLAST":
            case "BULB":
            case "CUSTOM":
            case "FAN":
            case "FILTER":
            case "PUMP":
            case "VEHICLE":
                Debug.Assert(false, "TODO MAKE SURE CORRECT TABLE IS UPDATED");
                EquipmentManager em = new EquipmentManager(Globals.DBConnectionKey, this.GetAuthToken(Request));
                dynamic          d  = em.GetAll(type)?.FirstOrDefault(w => w.UUID == uuid);
                if (d != null)
                {
                    d.Image = imageURL;
                    em.Update(d);
                }
                break;
            }
        }
Ejemplo n.º 35
0
    private void Update()
    {
        //if (Time.timeScale > 0f)
        {
            if (!animator.GetBool("isAttacking") && !animator.GetBool("isPushing") && !animator.GetBool("isThrowing"))            // && !isDashing)
            {
                walkInput = new Vector2(Input.GetAxisRaw(walkHorizontalInput + inputExtensionString), Input.GetAxisRaw(walkVerticalInput + inputExtensionString));

                /*
                 * if (GameManager.singleGame)
                 * {
                 *      if(walkInput.x == 0f)
                 *              walkInput.x = Input.GetAxisRaw(walkHorizontalInput + "2");
                 *      if(walkInput.y == 0f)
                 *              walkInput.y = Input.GetAxisRaw(walkVerticalInput + "2");
                 * }
                 */

                if (walkInput.x != 0 && walkInput.y != 0)
                {
                    walkInput /= 1.5f;
                }

                if (walkInput != Vector2.zero)
                {
                    if (!isDashing)
                    {
                        speed = walkSpeed * (1 + (4 * timeSlowMoEffectValue));
                    }

                    animator.SetBool("isWalking", true);

                    if (walkInput.y < 0)
                    {
                        animator.SetInteger("direction", 2);

                        if (prevWalkState == 0)
                        {
                            comboKeys += "D";
                        }
                    }
                    else if (walkInput.y > 0)
                    {
                        animator.SetInteger("direction", 0);

                        if (prevWalkState == 0)
                        {
                            comboKeys += "U";
                        }
                    }
                    else if (walkInput.x > 0)
                    {
                        animator.SetInteger("direction", 1);

                        if (prevWalkState == 0)
                        {
                            comboKeys += "R";
                        }
                    }
                    else if (walkInput.x < 0)
                    {
                        animator.SetInteger("direction", 3);

                        if (prevWalkState == 0)
                        {
                            comboKeys += "L";
                        }
                    }

                    if (walkInput.x > 0)
                    {
                        sprRenderer.flipX = true;
                    }
                    else
                    {
                        sprRenderer.flipX = false;
                    }
                }
                else
                {
                    speed = 0f;
                    animator.SetBool("isWalking", false);
                }
            }

            //Potion
            if (Input.GetButtonDown(attackInput + inputExtensionString))
            {
                potionTimer = potionAttackButtonPressMinTime;
            }
            if (Input.GetButtonUp(attackInput + inputExtensionString))
            {
                potionTimer = -1000f;
            }
            if (potionTimer <= 0 && potionTimer > -900f)
            {
                EquipmentManager eqMan = GetComponent <EquipmentManager>();
                if (eqMan != null &&
                    eqMan.GetCurrentEquipment() != null &&
                    eqMan.GetCurrentEquipment().Length > 1 &&
                    eqMan.GetCurrentEquipment()[1] != null)
                {
                    eqMan.UsePotion(GetComponent <EquipmentManager>().GetCurrentEquipment()[1]);

                    if (playerNo == 1)
                    {
                        Subtitles.AddPlayer1Subtitle("Potion Used");
                    }
                    else if (playerNo == 2)
                    {
                        Subtitles.AddPlayer2Subtitle("Potion Used");
                    }
                }
                else
                {
                    if (playerNo == 1)
                    {
                        Subtitles.AddPlayer1Subtitle("Potion not equipped");
                    }
                    else if (playerNo == 2)
                    {
                        Subtitles.AddPlayer2Subtitle("Potion not equipped");
                    }
                }

                potionTimer = -1000f;
                potionUsed  = true;
            }
            else if (potionTimer > 0f && potionTimer > -900f)
            {
                potionTimer -= Time.deltaTime;
            }

            //Attack
            if (actionPoints >= attackActionDeplete &&
                !animator.GetBool("isAttacking") &&
                !animator.GetBool("isPushing") &&
                !animator.GetBool("isThrowing") &&
                !isDashing &&
                (Input.GetButtonUp(attackInput + inputExtensionString) /*|| GameManager.singleGame && Input.GetButtonDown(attackInput + "2")*/))
            {
                if (!potionUsed)
                {
                    comboKeys += "A";

                    if (comboKeys != "UA" && comboKeys != "RA" && comboKeys != "DA" && comboKeys != "LA")
                    {
                        animator.SetBool("isAttacking", true);

                        speed = attackSpeed * (1 + (4 * timeSlowMoEffectValue));

                        /*
                         * if (playerNo == 1)
                         *      Subtitles.AddPlayer1Subtitle("TEST_Player 1 Attacking");
                         * else if (playerNo == 2)
                         *      Subtitles.AddPlayer2Subtitle("TEST_Player 2 Attacking");
                         */

                        if (animator.GetBool("isWalking"))
                        {
                            attackSpeedTimer = attackSpeedTime;
                        }
                        else
                        {
                            int dir = animator.GetInteger("direction");
                            if (dir == 0)
                            {
                                walkInput.x = 0;
                                walkInput.y = 1;
                            }
                            else if (dir == 1)
                            {
                                walkInput.x = 1;
                                walkInput.y = 0;
                            }
                            else if (dir == 2)
                            {
                                walkInput.x = 0;
                                walkInput.y = -1;
                            }
                            else if (dir == 3)
                            {
                                walkInput.x = -1;
                                walkInput.y = 0;
                            }
                            attackSpeedTimer = attackSpeedTime / 2f;
                        }

                        actionPoints -= attackActionDeplete;

                        if (aud != null && TogglesValues.sound)
                        {
                            aud.PlayOneShot(weaponSounds[weaponPossession.weaponID + 1], weaponSoundVolumes[weaponPossession.weaponID + 1]);
                        }
                    }
                }

                potionUsed = false;
            }

            //Push
            if (pushPossible != null &&
                !animator.GetBool("isPushing") &&
                !animator.GetBool("isAttacking") &&
                !animator.GetBool("isThrowing") &&
                !isDashing &&
                (comboKeys == "UU" || comboKeys == "RR" || comboKeys == "DD" || comboKeys == "LL"))
            {
                animator.SetBool("isPushing", true);
                speed = 0f;

                if (playerNo == 1)
                {
                    Subtitles.AddPlayer1Subtitle("TEST_Player 1 Pushing");
                }
                else if (playerNo == 2)
                {
                    Subtitles.AddPlayer2Subtitle("TEST_Player 2 Pushing");
                }

                actionPoints -= pushActionDeplete;

                pushPossible = null;

                comboKeys = "";
            }

            //Dash
            if (actionPoints >= dashActionDeplete &&
                !isDashing &&
                !animator.GetBool("isAttacking") &&
                !animator.GetBool("isPushing") &&
                !animator.GetBool("isThrowing") &&
                (comboKeys == "UU" || comboKeys == "RR" || comboKeys == "DD" || comboKeys == "LL" ||
                 comboKeys == "UR" || comboKeys == "UL" || comboKeys == "DR" || comboKeys == "DL" ||
                 comboKeys == "RU" || comboKeys == "RD" || comboKeys == "LU" || comboKeys == "LD") &&
                hitCheck.knockback == Vector2.zero)
            {
                isDashing = true;
                dashTimer = dashTime / (1 + (4 * timeSlowMoEffectValue));
                speed     = dashSpeed * (1 + (4 * timeSlowMoEffectValue));

                gameObject.layer = 10;

                actionPoints -= dashActionDeplete;

                if (aud != null && TogglesValues.sound)
                {
                    aud.PlayOneShot(dashSound);
                }

                comboKeys = "";
            }

            //Throw
            if (!animator.GetBool("isThrowing") &&
                !animator.GetBool("isAttacking") &&
                !animator.GetBool("isPushing") &&
                !isDashing &&
                (((keyComboTimer <= keyComboMaxTimeGap / 3.8f) && (comboKeys == "UA" || comboKeys == "RA" || comboKeys == "DA" || comboKeys == "LA")) ||
                 ((Input.GetButtonDown(attackInput + inputExtensionString)) && (Input.GetButtonDown(walkHorizontalInput + inputExtensionString) || Input.GetButtonDown(walkVerticalInput + inputExtensionString))))
                )
            {
                animator.SetBool("isThrowing", true);
                speed = attackSpeed * (1 + (4 * timeSlowMoEffectValue));

                attackSpeedTimer = attackSpeedTime / 2f;

                actionPoints -= throwActionDeplete;

                if (throwFXObject && nextFXdelay < 0f)
                {
                    GameObject FX = Instantiate(throwFXObject, transform.position, Quaternion.Euler(0f, 0f, 0f));
                    nextFXdelay = MINIMUM_TIME_BETWEEN_FX;
                }

                comboKeys = "";
            }

            if (actionPoints < 1f)
            {
                actionPoints += regenerateActionPointsPerSec * Time.deltaTime * (1 + (4 * timeSlowMoEffectValue));
            }

            if (isDashing && dashTimer <= 0f)
            {
                isDashing        = false;
                speed            = walkSpeed * (1 + (4 * timeSlowMoEffectValue));
                gameObject.layer = 8;
            }
            else if (dashTimer > 0f || (attackSpeedTimer > 0f && attackSpeedTimer < attackSpeedTime / 3f))
            {
                GameObject ghostSpriteFX = Instantiate(dashFXObject, transform.position, Quaternion.Euler(0f, 0f, 0f));

                SpriteRenderer GSFX_sprRend = ghostSpriteFX.GetComponent <SpriteRenderer>();

                if (dashFXObject && nextFXdelay < 0f)
                {
                    GameObject FX = Instantiate(dashFXObject, transform.position, Quaternion.Euler(0f, 0f, 0f));
                    FX.GetComponent <SpriteRenderer>().sprite = sprRenderer.sprite;
                    nextFXdelay = MINIMUM_TIME_BETWEEN_FX;
                }


                GSFX_sprRend.sprite = sprRenderer.sprite;

                if (name == "Player1")
                {
                    GSFX_sprRend.color          = Color.red;
                    GSFX_sprRend.material.color = Color.red;
                }
                else
                {
                    GSFX_sprRend.color          = Color.green;
                    GSFX_sprRend.material.color = Color.green;
                }
            }

            if ((animator.GetBool("isAttacking") || animator.GetBool("isThrowing")) && attackSpeedTimer <= 0f)
            {
                speed = 0f;
            }

            if (keyComboTimer >= keyComboMaxTimeGap)
            {
                comboKeys = "";
            }

            if (comboKeys != "")
            {
                keyComboTimer += Time.deltaTime;
            }
            else
            {
                keyComboTimer = 0f;
            }

            if (hitComboTimer <= 0f)
            {
                hitComboCount = 0;
            }
            else
            {
                hitComboTimer -= Time.deltaTime;
            }

            if (criticalHitTimePauseTimer <= 0f)
            {
                if (Time.timeScale >= 0.05f && Time.timeScale <= 0.1f)
                {
                    Time.timeScale = 1f;
                }
                else if (timeSlowMoTimer > 0f)
                {
                    timeSlowMoTimer -= Time.unscaledDeltaTime;
                    Time.timeScale   = Mathf.Lerp(Time.timeScale, 0.5f, 0.025f);

                    ImageEffect.SetImageEffectMaterialIndex(2);

                    timeSlowMoEffectValue = Mathf.Lerp(timeSlowMoEffectValue, 0.25f, 0.025f);
                    ImageEffect.SetImageEffectValue(timeSlowMoEffectValue);
                }
                else if (timeSlowMoTimer <= 0f)
                {
                    if (Time.timeScale >= 0.5f && Time.timeScale != 1f)
                    {
                        if (Time.timeScale <= 0.505f && aud != null && TogglesValues.sound)
                        {
                            aud.PlayOneShot(slowMoToNormalSound);
                        }

                        Time.timeScale = Mathf.Lerp(Time.timeScale, 1f, 0.05f);

                        if (Time.timeScale >= 0.98f)
                        {
                            Time.timeScale = 1f;
                        }
                    }

                    if (timeSlowMoEffectValue <= 0f)
                    {
                        ImageEffect.SetImageEffectMaterialIndex(0);
                        ImageEffect.SetImageEffectValue(0.04f);

                        timeSlowMoEffectValue = 0f;
                    }
                    else
                    {
                        timeSlowMoEffectValue -= Time.unscaledDeltaTime / 5f;
                        ImageEffect.SetImageEffectValue(timeSlowMoEffectValue);
                    }
                }
            }
            else
            {
                Time.timeScale             = 0.06f;
                criticalHitTimePauseTimer -= Time.unscaledDeltaTime;
            }

            animator.speed = 1f * (1 + (4 * timeSlowMoEffectValue));

            attackSpeedTimer -= Time.deltaTime;
            dashTimer        -= Time.deltaTime;
            nextFXdelay      -= Time.deltaTime;        // don't spam FX every frame

            prevWalkState = walkInput == Vector2.zero ? 0 : 1;
        }
    }
Ejemplo n.º 36
0
 private void SetInstance()
 {
     instance = this;
 }
Ejemplo n.º 37
0
 public void InitBodywork(int bodyworkID, TankComponent tank, MoveComponent move, GameobjectComponent gameobjectComponent)
 {
     gameobjectComponent.animator.SetInteger("state", 0); // enter the idle animation
     EquipBodywork(EquipmentManager.GetInstance().GetBodywork(bodyworkID), tank, move, gameobjectComponent);
 }
Ejemplo n.º 38
0
    protected InventoryManager inventory;  //needed for the Item at the itemarray position

    public void Start()
    {
        equipmentManager = GameObject.Find("Equipment").GetComponent <EquipmentManager>();                //needed for adding ITems to the slots of the UI and the PLayer GO
        inventory        = GameObject.Find("Inventory").GetComponent <InventoryUIConnection>().inventory; //needed for adding ITems to the slots of the UI and the PLayer GO
    }
Ejemplo n.º 39
0
    // =============================================================================
    // =============================================================================
    // METHODS UNITY ---------------------------------------------------------------
    void Awake()
    {
        base.Awake ();

        PlayerMov = Player.GetComponent<PlayerMovement> ();
        //dan
        //PlayerRot = Player.GetComponent<PlayerRotation> ();
        Layer = gameObject.GetComponent<LayerSetterElement> ();
        EquipManager = GameObject.FindObjectOfType ( typeof(EquipmentManager) ) as EquipmentManager; // = NULL !!! Da "Equiptment" vom Player aus dem ISS-Projekt nicht übernommen wurde.
    }
Ejemplo n.º 40
0
 public void Awake()
 {
     equipmentManager = GetComponent <EquipmentManager>();
 }
Ejemplo n.º 41
0
 void Awake()
 {
     instance = this;
 }
 void Awake()
 {
     instance = this;
     manager  = EquipmentManager.instance;
 }