bool triggerEntered = false; //For tower placement // Start is called before the first frame update void Start() { targetNPC = new List <Health>(); myCircleCollider = GetComponentInChildren <CircleCollider2D>(); myCircleCollider.radius = towerAttackRange; myBoxCollider = GetComponent <BoxCollider2D>(); actualTime = 0; mySpriteRenderer = GetComponentInChildren <SpriteRenderer>(); myAnimator = GetComponent <Animator>(); myAnimator.StopPlayback(); myRigidbody = GetComponent <Rigidbody2D>(); selectable = GetComponent <Selectable>(); mouseController = FindObjectOfType <TargetMouseSelected>(); teamData = GetComponent <TeamData>(); health = GetComponent <Health>(); }
// Start is called before the first frame update void Start() { mouseController = FindObjectOfType <TargetMouseSelected>(); myRigidbody = GetComponent <Rigidbody2D>(); myAnimator = GetComponent <Animator>(); selectable = GetComponent <Selectable>(); teamData = GetComponent <TeamData>(); unitParent = transform.parent.parent.GetChild(2).gameObject; health = GetComponent <Health>(); sellProfit = buyCost / 2; currentUnits = new Health[3]; if (teamData.GetTeamBelonging() == Team.TeamRed) { spawnTimeInSeconds -= GlobalUpgrades.instance.GetUpgradeValueOnUpgradesIndex(1); // Index 1 is spawnTimeUpgrade unitManager = FindObjectOfType <UnitManagerPanel>(); } if (dwellingUpgrader == null) { dwellingUpgrader = GetComponentInChildren <DwellingUpgrader>(); } }
[SerializeField] int waitForClicks = 0; // Set to 1 if you want to wait one click before selecting, i.e so that using mouse to place tower dont also activate target slection. void Start() { targetMouseSelected = FindObjectOfType <TargetMouseSelected>(); }