Ejemplo n.º 1
0
    //public void DebugManAddSpeed(string str)
    // {
    //     try
    //     {
    //         float temp = float.Parse(str);
    //         if (temp > 0)
    //{
    //	Grid.getGrid.ManSpeed = temp;
    //	setManMoveable(new NormalManMove(this.gameObject, null));
    //}
    //    }
    //    catch
    //    {
    //        Debug.LogError("輸入錯誤 " + str);
    //    }
    //}

    public override void IPauseUpdate()
    {
        if (Grid.getGrid.GO_lastBox != null)
        {
            return;
        }
        if (ManMove.tempitw == null)
        {
            if (ManMove.IsEnd)            //道具結束的標記,結束後回歸一般模式
            {
                setManMoveable(new NormalManMove(this.gameObject, ManMove));
            }
            ManMove.Move();
            AddScore();            //加分
        }
        else
        {
            //吃到道具做動作
            if (itemAction != null)
            {
                itemAction.ActionStart();                                                          //人物吃到道具的道具反應
                setManMoveable(CreatManMoveFac.CreatManMove(this.gameObject, ManMove, itemGroup)); //設定吃到道具之後的效果
                if (itemGroup.Type == Group.groupType.bag)
                {
                    AddBagBox();
                }
                if (itemGroup.Type == Group.groupType.coin)
                {
                    AddCoinBox();
                }
                itemAction = null;
                return;
            }


            //移動方向有BOX擋住,將人物退回原位
            if (Grid.getGrid.grids[(int)ManMove.New_Pos.x][(int)ManMove.New_Pos.y] != null)
            {
                if (Grid.getGrid.grids[(int)ManMove.New_Pos.x][(int)ManMove.New_Pos.y].parent.tag == "itemBox")
                {
                    return;
                }
                ManMove.tempitw.isRunning = false;
                Destroy(ManMove.tempitw);
                ManMove.Move();
            }
        }
    }
Ejemplo n.º 2
0
 public void setManItemAct(Actionabl actionabl)
 {
     m_manItemAct = actionabl;
 }
Ejemplo n.º 3
0
 public void setItemAction(Actionabl actionabl)
 {
     itemAction = actionabl;
 }
Ejemplo n.º 4
0
 public void setActionType(Actionabl actionabl)
 {
     m_itemAct = actionabl;
 }