Esempio n. 1
0
 public BattleMissionBase(EBattleCommandType cmdType, BattleField battleField)
 {
     m_battleField    = battleField;
     m_battleFieldObj = m_battleField.BattleFieldObj;
     m_balls          = m_battleField.Balls;
     m_cmdType        = cmdType;
     m_waitBalls      = m_battleField.WaitBalls;
     m_waitBallsType  = m_battleField.WaitBallsType;
 }
Esempio n. 2
0
        public bool Init(BattleField battleField)
        {
            m_battleField      = battleField;
            m_missionList      = new List <Queue <BattleMissionBase> >();
            m_usableMissionDic = new Dictionary <EBattleCommandType, Queue <BattleMissionBase> >();
            foreach (EBattleCommandType item in Enum.GetValues(typeof(EBattleCommandType)))
            {
                m_usableMissionDic.Add(item, new Queue <BattleMissionBase>());
            }

            m_battleFieldObj = m_battleField.BattleFieldObj;
            m_balls          = m_battleField.Balls;
            m_waitBalls      = m_battleField.WaitBalls;
            m_waitBallsType  = m_battleField.WaitBallsType;
            m_isIdle         = true;
            return(true);
        }
Esempio n. 3
0
        public bool Init()
        {
            m_balls       = new BattleBallInfor();
            m_battleField = GameObject.Find("BattleField");
            if (m_battleField == null)
            {
                Debug.LogError("Can't find Game Object BattleField~!");
                return(false);
            }

            m_ballReserve    = new Queue <ELevelBallType> [2];
            m_ballReserve[0] = new Queue <ELevelBallType>();
            m_ballReserve[1] = new Queue <ELevelBallType>();

            m_ballPoint    = new Vector2[4];
            m_ballPoint[0] = GameObject.Find("BallPointA").transform.position;
            m_ballPoint[1] = GameObject.Find("BallPointB").transform.position;
            m_ballPoint[2] = GameObject.Find("ExBallPointA").transform.position;
            m_ballPoint[3] = GameObject.Find("ExBallPointB").transform.position;

            m_waitBalls     = new GameObject[4];
            m_waitBallsType = new ELevelBallType[4];
            m_isExBall      = new bool[2];
            m_exBallTimer   = new float[2];
            m_isBallUp      = new bool[2];
            m_ballUpTimer   = new float[2];
            //for (int i = 0; i != m_waitBalls.Length; ++ i)
            //{
            //    m_waitBallsType[i] = (ELevelBallType) Random.Range(0, 4);
            //    m_waitBalls[i] = BattleResource.Instance.GetBallResource(m_waitBallsType[i]);
            //    m_waitBalls[i] = GameObject.Instantiate(m_waitBalls[i]) as GameObject;
            //    m_waitBalls[i].GetComponent<Collider2D>().enabled = false;
            //}
            //SetBallPosition(0);
            //SetBallPosition(1);

            m_cmdMgr = new BattleCmdMgr();
            m_cmdMgr.Init(this);
            m_exBallTime = ConfigHelper.GetSysConfig(ESysConfig.BulletSwitchTime) * 0.001f;

            return(true);
        }
 public void InitLevel(LevelMapData data, BattleBallInfor balls)
 {
     m_balls = balls;
 }