Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

ImHaxoTV

Newbie
  • Content count

    17
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ImHaxoTV

  • Rank
    Newbie
  • Birthday 02/22/1998

Profile Information

  • Gender
    Male
  • Location:
    Germany

Contact Methods

  1. Unity Update Mode - Help

    Hello Armedunity forum, I have one question to the Unity update mode. Question: How can I switch from the animation update mode "Animate Physics" to "normal" and then automatically back to "Animate Physics" again with a UI button click? So via a UI button, switching the animator from "Animate Physics" to "normal" and then automatically back to "Animate Physics" again. From"Animate Physics": To "normal" and then automatically back to "Animate Physics" again. It would be cool if one can help me with that;) Thanks
  2. I have created a own code, so it woks now.
  3. Hey, I have a question to a function, it wourld be cool if you can help me. I wourld insert a function to change the animation controller for 20 secounds from the selected player, if the player shoot/hit at enemy. And then will it switch back to the old animation controller, so after 20 secounds. So, the player has a normal idle, walk, meele attack in the first animation controller. And if the player hit the enemy will the first normal animation controller switch to the other controller with the attack idle, attack walk etc and after 20 secounds is the normal animation controller back. So the player have again the normal animations. Do you know how can I make it? The code: using UnityEngine; using System.Collections; public class BulletStatusC : MonoBehaviour { public int damage = 10; public int damageMax = 20; [HideInInspector] public int playerAttack = 5; public int totalDamage = 0; public int variance = 15; [Range(0, 100)] public int criticalChance = 0; public string shooterTag = "Player"; [HideInInspector] public GameObject shooter; public Transform Popup; public GameObject hitEffect; public bool flinch = false; public bool penetrate = false; private string popDamage = ""; public AtkType AttackType = AtkType.Physic; public Elementala element = Elementala.Normal; [Range(0 , 100)] public int drainHp = 0; public BombHit bombHitSetting; //----------------------------- void Start(){ if(variance >= 100){ variance = 100; } if(variance <= 1){ variance = 1; } } public void Setting(int str , int mag , string tag , GameObject owner){ //print ("GuSetLaew"); if(AttackType == AtkType.Physic){ playerAttack = str; }else{ playerAttack = mag; } shooterTag = tag; shooter = owner; int varMin = 100 - variance; int varMax = 100 + variance; int randomDmg = Random.Range(damage, damageMax); totalDamage = (randomDmg + playerAttack) * Random.Range(varMin ,varMax) / 100; } void OnTriggerEnter(Collider other){ //When Player Shoot at Enemy if(shooterTag == "Player" && other.tag == "Enemy"){ Transform dmgPop = Instantiate(Popup, other.transform.position , transform.rotation) as Transform; if(criticalChance >= 1){ if(criticalChance >= 100){ criticalChance = 100; } int per = Random.Range(0, 100); if(per <= criticalChance){ if(Camera.main.GetComponent<ARPGcameraC>()) Camera.main.GetComponent<ARPGcameraC>().Shake(0.5f , 0.35f); dmgPop.GetComponent<DamagePopupC>().critical = true; totalDamage *= 2; } } if(AttackType == AtkType.Physic){ popDamage = other.GetComponent<StatusC>().OnDamage(totalDamage , (int)element); }else{ popDamage = other.GetComponent<StatusC>().OnMagicDamage(totalDamage , (int)element); } if(shooter && shooter.GetComponent<ShowEnemyHealthC>()){ shooter.GetComponent<ShowEnemyHealthC>().GetHP(other.GetComponent<StatusC>().maxHealth , other.gameObject , other.name); } dmgPop.GetComponent<DamagePopupC>().damage = popDamage; if(hitEffect){ Instantiate(hitEffect, transform.position , transform.rotation); } if(flinch){ Vector3 dir = (other.transform.position - transform.position).normalized; //other.GetComponent<AIsetC>().Flinch(dir); other.SendMessage("Flinch" , dir , SendMessageOptions.DontRequireReceiver); } if(bombHitSetting.enable){ ExplosionDamage(); } //Drain HP if(drainHp > 0 && shooter && popDamage != "Miss" && popDamage != "Evaded" && popDamage != "Guard" && popDamage != "Invulnerable"){ int lf = int.Parse(popDamage) * drainHp; lf /= 100; if(lf < 1){ lf = 1; } Vector3 hpos = shooter.transform.position; hpos.y += 0.75f; Transform hpPop = Instantiate(Popup, hpos , transform.rotation) as Transform; hpPop.GetComponent<DamagePopupC>().damage = lf.ToString(); hpPop.GetComponent<DamagePopupC>().fontStyle.normal.textColor = Color.green; shooter.GetComponent<StatusC>().Heal(lf , 0); } //---------------------------- if(!penetrate){ Destroy (gameObject); } //When Enemy Shoot at Player }else if(shooterTag == "Enemy" && other.tag == "Player" || shooterTag == "Enemy" && other.tag == "Ally"){ if(AttackType == AtkType.Physic){ popDamage = other.GetComponent<StatusC>().OnDamage(totalDamage , (int)element); }else{ popDamage = other.GetComponent<StatusC>().OnMagicDamage(totalDamage , (int)element); } Transform dmgPop = Instantiate(Popup, transform.position , transform.rotation) as Transform; dmgPop.GetComponent<DamagePopupC>().damage = popDamage; dmgPop.GetComponent<DamagePopupC>().fontStyle.normal.textColor = Color.red; if(hitEffect){ Instantiate(hitEffect, transform.position , transform.rotation); } if(flinch){ Vector3 dir = (other.transform.position - transform.position).normalized; //other.GetComponent<AttackTriggerC>().Flinch(dir); other.SendMessage("Flinch" , dir , SendMessageOptions.DontRequireReceiver); } if(bombHitSetting.enable){ ExplosionDamage(); } //Drain HP if(drainHp > 0 && shooter && popDamage != "Miss" && popDamage != "Evaded" && popDamage != "Guard" && popDamage != "Invulnerable"){ int lf = int.Parse(popDamage) * drainHp; lf /= 100; if(lf < 1){ lf = 1; } Vector3 hpos = shooter.transform.position; hpos.y += 0.75f; Transform hpPop = Instantiate(Popup, hpos , transform.rotation) as Transform; hpPop.GetComponent<DamagePopupC>().damage = lf.ToString(); hpPop.GetComponent<DamagePopupC>().fontStyle.normal.textColor = Color.green; shooter.GetComponent<StatusC>().Heal(lf , 0); } //---------------------------- if(!penetrate){ Destroy (gameObject); } } } public void ExplosionDamage (){ Collider[] hitColliders= Physics.OverlapSphere(transform.position, bombHitSetting.bombRadius); if(bombHitSetting.bombEffect){ Instantiate(bombHitSetting.bombEffect , transform.position , transform.rotation); } for(int i= 0; i < hitColliders.Length; i++) { if(shooterTag == "Player" && hitColliders[i].tag == "Enemy"){ DealDamageOnly(hitColliders[i].transform , false); }else if(shooterTag == "Enemy" && hitColliders[i].tag == "Player" || shooterTag == "Enemy" && hitColliders[i].tag == "Ally"){ DealDamageOnly(hitColliders[i].transform , true); } } bombHitSetting.enable = false; } public void DealDamageOnly(Transform other , bool red){ if(AttackType == AtkType.Physic){ popDamage = other.GetComponent<StatusC>().OnDamage(totalDamage , (int)element); }else{ popDamage = other.GetComponent<StatusC>().OnMagicDamage(totalDamage , (int)element); } Transform dmgPop = Instantiate(Popup, other.position , other.rotation) as Transform; dmgPop.GetComponent<DamagePopupC>().damage = popDamage; if(red){ dmgPop.GetComponent<DamagePopupC>().fontStyle.normal.textColor = Color.red; } if(hitEffect){ Instantiate(hitEffect, other.position , other.rotation); } if(flinch){ Vector3 dir = (other.transform.position - transform.position).normalized; //other.GetComponent<AttackTriggerC>().Flinch(dir); other.SendMessage("Flinch" , dir , SendMessageOptions.DontRequireReceiver); } } } public enum AtkType { Physic = 0, Magic = 1, } public enum Elementala{ Normal = 0, Fire = 1, Ice = 2, Earth = 3, Lightning = 4, } [System.Serializable] public class BombHit{ public bool enable = false; public GameObject bombEffect; public float bombRadius = 20; }
  4. Ok and how can a gameobject disable a script after the gameobject is enabled? So the "disable script" is on the disabled gameobject and if I enable the gameobject via my UI button, will the "disable script" automatically activate.
  5. Hey, I have one last question. I have created a own script, that should disable a another script if I click on a UI button. But it don't work, what did I do wrong? Code: using System.Collections; using System.Collections.Generic; using UnityEngine; public class DisableScriptwithUIButton : MonoBehaviour { public AttackTriggerC AttackScript; void Start() { AttackScript = GetComponent<AttackTriggerC>(); } public void DisableScript() { AttackScript.enabled = false; } }
  6. Thank you;)
  7. Ok, but can you tell me, what kind of function must I choose?
  8. Thanks, question: How can my UI button activate the "Spawn(transform.position);" call?
  9. Hey, thx for your answer. Do you know, how can I spawn a prefab on my player position by click on a UI button?
  10. Thanks for your helpful answer, it work. I have one another question, do you know, how can I disable a gameobject with a timer. So if I click on the UI button, is the selected gameobject disabled after 2 seconds?
  11. Hey ArmedUnity forum, I'm working on a cool game with the awesome Unity engine and now I need help with one thing. I wan't to change the "Avatar" from my player to a other "Avatar" by a GUI button click. My question is, how can I do that? Thanks;) Screenshot: [1]: https://image.ibb.co/j8bzW7/Change.png
  12. Ok thanks for your help, my german browser has blocked this search results.
  13. Hello, you have written "any c# to js converter will work without decompiling ". Can you tell me the name or how can I find a c# to .js converter? Because I can't find one
  14. Hey, first I understand c# and .JS perfect. I have created many famous modifications for GTA IV and GTA 5 etc, like the first ps4 mod menu or the XMC 6.0. And yeah, strictly speaking my buddy has decompiled the codes from his old "Unity 4"game to open it in Unity 2017. He is one of the creators from "PokeGen" and now he has decompiled the javascripts to c# scripts(.....). Now, we need a tool to decompile the "Assembly-UnityScript.dll", there are the .JS (JavaScripts/UnityScripts). A tool could simply extract them as javascript, but Unity need to publish the JavaScript source code. As far as I know, there is no other solution. Pictures from the "PokeGen" project in Unity 2017:
  15. By mistake I've converted my javascripts/unityscripts to C# scripts (I don't have a backup from my Javascripts), but I have build my game a day ago. So now I use the decompiler to extract my javascripts to get my project source working. The problem is, if I open my builded game with any decompile tool, will any program convert my javascripts to c# scripts automatically(So I can't export my javascripts from my builded game). And my question is: Is there a way to extract the js (Javascripts/unityscripts) from my builded game?
×