private void UpdateReferences() { assembleLayout = GetComponentInParent <AssembleLayout>(); NPCinfo = GetComponent <NPCBase>(); attackSystem = GetComponent <AutoAttackSystem>(); center = assembleLayout ? assembleLayout.GetAssemblyPoint() : transform; }
private void UpdateRefference() { NPCinfo = GetComponent <NPCBase>(); moveable = GetComponent <Moveable>(); assembleLayout = GetComponentInParent <AssembleLayout>(); autoAttackSystem = GetComponent <AutoAttackSystem>(); aimBase = GetComponent <AimBase>(); }
public void Build(GameObject towerPrefab) { if (tower) { Destroy(tower.gameObject); } if (towerPrefab) { tower = Instantiate(towerPrefab, transform).GetComponent <TowerBase>(); AssembleLayout assemble = tower.GetComponentInChildren <AssembleLayout>(); if (assemble) { assemble.SetAssemblyPoint(defaultPoint.position); } GameManager.Instance.money -= tower.cost; } }
protected override void UpdateREF() { base.UpdateREF(); assembleLayout = GetComponent <AssembleLayout>(); }