Пример #1
0
        public void CreateMainShip(PSShip psShip, GameObject shipLayer, SimpleManager.GenericDelegate buttonDel, ShipManager.ShipCreationDelegate shipDel)
        {
            if (psShip == null || !Object.op_Inequality((Object)shipLayer, (Object)null))
            {
                return;
            }
            ShipMainEntity mainShipObject = this.CreateMainShipObject(psShip, shipLayer);

            this.SharedShipCreation((ShipEntity)mainShipObject, psShip, buttonDel);
            if (shipDel == null)
            {
                return;
            }
            shipDel((ShipEntity)mainShipObject);
        }
Пример #2
0
        public ShipMainEntity CreateMainShipObject(PSShip psShip, GameObject shipLayer)
        {
            GameObject gameObject = Object.Instantiate(Resources.Load("ShipMainPrefab"), shipLayer.get_transform()) as GameObject;

            ((Object)gameObject).set_name(psShip.ShipName + "-" + (object)psShip.ShipId);
            gameObject.get_transform().set_localScale(Vector3.get_one());
            gameObject.get_transform().set_position(new Vector3(99999f, 0.0f, 0.0f));
            ShipMainEntity component = (ShipMainEntity)gameObject.GetComponent <ShipMainEntity>();

            component.shipEntity         = (ShipEntity)component;
            component.PSShip             = psShip;
            component.gridMap            = new GridMap(new Grid[psShip.columns, psShip.rows]);
            component.PSShip.ConvertedHp = psShip.Hp * 100.0;
            component.PSShip.InitialHP   = component.PSShip.ConvertedHp;
            return(component);
        }