private void KV1Preset() { //ShootMechanism, Movement CheckController(); SetAmmoData(); //Chassis; tankData = EditTankData(tankData, 150, 120, 80, rocketData.ReloadTime, 1600, 200); //Tracks tracksLeftData = EditTracksData(tracksLeftData, 50, 10, 15, 200, 13000, 10); // ++ // tracksRightData = EditTracksData(tracksRightData, 50, 10, 15, 200, 13000, 10); //Turret turretData = EditTurretData(turretData, 50, 400, 20, 20, 80, 80, 80); //GunShield gunData = EditGunData(gunData, 50, 10, 10, shellData.ReloadTime, 150, shellCaliber); gunData.Reload(); tankData.MaxWeight = tracksLeftData.WeightCapacity + tracksRightData.WeightCapacity; //Chassis PresetWeight(); SetCommonData(); if (user == "Player") { PlayerMechanics(); } }
private DataGun EditGunData(DataGun gun, int rotationSpeed, int traverse, int depression, double reloadTime, int power, DataShells.ShellSize shellCaliber) { gun.RotationSpeed = rotationSpeed; gun.AngleTraverse = traverse; gun.AngleDepression = depression; gun.ReloadTime = reloadTime; gun.Power = power; gun.ShellCaliber = shellCaliber; return(gun); }
private void RefreshAmmo() { gunData =(DataGun) gameObject.GetComponent("DataGun"); }
private void Start() { Physics.gravity = new Vector3(0, -gameGravity * 1.5f, 0); user = gameObject.name; int counter = 0; foreach (var item in gameObject.GetComponentsInChildren <Transform>()) { if (counter != 0 && !item.name.Contains("Camera")) { item.name = user + item.name; } counter++; } //GET objects //Chassis chassis = GameObject.Find(user + "Chassis"); //MinigGun miniGun = GameObject.Find(user + "MiniGun"); //SideSkirts sideSkirts = GameObject.Find(user + "SideSkirts"); //TrackLeft trackLeft = GameObject.Find(user + "TrackLeft"); //TrackRight trackRight = GameObject.Find(user + "TrackRight"); //Turret turret = GameObject.Find(user + "Turret"); //turretControl turretControl = GameObject.Find(user + "TurretControl"); //GunShield gunShield = GameObject.Find(user + "GunShield"); //GunShieldControl gunShieldControl = GameObject.Find(user + "GunShieldControl"); //Gun gun = GameObject.Find(user + "Gun"); //Shell shell = GameObject.Find(tankPreset.ToString() + "Shell"); //HatchControl hatchControl = GameObject.Find(user + "HatchControl"); //Rocket rocket = GameObject.Find(tankPreset.ToString() + "Rocket"); //HatchOpener hatchOpener = GameObject.Find(user + "HatchOpener"); //Hatch hatch = GameObject.Find(user + "Hatch"); //BonusProps ( chassis ) bonusProps = GameObject.Find(user + "BonusProps"); //BonusProps_1 ( turret ) bonusProps_1 = GameObject.Find(user + "BonusProps_1"); //Emmiters smokeExhaustLeft = GameObject.Find(user + "LeftExhaust").GetComponent("ParticleSystem") as ParticleSystem; smokeExhaustRight = GameObject.Find(user + "RightExhaust").GetComponent("ParticleSystem") as ParticleSystem; //For when going forward dirtForwardLeft = GameObject.Find(user + "TrackForwardLeft").GetComponent("ParticleSystem") as ParticleSystem; dirtForwardRight = GameObject.Find(user + "TrackForwardRight").GetComponent("ParticleSystem") as ParticleSystem; //For when going backward dirtBackwardLeft = GameObject.Find(user + "TrackBackLeft").GetComponent("ParticleSystem") as ParticleSystem; dirtBackwardRight = GameObject.Find(user + "TrackBackRight").GetComponent("ParticleSystem") as ParticleSystem; gunSmoke = GameObject.Find(user + "GunSmoke").GetComponent("ParticleSystem") as ParticleSystem; smokeDead = GameObject.Find(user + "DeadSmoke").GetComponent("ParticleSystem") as ParticleSystem; //TrackWheels trackWheelsL = GameObject.Find(user + "TrackWheelsLeft"); trackWheelsR = GameObject.Find(user + "TrackWheelsRight"); Transform[] wheels = trackWheelsL.GetComponentsInChildren <Transform>(); for (int i = 0; i < wheels.Length; i++) { trackWheelsLeft[i] = wheels[i]; } wheels = trackWheelsR.GetComponentsInChildren <Transform>(); for (int i = 0; i < wheels.Length; i++) { trackWheelsRight[i] = wheels[i]; } //Create Data Module //Chassis tankData = chassis.AddComponent("DataTank") as DataTank; engine = chassis.AddComponent("AudioSource") as AudioSource; engineMoving = gameObject.AddComponent("AudioSource") as AudioSource; //MinigGun if (minigunActive) { miniGun.renderer.enabled = true; } else { miniGun.renderer.enabled = false; } //SideSkirts if (sideSkirtsActive) { sideSkirts.renderer.enabled = true; } else { sideSkirts.renderer.enabled = false; } //TrackLeft tracksLeftData = trackLeft.AddComponent("DataTracks") as DataTracks; //TrackRight tracksRightData = trackRight.AddComponent("DataTracks") as DataTracks; //Turret turretData = turret.AddComponent("DataTurret") as DataTurret; //Turret Control //GunShield //Gun gunData = gun.AddComponent("DataGun") as DataGun; gunFire = gun.AddComponent("AudioSource") as AudioSource; //HatchControl rocketFire = hatchControl.AddComponent("AudioSource") as AudioSource; //HatchOpener //Hatch //BonusProps ( chassis if (showChassisProps) { bonusProps.renderer.enabled = true; } else { bonusProps.renderer.enabled = false; } //BonusProps_1 ( turret if (showTurretProps) { bonusProps_1.renderer.enabled = true; } else { bonusProps_1.renderer.enabled = false; } //LoadData if (tankPreset.ToString() == "Panther") { PantherPreset(); } else if (tankPreset.ToString() == "KV1") { KV1Preset(); } else if (tankPreset.ToString() == "KingTiger") { KingTigerPreset(); } else if (tankPreset.ToString() == "IS3") { IS3Preset(); } else if (tankPreset.ToString() == "T44") { T44Preset(); } else if (tankPreset.ToString() == "Custom") { CustomPreset(); } else { TankNotFound(); } }
private void RefreshAmmo() { gunData = (DataGun)gameObject.GetComponent("DataGun"); }
private void KV1Preset() { //ShootMechanism, Movement CheckController(); SetAmmoData(); //Chassis; tankData = EditTankData(tankData, 150, 120, 80, rocketData.ReloadTime, 1600, 200); //Tracks tracksLeftData = EditTracksData(tracksLeftData, 50, 10 , 15, 200, 13000, 10); // ++ // tracksRightData = EditTracksData(tracksRightData, 50, 10 , 15, 200, 13000, 10); //Turret turretData = EditTurretData(turretData, 50, 400, 20, 20, 80, 80, 80); //GunShield gunData = EditGunData(gunData, 50, 10, 10, shellData.ReloadTime, 150, shellCaliber); gunData.Reload(); tankData.MaxWeight = tracksLeftData.WeightCapacity + tracksRightData.WeightCapacity; //Chassis PresetWeight(); SetCommonData(); if(user == "Player") { PlayerMechanics(); } }
private DataGun EditGunData(DataGun gun, int rotationSpeed, int traverse, int depression, double reloadTime, int power, DataShells.ShellSize shellCaliber) { gun.RotationSpeed = rotationSpeed; gun.AngleTraverse = traverse; gun.AngleDepression = depression; gun.ReloadTime = reloadTime; gun.Power = power; gun.ShellCaliber = shellCaliber; return gun; }
private void Start () { Physics.gravity = new Vector3 ( 0, -gameGravity * 1.5f, 0); user = gameObject.name; int counter = 0; foreach (var item in gameObject.GetComponentsInChildren<Transform>()) { if(counter != 0 && !item.name.Contains("Camera")) { item.name = user + item.name; } counter++; } //GET objects //Chassis chassis = GameObject.Find(user + "Chassis"); //MinigGun miniGun = GameObject.Find(user + "MiniGun"); //SideSkirts sideSkirts = GameObject.Find(user + "SideSkirts"); //TrackLeft trackLeft = GameObject.Find(user + "TrackLeft"); //TrackRight trackRight = GameObject.Find(user + "TrackRight"); //Turret turret = GameObject.Find(user + "Turret"); //turretControl turretControl = GameObject.Find(user + "TurretControl"); //GunShield gunShield = GameObject.Find(user + "GunShield"); //GunShieldControl gunShieldControl = GameObject.Find(user + "GunShieldControl"); //Gun gun = GameObject.Find(user + "Gun"); //Shell shell = GameObject.Find(tankPreset.ToString() + "Shell"); //HatchControl hatchControl = GameObject.Find(user + "HatchControl"); //Rocket rocket = GameObject.Find(tankPreset.ToString() + "Rocket"); //HatchOpener hatchOpener = GameObject.Find(user + "HatchOpener"); //Hatch hatch = GameObject.Find(user + "Hatch"); //BonusProps ( chassis ) bonusProps = GameObject.Find(user + "BonusProps"); //BonusProps_1 ( turret ) bonusProps_1 = GameObject.Find(user + "BonusProps_1"); //Emmiters smokeExhaustLeft = GameObject.Find(user + "LeftExhaust").GetComponent("ParticleSystem") as ParticleSystem; smokeExhaustRight = GameObject.Find(user + "RightExhaust").GetComponent("ParticleSystem") as ParticleSystem; //For when going forward dirtForwardLeft = GameObject.Find(user + "TrackForwardLeft").GetComponent("ParticleSystem") as ParticleSystem; dirtForwardRight = GameObject.Find(user + "TrackForwardRight").GetComponent("ParticleSystem") as ParticleSystem; //For when going backward dirtBackwardLeft = GameObject.Find(user + "TrackBackLeft").GetComponent("ParticleSystem") as ParticleSystem; dirtBackwardRight = GameObject.Find(user + "TrackBackRight").GetComponent("ParticleSystem") as ParticleSystem; gunSmoke = GameObject.Find(user + "GunSmoke").GetComponent("ParticleSystem") as ParticleSystem; smokeDead = GameObject.Find(user + "DeadSmoke").GetComponent("ParticleSystem") as ParticleSystem; //TrackWheels trackWheelsL = GameObject.Find(user+"TrackWheelsLeft"); trackWheelsR = GameObject.Find(user+"TrackWheelsRight"); Transform[] wheels = trackWheelsL.GetComponentsInChildren<Transform>(); for (int i = 0; i < wheels.Length; i++) { trackWheelsLeft[i] = wheels[i]; } wheels = trackWheelsR.GetComponentsInChildren<Transform>(); for (int i = 0; i < wheels.Length; i++) { trackWheelsRight[i] = wheels[i]; } //Create Data Module //Chassis tankData = chassis.AddComponent("DataTank") as DataTank; engine = chassis.AddComponent("AudioSource") as AudioSource; engineMoving = gameObject.AddComponent("AudioSource") as AudioSource; //MinigGun if(minigunActive) { miniGun.renderer.enabled = true; } else { miniGun.renderer.enabled = false; } //SideSkirts if(sideSkirtsActive) { sideSkirts.renderer.enabled = true; } else { sideSkirts.renderer.enabled = false; } //TrackLeft tracksLeftData = trackLeft.AddComponent("DataTracks") as DataTracks; //TrackRight tracksRightData = trackRight.AddComponent("DataTracks") as DataTracks; //Turret turretData = turret.AddComponent("DataTurret") as DataTurret; //Turret Control //GunShield //Gun gunData = gun.AddComponent("DataGun") as DataGun; gunFire = gun.AddComponent("AudioSource") as AudioSource; //HatchControl rocketFire = hatchControl.AddComponent("AudioSource") as AudioSource; //HatchOpener //Hatch //BonusProps ( chassis if(showChassisProps) { bonusProps.renderer.enabled = true; } else { bonusProps.renderer.enabled = false; } //BonusProps_1 ( turret if(showTurretProps) { bonusProps_1.renderer.enabled = true; } else { bonusProps_1.renderer.enabled = false; } //LoadData if(tankPreset.ToString() == "Panther") { PantherPreset(); } else if(tankPreset.ToString() == "KV1") { KV1Preset(); } else if(tankPreset.ToString() == "KingTiger") { KingTigerPreset(); } else if(tankPreset.ToString() == "IS3") { IS3Preset(); } else if(tankPreset.ToString() == "T44") { T44Preset(); } else if(tankPreset.ToString()== "Custom") { CustomPreset(); } else { TankNotFound(); } }