Example #1
0
    private void OnTouchShipGun(BattleSoloSceneManager.SceneStatus p_sceneStatus, ShipGun p_shipGun)
    {
        switch (p_shipGun.owner)
        {
        case Ship.Owner.PLAYER:
            switch (p_sceneStatus)
            {
            case BattleSoloSceneManager.SceneStatus.IDLE:
            case BattleSoloSceneManager.SceneStatus.PLAYER_SHIP_GUN_SELECTED:
                if (onSelectPlayerShipGun != null)
                {
                    onSelectPlayerShipGun(p_shipGun);
                }
                break;
            }
            break;

        case Ship.Owner.FOE:
            switch (p_sceneStatus)
            {
            case BattleSoloSceneManager.SceneStatus.PLAYER_SHIP_GUN_SELECTED:
                if (onSetPlayerBattleAction != null)
                {
                    onSetPlayerBattleAction(PlayerAction.ATTACK, p_shipGun);
                }
                break;
            }
            break;
        }
    }
Example #2
0
    public void RemovePlayerBattleAction(ShipGun p_shipGun)
    {
        BattleTurnInfo?__battleActionToRemove = null;

        _battleActions.ForEach(__battleAction => { if (__battleAction.Value.id == p_shipGun.actionId)
                                                   {
                                                       __battleActionToRemove = __battleAction;
                                                   }
                               });

        if (__battleActionToRemove != null)
        {
            p_shipGun.actionId        = 0;
            p_shipGun.selectionStatus = ShipGun.SelectionStatus.IDLE;

            _battleActions.Remove(__battleActionToRemove);
        }

        Debug.Log("Battle action removed");

        if (onPlayerBattleActionRemoved != null)
        {
            onPlayerBattleActionRemoved();
        }
    }
Example #3
0
    private void SetPlayerTargetDisplay(ShipGun p_playerShipGun, ShipGun p_foeShipGun)
    {
        Debug.Log(p_foeShipGun.shipGunType);

        p_playerShipGun.shipGunTarget.removeTargetDisplay.SetActive(true);

        p_playerShipGun.shipGunTarget.targetDisplay.SetPosition(0, p_playerShipGun.shipGunTarget.transform.position);
        p_playerShipGun.shipGunTarget.targetDisplay.SetPosition(1, p_foeShipGun.shipGunTarget.transform.position);
    }
Example #4
0
    private void SetPlayerTargetDisplay(ShipGun p_playerShipGun, ShipGun p_foeShipGun)
    {
        Debug.Log(p_foeShipGun.shipGunType);

        p_playerShipGun.shipGunTarget.removeTargetDisplay.SetActive(true);

        p_playerShipGun.shipGunTarget.targetDisplay.SetPosition(0, p_playerShipGun.shipGunTarget.transform.position);
        p_playerShipGun.shipGunTarget.targetDisplay.SetPosition(1, p_foeShipGun.shipGunTarget.transform.position);
    }
    // [SerializeField]
    //  Canvas canvas;

    //   [SerializeField]
    //  Button Overloadbutton;



    // Use this for initialization
    void Awake()
    {
        shoot = FindObjectOfType <ShipGun>();
        //canvas.enabled = false;
        //  GetComponent<Button>().interactable = false;
        // GetComponent<Button>().gameObject.SetActive(false);
        GetComponent <Button>().interactable = false;
        // Overloadbutton = GetComponent<Button>();

        //  Overloadbutton.gameObject.SetActive(false);
    }
Example #6
0
    void HandleOnSetPlayerBattleAction(BattleSoloPlayerActionManager.PlayerAction p_playerAction, ShipGun p_foeShipGun)
    {
        if (playerShipManager.selectedShipGun.selectionStatus == ShipGun.SelectionStatus.IDLE)
        {
            BattleSoloBattleManager.BattleTurnInfo __battleTurnInfo = new BattleSoloBattleManager.BattleTurnInfo(battleManager.actionIdGiver, p_playerAction, new object[2]{
                playerShipManager.selectedShipGun,
                p_foeShipGun
            });

            battleManager.SetPlayerBattleAction(__battleTurnInfo, playerShipManager.GetTotalActionsBonus() + _startActionsAvaliable);
        }
    }
Example #7
0
    private void LoadCannons()
    {
        foreach (Transform loop_shipGun in ShipGuns)
        {
            ShipGun __shipGun = loop_shipGun.GetComponent <ShipGun>();

            __shipGun.Initialize(_idGiver, owner);

            _shipGuns.Add(_idGiver, __shipGun);

            _idGiver++;
        }
    }
Example #8
0
    public void SetSelectedShipGun(ShipGun p_shipGun)
    {
        if (_selectedShipGun == null)
        {
            _selectedShipGun = p_shipGun;
            p_shipGun.Highlight();
        }
        else
        {
            _selectedShipGun.DefaultLight();

            _selectedShipGun = p_shipGun;
            p_shipGun.Highlight();
        }
    }
    public void SetSelectedShipGun(ShipGun p_shipGun)
    {
        if (_selectedShipGun == null)
        {
            _selectedShipGun = p_shipGun;
            p_shipGun.Highlight();
        }
        else
        {
            _selectedShipGun.DefaultLight();

            _selectedShipGun = p_shipGun;
            p_shipGun.Highlight();
        }
    }
Example #10
0
    public void RemovePlayerBattleAction(ShipGun p_shipGun)
    {
        BattleTurnInfo? __battleActionToRemove = null;

        _battleActions.ForEach(__battleAction => { if (__battleAction.Value.id == p_shipGun.actionId) __battleActionToRemove = __battleAction; });

        if (__battleActionToRemove != null)
        {
            p_shipGun.actionId = 0;
            p_shipGun.selectionStatus = ShipGun.SelectionStatus.IDLE;

            _battleActions.Remove(__battleActionToRemove);
        }

        Debug.Log("Battle action removed");

        if(onPlayerBattleActionRemoved != null) onPlayerBattleActionRemoved();
    }
Example #11
0
    public void SetPlayerBattleAction(BattleTurnInfo p_battleTurnInfo, int p_totalActionsAllowded)
    {
        _battleActions.Add(p_battleTurnInfo);

        ShipGun __playerShipGun = p_battleTurnInfo.actionData[0] as ShipGun;

        __playerShipGun.actionId = _actionIdGiver;

        SetPlayerTargetDisplay(__playerShipGun, p_battleTurnInfo.actionData[1] as ShipGun);
        SetPlayerShipGunSelectionStatus(__playerShipGun, ShipGun.SelectionStatus.ON_QUEUE);

        _actionIdGiver++;
        if (onPlayerBattleActionSeted != null)
        {
            onPlayerBattleActionSeted();
        }
        if (p_totalActionsAllowded == _battleActions.Count && onPlayerBattleActionsFull != null)
        {
            onPlayerBattleActionsFull();
        }
    }
 private void OnTouchShipGun(BattleSoloSceneManager.SceneStatus p_sceneStatus, ShipGun p_shipGun)
 {
     switch(p_shipGun.owner)
     {
         case Ship.Owner.PLAYER:
             switch(p_sceneStatus)
             {
                 case BattleSoloSceneManager.SceneStatus.IDLE:
                 case BattleSoloSceneManager.SceneStatus.PLAYER_SHIP_GUN_SELECTED:
                     if(onSelectPlayerShipGun != null) onSelectPlayerShipGun(p_shipGun);
                 break;
             }
         break;
         case Ship.Owner.FOE:
             switch(p_sceneStatus)
             {
                 case BattleSoloSceneManager.SceneStatus.PLAYER_SHIP_GUN_SELECTED:
                     if(onSetPlayerBattleAction != null) onSetPlayerBattleAction(PlayerAction.ATTACK, p_shipGun);
                 break;
             }
         break;
     }
 }
Example #13
0
 private void SetPlayerShipGunSelectionStatus(ShipGun p_playerShipGun, ShipGun.SelectionStatus p_selectionStatus)
 {
     p_playerShipGun.selectionStatus = p_selectionStatus;
     p_playerShipGun.DefaultLight();
 }
Example #14
0
 //-----PLAYER ACTION-----
 void HandleOnSelectPlayerShipGun(ShipGun p_shipGun)
 {
     playerShipManager.SetSelectedShipGun(p_shipGun);
     sceneManager.sceneStatus = BattleSoloSceneManager.SceneStatus.PLAYER_SHIP_GUN_SELECTED;
     Debug.Log("Player gun selected.");
 }
Example #15
0
    void HandleOnSetPlayerBattleAction(BattleSoloPlayerActionManager.PlayerAction p_playerAction, ShipGun p_foeShipGun)
    {
        if (playerShipManager.selectedShipGun.selectionStatus == ShipGun.SelectionStatus.IDLE)
        {
            BattleSoloBattleManager.BattleTurnInfo __battleTurnInfo = new BattleSoloBattleManager.BattleTurnInfo(battleManager.actionIdGiver, p_playerAction, new object[2] {
                playerShipManager.selectedShipGun,
                p_foeShipGun
            });

            battleManager.SetPlayerBattleAction(__battleTurnInfo, playerShipManager.GetTotalActionsBonus() + _startActionsAvaliable);
        }
    }
 private void Awake()
 {
     shipMove = ship.GetComponent <ShipMove>();
     shipGun  = ship.GetComponent <ShipGun>();
 }
Example #17
0
 private void SetPlayerShipGunSelectionStatus(ShipGun p_playerShipGun, ShipGun.SelectionStatus p_selectionStatus)
 {
     p_playerShipGun.selectionStatus = p_selectionStatus;
     p_playerShipGun.DefaultLight();
 }
Example #18
0
 void HandleOnRemovePlayerBattleAction(ShipGun p_shipGun)
 {
     battleManager.RemovePlayerBattleAction(p_shipGun);
 }
Example #19
0
 protected override void Start()
 {
     base.Start();
     Gun = transform.GetRoot().GetComponentInChildren <ShipGun>();
 }
Example #20
0
 void HandleOnRemovePlayerBattleAction(ShipGun p_shipGun)
 {
     battleManager.RemovePlayerBattleAction(p_shipGun);
 }
Example #21
0
    //-----PLAYER ACTION-----

    void HandleOnSelectPlayerShipGun(ShipGun p_shipGun)
    {
        playerShipManager.SetSelectedShipGun(p_shipGun);
        sceneManager.sceneStatus = BattleSoloSceneManager.SceneStatus.PLAYER_SHIP_GUN_SELECTED;
        Debug.Log("Player gun selected.");
    }