//beginTime должен быть больше endTime //тип 2 номер 3 public void WeaponPush(HitController hitControl, Rigidbody2D rigid, float pDamage,float fDamage,float dDamage,float aDamage, int attack, bool backStab, float backStabKoof, int time, int beginTime, int endTime, int timeToPush, Vector2 fVect) { int i; bool b=false; hitControl.pDamage = pDamage; hitControl.fDamage = fDamage; hitControl.dDamage = dDamage; hitControl.aDamage = aDamage; hitControl.attack = attack; hitControl.backStab = backStab; hitControl.backStabKoof = backStabKoof; if (hitControl.actTime==0) hitControl.actTime= time; if ((hitControl.actTime > endTime)&&(hitControl.actTime<=beginTime)) hitControl.GetComponent<BoxCollider2D> ().enabled = true; else if (hitControl.actTime >beginTime) hitControl.GetComponent<BoxCollider2D> ().enabled = false; for (i=0; i<hitControl.list.Count; i++) if (hitControl.list [i] != rigid.gameObject) b = true; if ((b)&&(hitControl.actTime==timeToPush)) { if (rigid.gameObject.GetComponent<Stats>()!=null) { if (rigid.gameObject.GetComponent<Stats>().stats.groundness==4) rigid.AddForce(fVect); } else rigid.AddForce(fVect); } }
//beginTime должен быть больше endTime /*//тип 2 номер 1 public void WeaponMove(Equipment equip, RootCharacterController control, Stats stats, SpFunctions Sp, bool isItRight) { WeaponClass weapon; if (isItRight) weapon = equip.rightWeapon; else weapon = equip.leftWeapon; int i; int j=-1; Rigidbody2D rigid = control.gameObject.rigidbody2D; clavisher clav = Sp.gameObject.GetComponent<clavisher> (); for (i=weapon.moveset.Length-1; i>=0; i--) { if (Sp.ClaveComparation(weapon.moveset[i].why.claves,clav)) if (Sp.FComparation(Mathf.Abs(rigid.velocity.x),weapon.moveset[i].why.speedX*1f)&& Sp.FComparation(Mathf.Abs(rigid.velocity.y),weapon.moveset[i].why.speedY*1f)&& (weapon.moveset[i].why.employment<=stats.stats.employment)&& Sp.IntComparation(stats.stats.direction+2, weapon.moveset[i].why.direction)&& Sp.IntComparation(stats.stats.groundness,weapon.moveset[i].why.groundness)&& Sp.IntComparation(stats.stats.obstacleness,weapon.moveset[i].why.obstacleness)&& Sp.IntComparation(stats.stats.groundness,weapon.moveset[i].why.groundness)&& Sp.ComprFunctionality(stats.stats.maxInteraction,weapon.moveset[i].why.maxinteraction)&& Sp.ComprFunctionality(stats.stats.interaction,weapon.moveset[i].why.interaction)&& Sp.IntComparation(stats.stats.upness,weapon.moveset[i].why.upness)&& Sp.IntComparation(stats.stats.specialness,weapon.moveset[i].why.specialness)&& (!weapon.moveset[i].chosen)) { j=i; break; } } if (j>=0) { control.activityNumb=Sp.AddActivity(control.whatToEmploy,weapon.moveset[j],control.activityNumb); stats.stats.employment-=weapon.moveset[j].employ; if (weapon.moveset[j].soWhat.groundness>=0) stats.stats.groundness=weapon.moveset[j].soWhat.groundness; if (weapon.moveset[j].soWhat.obstacleness>=0) stats.stats.obstacleness=weapon.moveset[j].soWhat.obstacleness; if (weapon.moveset[j].soWhat.interaction>=0)stats.stats.interaction=weapon.moveset[j].soWhat.interaction; if (weapon.moveset[j].soWhat.specialness>=0)stats.stats.specialness=weapon.moveset[j].soWhat.specialness; weapon.moveset[i].chosen=true; } }*/ //тип 2 номер 2 public void WeaponHit(HitController hitControl, float pDamage,float fDamage,float dDamage,float aDamage, int attack, bool backStab, float backStabKoof, int time, int beginTime, int endTime, int direction) { hitControl.pDamage = pDamage; hitControl.fDamage = fDamage; hitControl.dDamage = dDamage; hitControl.aDamage = aDamage; hitControl.attack = attack; hitControl.backStab = backStab; hitControl.backStabKoof = backStabKoof; if (hitControl.actTime==0) hitControl.actTime= time; if ((hitControl.actTime > endTime)&&(hitControl.actTime<=beginTime)) hitControl.GetComponent<BoxCollider2D> ().enabled = true; else if (hitControl.actTime >beginTime) hitControl.GetComponent<BoxCollider2D> ().enabled = false; hitControl.direction = direction; }