/// <summary> /// Method called after object instantiation to initialize fields etc. /// </summary> public virtual void Initialize() { Buffs = new List <Buff>(); UnitState = new UnitStateNormal(this); TotalHitPoints = HitPoints; TotalMovementPoints = MovementPoints; TotalActionPoints = ActionPoints; /*foreach (var boton in GetComponentsInChildren<Button>()) * { * switch (boton.name) * { * case "Defenderse": * defenderse = boton; * break; * default: * break; * } * }*/ if (defenderse != null) { defenderse.gameObject.SetActive(false); defenderse.onClick.AddListener(Defenderse); } defenderseUsado = false; }
/// <summary> /// Method called after object instantiation to initialize fields etc. /// </summary> public virtual void Initialize() { UnitState = new UnitStateNormal(this); TotalHitPoints = HitPoints; TotalMovementPoints = MovementPoints; TotalActionPoints = ActionPoints; }
private static IPathfinding _pathfinder = new AStarPathfinding(); //A* pathfinding algorithm public virtual void Initialize() { UnitState = new UnitStateNormal(this); TotalHP = HP; TotalEnergy = Energy; TotalAttackPoints = AttackPoints; }
/// <summary> /// Method called after object instantiation to initialize fields etc. /// </summary> public virtual void Initialize() { Buffs = new List <Buff>(); UnitState = new UnitStateNormal(this); TotalHitPoints = HitPoints; TotalImaginationPoints = ImaginationPoints; TotalMovementPoints = MovementPoints; TotalActionPoints = ActionPoints; }
//Metoda wywoływana w momencie utworzenia obiektu w celu zainicjowania pól. public virtual void Initialize() { Buffs = new List <Buff>(); UnitState = new UnitStateNormal(this); EndTrn = new CellGrid(); TotalHitPoints = HitPoints; TotalMovementPoints = MovementPoints; TotalActionPoints = ActionPoints; // Debug.Log("obecne zdrowie: " + HitPoints); }
/// <summary> /// Method called after object instantiation to initialize fields etc. /// </summary> public virtual void Initialize() { Buffs = new List<Buff>(); UnitState = new UnitStateNormal(this); TotalHitPoints = HitPoints; TotalMovementPoints = MovementPoints; TotalActionPoints = ActionPoints; }
/// <summary> /// Method called after object instantiation to initialize fields etc. /// </summary> public virtual void Initialize() { Buffs = new List <Buff>(); UnitState = new UnitStateNormal(this); TotalArmor = Armor; TotalHitPoints = HitPoints; TotalMovementPoints = MovementPoints; TotalActionPoints = ActionPoints; basicAttack = AttackFactor; }
/// <summary> /// Method called after object instantiation to initialize fields etc. /// </summary> public virtual void Initialize() { moveOn = false; unitAttack = false; Buffs = new List <Buff>(); UnitState = new UnitStateNormal(this); TotalHitPoints = HitPoints; TotalMovementPoints = MovementPoints; TotalActionPoints = ActionPoints; }
/// <summary> /// Method called after object instantiation to initialize fields etc. /// </summary> public virtual void Initialize() { if (gameObject.GetComponent <Animator>() != null) { anim = gameObject.GetComponent <Animator>(); } Buffs = new List <Buff>(); UnitState = new UnitStateNormal(this); TotalHitPoints = HitPoints; TotalMovementPoints = MovementPoints; TotalActionPoints = ActionPoints; }
private Vector2 prevMove; // Keep track of previous moves for the animator // Initialization of unit after instantiation public override void Initialize() { UnitState = new UnitStateNormal(this); MaxHitPoints = HitPoints; MaxMovementPoints = MovementPoints; MaxActionPoints = ActionPoints; animator = GetComponent <Animator>(); cameraFocus = false; base.Initialize(); }
// Method called after object instantiation to initialize fields etc. public virtual void Initialize() { Buffs = new List <Buff>(); //Debug.Log(Environment.UserName); UnitState = new UnitStateNormal(this); card.UpdateStats(); UnitName = card.name; HP = card.HP; Atk = card.Atk; Spd = card.Spd; Def = card.Def; Res = card.Res; switch (card.range) { case Card.Range.Melee: AttackRange = 1; break; case Card.Range.Ranged: AttackRange = card.rangeFactor; break; case Card.Range.None: AttackRange = 0; break; } TotalHP = HP; switch (card.moveClass) { case Card.MoveClass.Armor: TotalMovementPoints = card.ruleset.armorMovement; break; case Card.MoveClass.Cavalry: TotalMovementPoints = card.ruleset.cavalryMovement; break; case Card.MoveClass.Flier: TotalMovementPoints = card.ruleset.flierMovement; break; case Card.MoveClass.Infantry: TotalMovementPoints = card.ruleset.infantryMovement; break; } TotalActionPoints = ActionPoints; //TotalCounterPoints = CounterPoints; }
public virtual void CustomInitialize() { Buffs = new List <Buff>(); Skills = new List <Skill>(); UnitState = new UnitStateNormal(this); SquadSelectionToFightScene Go = FindObjectOfType <SquadSelectionToFightScene>(); List <UnitData> units = new List <UnitData>(); foreach (UnitData unitdata in Go.squad1.playerData) { units.Add(unitdata); } foreach (UnitData unitdata2 in Go.squad2.playerData) { units.Add(unitdata2); } foreach (var skill in units[CustomUnitGenerator.CurrentUnit].Skills) { Skill newSkill = SkillCheck(skill.Name); Skills.Add(newSkill); } }
/// <summary> /// Method called at start of grid to calculate initial values /// </summary> public virtual void GameInit() { UnitState = new UnitStateNormal(this); this.dynamicAttributes = new attributes(this.getSummedAttributes()); UpdateHpBar(); }
/// <summary> /// Method called after object instantiation to initialize fields etc. /// </summary> public virtual void Initialize() { Buffs = new List <Buff>(); Skills = new List <Skill>(); UnitState = new UnitStateNormal(this); }
/// <summary> /// Method called after object instantiation to initialize fields etc. /// </summary> public virtual void Initialize() { grid = GameObject.Find("CellGrid").GetComponent <CellGrid>(); GameObject.Find("SpawnUnitSFX").GetComponent <AudioSource>().Play(); Buffs = new List <Buff>(); UnitState = new UnitStateNormal(this); TotalHitPoints = HitPoints; TotalMovementPoints = MovementPoints; TotalActionPoints = ActionPoints; //Dictionary<string, int> targets = new Dictionary<string, int>(); //targets.Add("Infantry", 55); //targets.Add("MechScript", 45); //targets.Add("Recon", 12); //targets.Add("Tank", 5); //targets.Add("MdTank", 1); //targets.Add("Artillery", 15); //targets.Add("Rocket", 25); //targets.Add("APC", 14); //targets.Add("AntiAir", 5); //targets.Add("Missile", 25); //targets.Add("Copter", 7); //damageValues.Add("Infantry", targets); //targets = new Dictionary<string, int>(); //targets.Add("Infantry", 65); //targets.Add("MechScript", 55); //targets.Add("Recon", 85); //targets.Add("Tank", 55); //targets.Add("MdTank", 15); //targets.Add("Artillery", 70); //targets.Add("Rocket", 85); //targets.Add("APC", 75); //targets.Add("AntiAir",65); //targets.Add("Missile", 85); //targets.Add("Copter", 9); //damageValues.Add("MechScript", targets); //targets = new Dictionary<string, int>(); //targets.Add("Infantry", 90); //targets.Add("MechScript", 85); //targets.Add("Recon", 80); //targets.Add("Tank", 70); //targets.Add("MdTank", 45); //targets.Add("Artillery", 75); //targets.Add("Rocket", 80); //targets.Add("APC", 70); //targets.Add("AntiAir", 75); //targets.Add("Missile", 80); //damageValues.Add("Artillery", targets); //targets = new Dictionary<string, int>(); //targets.Add("Infantry", 75); //targets.Add("MechScript", 70); //targets.Add("Recon", 85); //targets.Add("Tank", 55); //targets.Add("MdTank", 15); //targets.Add("Artillery", 70); //targets.Add("Rocket", 85); //targets.Add("APC", 75); //targets.Add("AntiAir", 65); //targets.Add("Missile", 85); //targets.Add("Copter", 10); //damageValues.Add("Tank", targets); //targets = new Dictionary<string, int>(); //targets.Add("Infantry", 105); //targets.Add("MechScript", 95); //targets.Add("Recon", 105); //targets.Add("Tank", 85); //targets.Add("MdTank", 55); //targets.Add("Artillery", 105); //targets.Add("Rocket", 105); //targets.Add("APC", 105); //targets.Add("AntiAir", 105); //targets.Add("Missile", 105); //targets.Add("Copter", 12); //damageValues.Add("MdTank", targets); //targets = new Dictionary<string, int>(); //targets.Add("Infantry", 70); //targets.Add("MechScript", 65); //targets.Add("Recon", 35); //targets.Add("Tank", 6); //targets.Add("MdTank", 1); //targets.Add("Artillery", 45); //targets.Add("Rocket", 55); //targets.Add("APC", 45); //targets.Add("AntiAir", 4); //targets.Add("Missile", 28); //targets.Add("Copter", 12); //damageValues.Add("Recon", targets); //targets = new Dictionary<string, int>(); //targets.Add("Infantry", 95); //targets.Add("MechScript", 90); //targets.Add("Recon", 90); //targets.Add("Tank", 80); //targets.Add("MdTank", 55); //targets.Add("Artillery", 80); //targets.Add("Rocket", 85); //targets.Add("APC", 80); //targets.Add("AntiAir", 85); //targets.Add("Missile", 90); //damageValues.Add("Rocket", targets); //targets = new Dictionary<string, int>(); //targets.Add("Infantry", 105); //targets.Add("MechScript", 105); //targets.Add("Recon", 60); //targets.Add("Tank", 25); //targets.Add("MdTank", 10); //targets.Add("Artillery", 50); //targets.Add("Rocket", 55); //targets.Add("APC", 50); //targets.Add("AntiAir", 45); //targets.Add("Missile", 55); //targets.Add("Fighter", 65); //targets.Add("Bomber", 75); //targets.Add("Copter", 105); //damageValues.Add("AntiAir", targets); //targets = new Dictionary<string, int>(); //targets.Add("Infantry", 0); //targets.Add("MechScript", 0); //targets.Add("Recon", 0); //targets.Add("Tank", 0); //targets.Add("MdTank", 0); //targets.Add("Artillery", 0); //targets.Add("Rocket", 0); //targets.Add("APC", 0); //targets.Add("AntiAir", 0); //targets.Add("Missile", 0); //targets.Add("Fighter", 100); //targets.Add("Bomber", 100); //targets.Add("Copter", 115); //damageValues.Add("Missile", targets); //targets = new Dictionary<string, int>(); //targets.Add("Infantry", 0); //targets.Add("MechScript", 0); //targets.Add("Recon", 0); //targets.Add("Tank", 0); //targets.Add("MdTank", 0); //targets.Add("Artillery", 0); //targets.Add("Rocket", 0); //targets.Add("APC", 0); //targets.Add("AntiAir", 0); //targets.Add("Missile", 0); //targets.Add("Fighter", 55); //targets.Add("Bomber", 75); //targets.Add("Copter", 105); //damageValues.Add("Fighter", targets); //targets = new Dictionary<string, int>(); //targets.Add("Infantry", 110); //targets.Add("MechScript", 110); //targets.Add("Recon", 105); //targets.Add("Tank", 105); //targets.Add("MdTank", 95); //targets.Add("Artillery", 105); //targets.Add("Rocket", 105); //targets.Add("APC", 105); //targets.Add("AntiAir", 95); //targets.Add("Missile", 105); //targets.Add("Fighter", 0); //targets.Add("Bomber", 0); //targets.Add("Copter", 0); //damageValues.Add("Bomber", targets); //targets = new Dictionary<string, int>(); //targets.Add("Infantry", 75); //targets.Add("MechScript", 75); //targets.Add("Recon", 55); //targets.Add("Tank", 55); //targets.Add("MdTank", 25); //targets.Add("Artillery", 65); //targets.Add("Rocket", 65); //targets.Add("APC", 60); //targets.Add("AntiAir", 25); //targets.Add("Missile", 65); //targets.Add("Fighter", 0); //targets.Add("Bomber", 0); //targets.Add("Copter", 0); //damageValues.Add("Copter", targets); if (this is Building) { HitPoints = 20; TotalHitPoints = 20; } else { HitPoints = 100; TotalHitPoints = 100; } UpdateColor(); GetComponent <Renderer>().material.color = LeadingColor; myColor = GetComponent <Renderer>().material.color; unitIndex = UnitsIndexer.index++; if (this.transform.position.z == 0.0f) { this.transform.position -= new Vector3(0.0f, 0.0f, 1.0f); } //transform.position = new Vector3(transform.position.x, transform.position.y, -1.0f); }