/// <summary> /// Instancing new Object /// </summary> /// <param name="root"></param> /// <param name="build"></param> /// <param name="hType"></param> public Ship(string root, Building build, H hType) { _root = root; _building = build; _buildKey = build.MyId; _hType = hType; _shipGo = ShipGO.Create(_root, new Vector3(), _building, this, _hType); }
internal void ReCreateShip() { _building = Brain.GetBuildingFromKey(BuildKey); _shipGo = ShipGO.Create(_root, new Vector3(), _building, this, _hType, MyId); MoveThruPoints1.PassGameObject(_shipGo.gameObject); MoveThruPoints1.WalkRoutineLoad(MoveThruPoints1.CurrTheRoute, MoveThruPoints1.GoingTo, MoveThruPoints1.CurrentRoutePoint, MoveThruPoints1.Inverse, MoveThruPoints1.WhichRoute); }
static public ShipGO Create(string root, Vector3 origen, Building building, Ship ship, H hType = H.None, string myID = "") { WAKEUP = true; ShipGO obj = null; obj = (ShipGO)Resources.Load(root, typeof(ShipGO)); obj = (ShipGO)Instantiate(obj, origen, Quaternion.identity); obj.HType = hType; obj.Building1 = building; obj.Ship1 = ship; obj.transform.SetParent(building.transform); obj.MyId = myID; return(obj); }