コード例 #1
0
ファイル: MovementComponent.cs プロジェクト: c2001324/Leo
 public MovingData(List <HexCell> movingPath, HexCell destination, Entity entity, CPropertyComponent propertyComponent)
 {
     m_PropertyComponent = propertyComponent;
     m_Entity            = entity;
     m_TargetCellIndex   = -1;
     m_MovingPath        = new List <HexCell>(movingPath);
 }
コード例 #2
0
 protected override void OnInitializeComplete()
 {
     base.OnInitializeComplete();
     m_PropertyComponent     = entity.GetCComponent <CPropertyComponent>();
     m_AnimatorComponent     = entity.GetCComponent <CAnimatorComponent>();
     m_CreateDamageComponent = entity.GetCComponent <CCreateDamageComponent>();
     isAttacking             = false;
 }
コード例 #3
0
 void UpdateHp(CPropertyComponent propertyComponent)
 {
     if (propertyComponent != null)
     {
         m_Hp.value    = propertyComponent.hp / propertyComponent.hpMax;
         m_HpText.text = Untility.Tool.FloatToString(propertyComponent.hp);
     }
 }
コード例 #4
0
    void UpdateMovePoint(CPropertyComponent propertyComponent)
    {
        int movePoint    = Untility.Tool.GetIntByMin(propertyComponent.movePoint);
        int movePointMax = Untility.Tool.GetIntByMin(propertyComponent.movePointMax);

        m_MovePointText.text = movePoint + " / " + movePointMax;
        m_MovePoint.value    = (float)movePoint / (float)movePointMax;
    }
コード例 #5
0
 protected override void OnStopControll(IControllerAction controllerAction)
 {
     InputManager.instance.RemoveController();
     controllerAction.HideMoveAndAttackRange();
     GameEvent.HexRoomEvent.onLeftClickCell.RemoveListener(OnLeftClickCell);
     GameEvent.HexRoomEvent.onRightClickCell.RemoveListener(OnRightClickCell);
     controllerAction.UnregisterActionEvent(OnActionComplete);
     m_PropertyComponent = null;
 }
コード例 #6
0
 void OnTurnStart(CControllerComponent t)
 {
     m_PropertyComponent = t.entity.GetCComponent <CPropertyComponent>();
     m_PropertyComponent.onMovePointChanged.AddListener(OnMovePointChanged);
     m_PropertyComponent.onHpChanged.AddListener(UpdateHp);
     UpdateHp(m_PropertyComponent);
     UpdateMovePoint(m_PropertyComponent);
     UpdateEndTurnButtonState();
 }
コード例 #7
0
 void OnTurnComplete(CControllerComponent t)
 {
     UpdateEndTurnButtonState();
     if (m_PropertyComponent != null)
     {
         m_PropertyComponent.onMovePointChanged.RemoveListener(OnMovePointChanged);
         m_PropertyComponent.onHpChanged.RemoveListener(UpdateHp);
         m_PropertyComponent = null;
     }
 }
コード例 #8
0
    protected override void OnBeginControll(IControllerAction controllerAction)
    {
        InputManager.instance.SetInputController(this);
        controllerAction.ShowMoveAndAttackRange();
        GameEvent.HexRoomEvent.onLeftClickCell.AddListener(OnLeftClickCell);
        GameEvent.HexRoomEvent.onRightClickCell.AddListener(OnRightClickCell);

        controllerAction.RegisterActionEvent(OnActionComplete);
        m_PropertyComponent    = controllerAction.GetEntity().GetCComponent <CPropertyComponent>();
        m_NextStepAttackEntity = null;
    }
コード例 #9
0
 protected override void OnInitializeComplete()
 {
     base.OnInitializeComplete();
     turnState           = State.Complete;
     teamComponent       = entity.GetCComponent <CTeamComponent>();
     m_Movement          = entity.GetComponent <MovementComponent>();
     m_PropertyComponent = entity.GetCComponent <CPropertyComponent>();
     m_AttackComponent   = entity.GetCComponent <CAttackComponent>();
     if (m_Movement != null)
     {
         m_Movement.onMoveComplete.AddListener(OnMoveComplete);
     }
     if (m_AttackComponent != null)
     {
         m_AttackComponent.onAttackComplete.AddListener(OnAttackComplete);
     }
 }
コード例 #10
0
ファイル: MovementComponent.cs プロジェクト: c2001324/Leo
 protected override void OnInitializeComplete()
 {
     base.OnInitializeComplete();
     m_AnimatorComponent = entity.GetCComponent <CAnimatorComponent>();
     m_PropertyComponent = entity.GetCComponent <CPropertyComponent>();
 }
コード例 #11
0
 void OnMovePointChanged(CPropertyComponent propertyComponent, float oldValue, float newValue)
 {
     UpdateMovePoint(propertyComponent);
 }