private void SetShipIdText(GameObject model) { TextMesh ShipIdText = model.transform.Find("RotationHelper/RotationHelper2/ShipAllParts/ShipIdText").GetComponent <TextMesh>(); ShipIdText.text = ShipId.ToString(); ShipIdText.color = (Owner.PlayerNo == Players.PlayerNo.Player1) ? Color.green: Color.red; }
protected void SetId() { SetTagOfChildrenRecursive(Model.transform, "ShipId:" + ShipId.ToString()); SetIdMarker(); SetSpotlightMask(); }
public void InitializeShipModel() { CreateModel(StartingPosition); InitializeSectors(); InitializeShipBaseArc(); SetTagOfChildrenRecursive(Model.transform, "ShipId:" + ShipId.ToString()); SetShipInsertImage(); SetShipSkin(); }
public virtual void InitializeShip() { InitializePilotForSquadBuilder(); Shields = MaxShields; PrimaryWeapon = new PrimaryWeaponClass(this); Damage = new AssignedDamageCards(this); CreateModel(StartingPosition); InitializeShipBaseArc(); SetTagOfChildrenRecursive(Model.transform, "ShipId:" + ShipId.ToString()); }
private void GenerateModel(Vector3 position, Quaternion rotation) { GameObject prefab = Resources.Load <GameObject>("Prefabs/Remotes/" + RemoteInfo.Name); Model = MonoBehaviour.Instantiate(prefab, position, rotation, BoardTools.Board.GetBoard()); ShipAllParts = Model.transform.Find("RotationHelper/RotationHelper2/ShipAllParts").transform; SetTagOfChildrenRecursive(Model.transform, "ShipId:" + ShipId.ToString()); SetRaycastTarget(true); SetSpotlightMask(); SetShipIdText(Model); // InitializeShipBase(); }
private void SetIdMarker() { string[] goNames = { "Front", "Rear" }; string idColor = (Owner.PlayerNo == Players.PlayerNo.Player1) ? "ID_White" : "ID_Black"; foreach (string goName in goNames) { TextMesh ShipIdText = ShipAllParts.Find("ShipBase/ShipPeg/XWingNumberMarker" + goName + "/" + idColor).GetComponent <TextMesh>(); ShipIdText.text = ShipId.ToString(); if (Owner.PlayerNo == Players.PlayerNo.Player2) { ShipAllParts.Find("ShipBase/ShipPeg/XWingNumberMarker" + goName).transform.localEulerAngles += new Vector3(0, 180, 0); } } }
public GameObject CreateShipModel(Vector3 position) { Vector3 facing = (Owner.PlayerNo == Players.PlayerNo.Player1) ? ShipFactory.ROTATION_FORWARD : ShipFactory.ROTATION_BACKWARD; position = new Vector3(0, 0, (Owner.PlayerNo == Players.PlayerNo.Player1) ? -4 : 4); GameObject newShip = MonoBehaviour.Instantiate(Game.PrefabsList.ShipModel, position + new Vector3(0, 0.03f, 0), Quaternion.Euler(facing), Board.BoardManager.GetBoard()); newShip.transform.Find("RotationHelper/RotationHelper2/ShipAllParts/ShipModels/" + Type).gameObject.SetActive(true); ShipId = ShipFactory.lastId; ShipFactory.lastId = ShipFactory.lastId + 1; SetTagOfChildrenRecursive(newShip.transform, "ShipId:" + ShipId.ToString()); SetShipIdText(newShip); return(newShip); }