// Use this for initialization public virtual void Awake() { sndsource = GetComponent <AudioSource>(); bonus = 0; //adjacency = 1; doresistcalc = true; dieAfterMove = false; damagesources = new List <Vector3>(); damageresistance = 0; unitCanvas = GetComponentInChildren <UnitCanvas>(); animating = false; Morale = MaxMorale; unitCanvas.SetMaxMP(MaxMorale); unitCanvas.SetCurrentMP(MaxMorale); actions = new List <Action>(); movesLeft = movesPerTurn; currentVect = Vector3.zero; rb = GetComponent <Rigidbody2D>(); steps = new List <Vector3Int>(); //position = Vector3Int.RoundToInt(transform.position - offset); gridController = transform.parent.gameObject.GetComponent <TileGridController>(); //gridController.blockPosition() actions.Add(new Action("Move", MoveDistance, ActType.Movement, 0, -1, "", "", Color.white)); actions.Add(new Action("Blow vuvuzela", 6, ActType.Cone, 6, 6, "EnemyUnit", "DOOT!", Color.white, 0, 4)); actions.Add(new Action("Finger guns", 9, ActType.Targetted, 6, 0, "Unit", "Finger guns", Color.white, 0, 1)); actions.Add(new Action("Glitterbomb", 6, ActType.Grenade, 10, 10, "", "Glitterbomb", Color.white, 0, 6)); //actions.Add(new Action("Strike a pose", 0, ActType.Grenade, 10, 20)); actions.Add(new Action("Bear hug", MoveDistance, ActType.Melee, 6, -1, "", "Bear hug", Color.cyan, 0, 0)); }
private void Awake() { if (Instance == null) { Instance = this; } if (Instance != this) { Destroy(gameObject); } }
void Awake() { gc = FindObjectOfType <GameController>(); sr = GetComponent <SpriteRenderer>(); sl = FindObjectOfType <StatsLoader>(); hb = GetComponentInChildren <Healthbar>(); uCanvas = GetComponentInChildren <UnitCanvas>(); path = GetComponent <Pathfinding>(); // range & tiles they can move is multiplyed by the size of a cell so they can move properly range *= gc.cellSize; moveSpeed *= gc.cellSize; attackDamage = maxAttackDamage; magicDamage = maxMagicDamage; armor = maxArmor; resist = maxResist; speed = maxSpeed; mana = 0; tempAD = 0; tempMD = 0; tempAR = 0; tempMR = 0; tempSP = 0; critChance = 0; blockChance = 0; bleedChance = 0; reducedDamage = 0; armorPen = 0; mrPen = 0; manaGrowth = 0; moral = 0; lifesteal = 0; LoadData(); }