void Start() { //create UnitCommander unitCommander = (UnitCommanderRedClan)Instantiate(Resources.Load(("Prefabs/UnitCommanderRedClan"), typeof(UnitCommanderRedClan))); unitCommander.transform.position = transform.parent.position; unitCommander.transform.parent = transform.parent; unitCommander.SetClan(clan); //create BuildingCommander buildingCommander = (BuildingCommanderRedClan)Instantiate(Resources.Load(("Prefabs/BuildingCommanderRedClan"), typeof(BuildingCommanderRedClan))); buildingCommander.transform.position = transform.parent.position; buildingCommander.transform.parent = transform.parent; buildingCommander.SetClan(clan); }