public void ResetStatus() { if (isInvisible) { GetComponent<Renderer>().enabled = true; } isInvisible = false; isGreedy = false; isInfrared = false; isArmored = false; isRanged = false; if (isBoosty) { moveSpeed /= GameManager.speedMultiplier; } isBoosty = false; hasTeleport = false; hasSpeedBoost = false; hasRPG = false; hasWallDemo = false; rpgAmmo = 0; UpdateRpgAmmoCount(); Health health = GetComponent<Health> (); health.hitPoints = 1; ActiveSkill = ActiveSkillType.None; gun.HideInfrared(); if (gun.GetBulletRange() != gun.defaultBulletRange) { gun.SetBulletRange (gun.defaultBulletRange); } inventoryManager.ResetStatus(); Timer timer = GetComponent<Timer> (); timer.ResetAll (); }
[HideInInspector] public SkillImageForSlot CurDraggingSkillImageForSlot; //현재 슬롯위에 올려진 스킬중 드래그 중인 스킬 public void SetDraggingSKill(ActiveSkillType _SkillType) { curDraggingSkill = _SkillType; }
// Update is called once per frame void Update() { // FIRING PROJECTILES AND ACTIVATING SKILLS (human mode only) if (!isAvenger && CrossPlatformInputManager.GetAxisRaw(fireButton) > 0.75f && isTriggerReleased) { isTriggerReleased = false; BroadcastMessage("OnFireRifle"); } if (!isAvenger && CrossPlatformInputManager.GetAxisRaw(fireButton) < 0.25f) { isTriggerReleased = true; } if (!isAvenger && CrossPlatformInputManager.GetButtonDown(skillButton)) { // check which skill is selected newSkillInteger = inventoryManager.GetActiveSkill(); ActiveSkill = (ActiveSkillType) newSkillInteger; Debug.Log ("active skill: " + ActiveSkill); // activate selected skill if (ActiveSkillType.WallDemo == ActiveSkill && hasWallDemo) { StartCoroutine("SetWallDemo", GameManager.wallDemoDuration); } if (ActiveSkillType.SpeedBoost == ActiveSkill && hasSpeedBoost && ! isBoosty) { if (isArmored) { RemoveArmor(); } StartCoroutine("DoSpeedBoost", GameManager.boostDuration); inventoryManager.RemoveSkill(newSkillInteger); } if (ActiveSkillType.Teleport == ActiveSkill && hasTeleport) { StartCoroutine("Teleport"); inventoryManager.RemoveSkill(newSkillInteger); } if (ActiveSkillType.RPG == ActiveSkill && 0 < rpgAmmo) { Invoke ("BroadcastFireRPG", 0.01f); // firing delay taken care of in Gun.cs } } if (!isAvenger && CrossPlatformInputManager.GetButtonUp(skillButton)) { CancelInvoke(); } // ACTIVATING INVISIBILITY (Avenger mode only) if (isAvenger && CrossPlatformInputManager.GetButtonDown (invisibilityButton)) { if (!isInvisibilityOnCooldown) { StartCoroutine ("DoInvisibilityCycle"); } } // SELECTING SKILLS // SPEED BOOST selected with B button or Right on D-Pad if ( CrossPlatformInputManager.GetButtonDown(speedBoostButton) || 1 == CrossPlatformInputManager.GetAxis(speedBoostButton) ) { if (!isAvenger && hasSpeedBoost) { newSkillInteger = (int) ActiveSkillType.SpeedBoost; inventoryManager.SetActiveSkill(newSkillInteger); } } // TELEPORT selected with A button or Down on D-Pad if ( CrossPlatformInputManager.GetButtonDown(teleportButton) || -1 == CrossPlatformInputManager.GetAxis(teleportButton) ) { if (!isAvenger && hasTeleport) { newSkillInteger = (int) ActiveSkillType.Teleport; inventoryManager.SetActiveSkill(newSkillInteger); } } // RPG selected with X button or Left on D-Pad if ( CrossPlatformInputManager.GetButtonDown(rpgButton) || -1 == CrossPlatformInputManager.GetAxis(rpgButton) ) { if (!isAvenger && hasRPG) { newSkillInteger = (int) ActiveSkillType.RPG; inventoryManager.SetActiveSkill(newSkillInteger); } } // WALL DEMO selected with Y button or Up on D-Pad if ( CrossPlatformInputManager.GetButtonDown(wallDemoButton) || 1 == CrossPlatformInputManager.GetAxis(wallDemoButton) ) { if (!isAvenger && hasWallDemo) { newSkillInteger = (int) ActiveSkillType.WallDemo; inventoryManager.SetActiveSkill(newSkillInteger); } } }
// Use this for initialization void Start() { gun = GetComponentInChildren<Gun>(); inventoryManager = GetComponent<InventoryManager>(); spawnManager = FindObjectOfType<SpawnManager>(); rocketsAmountText = FindRocketsAmountText(name); UpdateRpgAmmoCount(); ActiveSkill = ActiveSkillType.None; }