public void Sit() //Abilité avec Target { if (Target != null) { Destroy(Target); } Target = Instantiate(prefabSkill, position, prefabSkill.transform.rotation); Target.transform.localScale = new Vector3(Target.transform.localScale.x * ScaleFactor * 2, Target.transform.localScale.y * ScaleFactor * 2, Target.transform.localScale.z); curentSkill = SKILLS.SIT; firstClick = true; }
public void Move() //Abilité avec Target { if (Target != null) //Detruit le sort précedent si l'on appuit sur un autre sort { Destroy(Target); } Target = Instantiate(prefabSkill, position, prefabSkill.transform.rotation); //Apparition de la zone du spell Target.transform.localScale = new Vector3(Target.transform.localScale.x * ScaleFactor, Target.transform.localScale.y * ScaleFactor, Target.transform.localScale.z); //Scale de la Zone curentSkill = SKILLS.MOVE; firstClick = true; }
public void TryToLearnSkill(SKILLS aSkill) { float chanceToLearn = UnityEngine.Random.Range(0.0f, 100.0f); //Debug.Log("Trying to learn : " + chanceToLearn); if (chanceToLearn < learnChance) { mSkills.Add(aSkill); Debug.Log("SKILLLZZZ"); // TODO : Animation GetComponent <Renderer>().material = LearnMaterial; } }
// Returns all Units GameObjects who doesn't have the param skill public List <Unit> GetIgnorants(SKILLS skill) { List <Unit> resultList = new List <Unit>(); foreach (GameObject obj in AllAgents) { Unit unitComponent = obj.GetComponentInChildren <Unit> (); if (unitComponent != null && !unitComponent.haveSkill(skill)) { resultList.Add(unitComponent); } } return(resultList); }
// returns true if unit have a skill public bool haveSkill(SKILLS skill) { return(mSkills.Contains(skill)); }
private void Update() { // if(Input.GetKeyUp("up")) // { // ponteiro.transform.position += new Vector3(stressMesure,0,0); // stress++; // } // // if(Input.GetKeyUp("down")) // { // ponteiro.transform.position -= new Vector3(stressMesure,0,0); // stress--; // } if (!stop) { this._Input(); } if (this.life <= 0) { this.dead = true; } if (this.verifyCharge) { this.StartTime(); if (this.timeForCharge > this.timeMaxForCharge) { this.verifyCharge = false; this.timeForCharge = 0; } } //Skill Maganer if (Input.GetKeyDown("1")) { skill = SKILLS.AXE; } if (Input.GetKeyDown("2")) { skill = SKILLS.GUN; } if (Input.GetKeyDown("q")) { switch(skill){ case SKILLS.AXE: skill = SKILLS.GUN; break; case SKILLS.GUN: skill = SKILLS.AXE; break; } } icon.guiText.text = skill.ToString(); print (stress); }
private void Start() { animator = GetComponent<Animator>(); icon = GameObject.Find("skillIcon"); skill = SKILLS.AXE; stressAux = stress; }