Пример #1
0
    private void ActionSummonBiont()
    {
        switch (currentSummon)
        {
        case SummonPregress.Step1:
        {
            point1 = TriggerManager.Singleton.GetAITriggerByName("trigger_necromancer1");

            if (null != point1)
            {
                point1.Active();
            }
        }
        break;

        case SummonPregress.Step2:
        {
            point2 = TriggerManager.Singleton.GetAITriggerByName("trigger_necromancer2");

            if (null != point2)
            {
                point2.Active();
            }
        }
        break;

        case SummonPregress.Step3:
        {
            point3 = TriggerManager.Singleton.GetAITriggerByName("trigger_necromancer3");

            if (null != point3)
            {
                point3.Active();
            }
        }
        break;

        case SummonPregress.Step4:
        {
            point4 = TriggerManager.Singleton.GetAITriggerByName("trigger_necromancer4");

            if (null != point4)
            {
                point4.Active();
            }
        }
        break;

        case SummonPregress.Step5:
        {
            point5 = TriggerManager.Singleton.GetAITriggerByName("trigger_necromancer5");

            if (null != point5)
            {
                point5.Active();
            }
        }
        break;
        }
    }
Пример #2
0
    /// <summary>
    /// 随机出生点
    /// </summary>
    /// <returns></returns>
    public static BornPoint GetRandomBornPoint()
    {
        int n = allList.Count;

        MapGrid        grid     = null;
        List <MapGrid> tempList = null;

        while (tempList == null || tempList.Count < 6)
        {
            int m = Random.Range(0, n);
            grid     = allList[m];
            tempList = FindConnected6(grid);
        }


        //grid = MapManager.GetGrid(4, 15);
        //tempList = FindConnected6(grid);

        BornPoint bp = new BornPoint();

        tempList.Add(grid);
        bp.grids = tempList;
        bp.pos   = grid.transform.localPosition;
        return(bp);
    }
Пример #3
0
    /// <summary>
    /// Set the index range for each trigger, including inactive triggers.
    /// </summary>
    public void InitTriggerIndexRange()
    {
        foreach (Transform t in this.transform)
        {
            BornPoint bp = t.GetComponent <BornPoint>();

            Assertion.Check(bp != null);

            int startIndex, endIndex;

            LevelManager.Singleton.GetIndexRangeByTrigger(t.name, out startIndex, out endIndex);

            bp.StartEnemyIndex = startIndex;

            bp.EndEnemyIndex = endIndex;

            Debug.Log(string.Format("Trigger {0}, Start index = {1}, End index = {2}", bp.name, startIndex, endIndex));

            if (startIndex < 0)
            {
                break;
            }
        }

        //validate triggers to make sure they are not looped
        ValidateTriggers();
    }
Пример #4
0
        public void Init()
        {
            List <Point> startPoints = GameManager.Instance.startPoints;

            for (int i = 0; i < startPoints.Count; i++)
            {
                GameObject start = new GameObject($"start{i}");
                start.transform.parent   = transform;
                start.transform.position = startPoints[i].CenterPos;

                BornPoint bornPoint = new BornPoint(start.transform, startPoints[i]);
                spawnPointDic.Add(i, bornPoint);
            }

            SetLevelMsg();
        }
Пример #5
0
    private void Start()
    {
        instance = this;

        bornpoints[0, 0] = new Vector3(0.0f, 0.0f, -1.0f);
        bornpoints[0, 1] = new Vector3(7.0f, 5.0f, -1.0f);
        bornpoints[0, 2] = new Vector3(7.0f, -5.0f, -1.0f);
        bornpoints[0, 3] = new Vector3(-7.0f, -5.0f, -1.0f);
        bornpoints[0, 4] = new Vector3(-7.0f, 5.0f, -1.0f);

        bornpoints[1, 0] = new Vector3(0.0f, 8.0f, -1.0f);
        bornpoints[1, 1] = new Vector3(8.0f, -8.0f, -1.0f);
        bornpoints[1, 2] = new Vector3(2.0f, -8.0f, -1.0f);
        bornpoints[1, 3] = new Vector3(-2.0f, -8.0f, -1.0f);
        bornpoints[1, 4] = new Vector3(-8.0f, -8.0f, -1.0f);
    }