Ejemplo n.º 1
0
 public void NextAssemble(ParControler argPart)
 {
     if (argPart == null)
     {
         ChangeState(EState.FillShip);
     }
     else
     {
         ChangeState(EState.AssembleShip);
         PartToAssemble(argPart);
     }
 }
Ejemplo n.º 2
0
        public void PlayerTriggerStay2D(GameObject gameobj, Collider2D collision)
        {
            var pPlayerCntl = gameobj.GetComponent <Player.Controler>();
            var pShipCntl   = collision.gameObject.GetComponent <Ship.Controler>();

            if (pShipCntl != null)
            {
                switch (State)
                {
                case EState.LoadPartShip:
                    if (pPlayerCntl.IsLoadObj /*&& pShipCntl.IsInShip(gameobj)*/)
                    {
                        mShipPartAssemble.InGravity = true;
                        mShipPartAssemble           = null;

                        var pObj = pPlayerCntl.GetLoadObj();

                        pPlayerCntl.UnLoadObj();
                        pShipCntl.PutObjInZoneShip(pObj);
                        ChangeState(EState.WaitPartShip);
                    }
                    break;

                case EState.LoadFuel:
                    if (pPlayerCntl.IsLoadObj /*&& pShipCntl.IsInShip(gameobj)*/)
                    {
                        var pFuelCntl = pPlayerCntl.GetLoadObj().GetComponent <FuelControler>();

                        if (pFuelCntl != null)
                        {
                            pFuelCntl.InGravity = true;
                            pPlayerCntl.UnLoadObj();
                            pShipCntl.PutObjInZoneShip(pFuelCntl.gameObject);
                            ChangeState(EState.WaitFuel);
                        }
                    }
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        private void ChangeState()
        {
            switch (State)
            {
            case EState.AssembleShip:
                mShipControler.PrepareAssembleShip();
                mShipPartAssemble = mShipControler.ParShip3.PartNext;
                break;

            case EState.FillShip:
                mShipPartAssemble = null;
                mShipControler.PrepareForFill();
                ThrowPrefabObjFromTop(FuelPrefab);
                ChangeState(EState.FillFuel);
                break;

            case EState.ShipTakeOf:
                mPlayerControler.gameObject.SetActive(false);
                mShipControler.TakeOff();
                break;
            }
        }
Ejemplo n.º 4
0
 public void PartToAssemble(ParControler argPart)
 {
     mShipPartAssemble = argPart;
 }