public void OnSelectShip(ShipBase ship) { ClearTargetData(); _selectedObject = ship.transform; if (_currentSelectMarker != null) { //remove current marker GameObject.Destroy(_currentSelectMarker.gameObject); } GameObject o = GameObject.Instantiate(Resources.Load("SelectedShipMarkerHostile")) as GameObject; _currentSelectMarker = o.GetComponent <SelectedObjMarker>(); o.transform.parent = transform; o.transform.localScale = new Vector3(1, 1, 1); _currentSelectMarker.Initialize(100f, ship.name); ShipReference shipRef = ship.ShipModel.GetComponent <ShipReference>(); TargetShieldValue.text = "SHLD " + (int)ship.Shield.Amount; TargetHullValue.text = "HULL " + (int)ship.HullAmount; GameObject hologram = GameObject.Instantiate(Resources.Load(ship.ShipModelID + "Hologram")) as GameObject; TargetHologram = hologram; hologram.transform.parent = HologramHolder3D; hologram.transform.localPosition = Vector3.zero; hologram.transform.localEulerAngles = Vector3.zero; float scale = shipRef.HologramScale; hologram.transform.localScale = new Vector3(scale, scale, scale); TargetDescLabel.text = shipRef.Name + " - " + "New Dawn"; TargetRepLabel.color = new Color(1, 0.3f, 0.3f); TargetRepLabel.text = "HOSTILE"; }
public void OnSelectPlanetOrStation(Transform obj, string description) { _selectedObject = obj; if (_currentSelectMarker != null) { //remove current marker GameObject.Destroy(_currentSelectMarker.gameObject); } GameObject o = GameObject.Instantiate(Resources.Load("SelectedObjectMarkerNeutral")) as GameObject; _currentSelectMarker = o.GetComponent <SelectedObjMarker>(); o.transform.parent = transform; o.transform.localScale = new Vector3(1, 1, 1); _currentSelectMarker.Initialize(100f, description); }