///////////////////////////////////////////// /// Functions ///////////////////////////////////////////// #region setup //initialize variables public virtual void Setup() { Speed = baseSpeed; AttackMod = baseAttackMod; Armor = baseArmor; Selected = false; selectedParticle = transform.Find(SELECT_PARTICLE_OBJ).gameObject; lineRend = GetComponent <LineRenderer>(); ClearLine(); moveButton = transform.Find(PRIVATE_UI_CANVAS).Find(MOVE_BUTTON_OBJ).GetComponent <Button>(); undoButton = transform.Find(PRIVATE_UI_CANVAS).Find(UNDO_BUTTON_OBJ).GetComponent <Button>(); moveCanvas = transform.Find(PRIVATE_UI_CANVAS); selectableIcon = transform.Find(PRIVATE_UI_CANVAS).Find(SELECTABLE_ICON_OBJ).GetComponent <Image>(); selectableIcon.sprite = Services.Cursor.CurrentCursor; rb = GetComponent <Rigidbody>(); GridLoc = new TwoDLoc(0, 0); //default initialization combatHand = MakeCombatHand(); uICanvas = GameObject.Find(CARD_UI_CANVAS).transform; defenderCards = uICanvas.GetComponent <DefenderUIBehavior>(); noFightButton = transform.Find(PRIVATE_UI_CANVAS).Find(NO_FIGHT_BUTTON).GetComponent <Button>(); DefeatedSoFar = START_DEFEATED; xpParticle = transform.Find(XP_PARTICLE_OBJ).GetComponent <ParticleSystem>(); powerupReadyParticle = transform.Find(POWER_UP_PARTICLE_OBJ).gameObject; pose = transform.Find(MODEL_OBJ).Find(MINI_OBJ).GetComponent <Animation>(); unmovingMini = transform.Find(UNMOVING_OBJ).gameObject; }
///////////////////////////////////////////// /// Functions ///////////////////////////////////////////// //constructor public PutDownCardTask(RectTransform cardTransform) { this.cardTransform = cardTransform; uICanvas = GameObject.Find(UI_CANVAS).GetComponent <DefenderUIBehavior>(); }