Example #1
0
 // Update is called once per frame
 public void Update()
 {
     if (m_heroUnitType.GetStatusType().Equals(CommonTypes.StatusType.STATUS_TYPE_PLAY))
     {
         HeroWayPointMove();
     }
 }
Example #2
0
    private void UnitToWayPointMove()
    {
        if (m_unitType.GetStatusType().Equals(CommonTypes.StatusType.STATUS_TYPE_PLAY))
        {
            if (m_unitType.GetCreatureType().Equals(CommonTypes.MinionTeam.MINION_TEAM_USER))
            {
                int curWayPointIndex = m_unitObject.GetComponent <Creature_p>().GetUserCurWayPointIndex();

                if (curWayPointIndex == -1)
                {
                    curWayPointIndex++;
                    m_unitObject.GetComponent <Creature_p>().SetUserWayPointIndex(curWayPointIndex);
                }
                m_wayPoint = m_objectList.GetMapGameObject().GetWayPoint(curWayPointIndex);
                if (m_wayPoint == null)
                {
                    return;
                }
            }
            else if (m_unitType.GetCreatureType().Equals(CommonTypes.MinionTeam.MINION_TEAM_ENEMY))
            {
                int Enemy_curWayPointIndex = m_unitObject.GetComponent <Creature_p>().GetEnemyCurWayPointIndex();

                if (Enemy_curWayPointIndex == 4)
                {
                    Enemy_curWayPointIndex--;
                    m_unitObject.GetComponent <Creature_p>().SetEnemyWayPointIndex(Enemy_curWayPointIndex);
                }
                m_wayPoint = m_objectList.GetMapGameObject().GetWayPoint(Enemy_curWayPointIndex);
                if (m_wayPoint == null)
                {
                    return;
                }
            }
            Vector3 targetPos = new Vector3(m_wayPoint.transform.position.x, m_wayPoint.transform.position.y, HoldZ);
            Moving(targetPos);
        }
    }
Example #3
0
 // Update is called once per frame
 public void Update()
 {
     if (m_scvType.GetStatusType().Equals(CommonTypes.StatusType.STATUS_TYPE_SCV_NONE) ||
         m_scvType.GetStatusType().Equals(CommonTypes.StatusType.STATUS_TYPE_SCV_PLAY))
     {
         ScvMineralMove();
     }
     else if (m_scvType.GetStatusType().Equals(CommonTypes.StatusType.STATUS_TYPE_SCV_STOP))
     {
         ScvWork();
     }
     else if (m_scvType.GetStatusType().Equals(CommonTypes.StatusType.STATUS_TYPE_SCV_BACK))
     {
         ScvStartPosition();
     }
 }