// Start is called before the first frame update void Start() { unitnumber = this.GetComponentInParent <UnitProperty>().unitnumber; animautoclick = this.GetComponent <Animator>(); unitlevel = PlayerSettings.getMap1UnitLevel(unitnumber); autospeed = 1f / unitnumber; tempspeed = autospeed; img = this.GetComponent <Image>(); unitsPower = this.GetComponentInParent <UnitsPower>(); UnitColorUpdate(); }
// Start is called before the first frame update void Start() { text = this.GetComponent <Text>(); unitsPower = this.GetComponentInParent <UnitsPower>(); unitnumber = this.GetComponentInParent <UnitProperty>().unitnumber; if (unitnumber != 0) { unitlevel = PlayerSettings.getMap1UnitLevel(unitnumber); } else { unitlevel = PlayerSettings.getMap1UnitLevel(unitnumber) + 1; } unitlevelfloat = unitlevel; LevelUpUnit(); }