Example #1
0
 public ShipGroup(GROUPTYPE pType, int pID)
 {
     m_eType = pType;
     m_iID = pID;
     m_liShips = new List<GameObject>();
     _m_liWaypoints = new List<GameObject>();
 }
Example #2
0
        public AssetGroup(DataRow dataRow, GROUPTYPE groupType) : base()
        {
            GroupType = groupType;
            Name      = (string)dataRow["_NAME"];

            // The parent of this item may be null if the root item
            if (dataRow.IsNull("_PARENTID"))
            {
                this.ParentID = 0;
            }
            else
            {
                this.ParentID = (int)dataRow["_PARENTID"];
            }

            if (groupType == GROUPTYPE.userlocation)
            {
                GroupID      = (int)dataRow["_LOCATIONID"];
                FullName     = (string)dataRow["_FULLNAME"];
                this.StartIP = (string)dataRow["_START_IPADDRESS"];
                this.EndIP   = (string)dataRow["_END_IPADDRESS"];
            }
            else
            {
                this.GroupID  = (int)dataRow["_DOMAINID"];
                this.FullName = Name;
            }
        }
Example #3
0
    /// <summary>
    /// 切换模式
    /// </summary>
    private void TurnGroupType()
    {
        curRepeat = 0;
        if (groupType == GROUPTYPE.NORMAL)
        {
            int rand = Random.Range(1, 5);
            switch (rand)
            {
            case 1:
                groupType = GROUPTYPE.RAPID;
                repeats   = Random.Range(3, 10);
                break;

            case 2:
                groupType = GROUPTYPE.SLOW;
                repeats   = Random.Range(1, 4);
                break;

            case 3:
                groupType = GROUPTYPE.PASSING;
                repeats   = 1;
                break;

            case 4:
                groupType = GROUPTYPE.DECELERATE;
                repeats   = 1;
                break;
            }
        }
        else
        {
            groupType = GROUPTYPE.NORMAL;
            repeats   = Random.Range(1, 4);
        }
    }
Example #4
0
    /// <summary>
    /// 创建怪物编队
    /// </summary>
    /// <param name="position">怪物出现的位置</param>
    /// <param name="speed">怪物的速度</param>
    /// <param name="size">怪物的数量</param>
    /// <param name="type">怪物模式</param>
    private void CreateOniGroup(Vector3 position, float speed, int level, GROUPTYPE type)
    {
        position.y = 1.0f;
        GameObject group = Instantiate(OniGroupPrefab, position, Quaternion.identity);

        if (group == null)
        {
            return;
        }

        int size = 1;

        if (level < 3)
        {
            size = level + 1;
        }
        else
        {
            size = Random.Range(6, 10);
        }
        _OniGroupControl groupControl = group.GetComponent <_OniGroupControl>();

        if (groupControl == null)
        {
            return;
        }
        groupControl.CreateOnis(size, position);
        groupControl.runSpeed = speed;
        if (type == GROUPTYPE.DECELERATE)
        {
            groupControl.isDecelerate = true;
        }
    }
Example #5
0
 /// <summary>
 /// 重置怪物模式
 /// </summary>
 public void ResetLevel()
 {
     level         = 0;
     curRepeat     = 0;
     repeats       = 0;
     groupType     = GROUPTYPE.NORMAL;
     dispatchTime += 5.0f;
 }
Example #6
0
 public AssetGroup()
 {
     _groupID         = 0;
     _fullname        = "";
     _name            = "";
     _parentID        = 0;
     _start_ipaddress = "";
     _end_ipaddress   = "";
     _groupType       = GROUPTYPE.domain;
     _populated       = false;
 }
Example #7
0
 /// <summary>
 /// Create a blank object of the correct group type
 /// </summary>
 /// <param name="groupType"></param>
 public AssetGroup(GROUPTYPE groupType)
     : base()
 {
     _groupType = groupType;
 }
    void GUINewGroupColumn(float pColumnWidth, float pColumnHeight)
    {
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();

        GUILayout.BeginVertical("box1", GUILayout.Width(pColumnWidth), GUILayout.Height(pColumnHeight));
        GUILayout.FlexibleSpace();
        GUILayout.Label("New Group", "HeaderLabel");

        string[] types = Enum.GetNames(typeof(GROUPTYPE));
        GUILayout.Label("New Group Type", "box");
        _m_eNextGroupType = (GROUPTYPE)GUILayout.SelectionGrid((int)_m_eNextGroupType, types, types.Length);

        GUILayout.Label("Group Interceptors:", "box");
        GUILayout.BeginHorizontal();
        if(GUILayout.Button("-", "button"))
        {
            _m_iNextGroupInterceptors--;
        }
        GUILayout.Label(_m_iNextGroupInterceptors.ToString(), "label");
        if(GUILayout.Button("+", "button"))
        {
            _m_iNextGroupInterceptors++;
        }
        GUILayout.EndHorizontal();

        GUILayout.Label("Group Scouts:", "box");
        GUILayout.BeginHorizontal();
        if(GUILayout.Button("-", "button"))
        {
            _m_iNextGroupScouts--;
        }
        GUILayout.Label(_m_iNextGroupScouts.ToString(), "label");
        if(GUILayout.Button("+", "button"))
        {
            _m_iNextGroupScouts++;
        }
        GUILayout.EndHorizontal();

        if(GUILayout.Button("Assign Group"))
        {
            bool assignedSuccess = AssignNewGroup(_m_eNextGroupType);
            if(assignedSuccess)
                _m_eWindowState = WINDOWSTATE.GroupCreationSuccess;
            else
                _m_eWindowState = WINDOWSTATE.GroupCreationFailed;
        }
        GUILayout.FlexibleSpace();
        GUILayout.EndVertical();

        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();
    }
    bool AssignNewGroup(GROUPTYPE pType)
    {
        //the number of the new group is the same as the number of groups (as it starts at 0)
        int newGroup = m_liShipGroups.Count;

        //check that next cap ints are higher than 0
        if(_m_iNextGroupInterceptors > 0 || _m_iNextGroupScouts > 0)
        {
            //create new group
            m_liShipGroups.Add(new ShipGroup(pType, newGroup));
        }

        return NewGroupExecution(m_liShipGroups[newGroup], _m_iNextGroupInterceptors, _m_iNextGroupScouts);
    }