Пример #1
0
        public IShot CreateShot(ShotName name)
        {
            switch (name)
            {
            case ShotName.shotFormBorder:
                return(new Shot_FormBorder());

            case ShotName.shotFormCorner:
                return(new Shot_FormCorner());

            case ShotName.circle:
                return(new Shot_Circle());

            case ShotName.circles:
                return(new Shot_Circles());

            case ShotName.placedCircle:
                return(new Shot_PlacedCircle());

            case ShotName.randomCircles:
                return(new Shot_RandomCircles());

            case ShotName.randomAngleCircle:
                return(new Shot_RandomAngleCircle());

            case ShotName.nWay:
                return(new Shot_NWay());

            case ShotName.nWays:
                return(new Shot_NWays());

            case ShotName.spirals:
                return(new Shot_Spirals());

            case ShotName.biDirectionalSpirals:
                return(new Shot_BiDirSpiral());

            case ShotName.aimimg:
                return(new Shot_Aiming());

            case ShotName.aimingLines:
                return(new Shot_AimingLines());

            case ShotName.aimingNWayLines:
                return(new Shot_AimingNWayLine());

            case ShotName.aimingRollings:
                return(new Shot_AimingRollings());

            case ShotName.rollingNWay:
                return(new Shot_RollingNWay());

            case ShotName.randomSpread:
                return(new Shot_RandomSpread());

            default:
                break;
            }
            return(null);
        }
Пример #2
0
 public void AddShotBuilder(ShotName name)
 {
     IShot shot = shotFactory.CreateShot(name);
     if (shot != null)
     {
         stateStack.Enqueue(shot);
     }
 }
Пример #3
0
    public void Add()
    {
        ShotName _name = (ShotName)dropName.value;

        names.Add(_name);
        GameObject _obj = Instantiate(pfItem, root);

        objNames.Add(_obj);
        _obj.SetActive(true);
        Text _txt = _obj.GetComponentInChildren <Text>();

        _txt.text = _name.ToString();
    }
Пример #4
0
    private void Start()
    {
        List <Dropdown.OptionData> options = new List <Dropdown.OptionData>();

        dropName.ClearOptions();
        for (int i = 0; i < 17; i++)
        {
            ShotName _name = (ShotName)i;
            options.Add(new Dropdown.OptionData(_name.ToString()));
        }
        dropName.AddOptions(options);
        names    = new List <ShotName>();
        objNames = new List <GameObject>();
    }
Пример #5
0
 public void Apply()
 {
     if (names.Count == 0)
     {
         ShotName _name = (ShotName)dropName.value;
         names.Add(_name);
     }
     for (int i = 0; i < objNames.Count; i++)
     {
         Destroy(objNames[i]);
     }
     objNames = new List <GameObject>();
     //
     boss.AddShotBuilder(names);
     names = new List <ShotName>();
 }