Exemplo n.º 1
0
 private void Awake()
 {
     randPos        = GetComponent <RandomPosition>();
     anim           = GetComponent <Animator>();
     sphereCollider = GetComponent <SphereCollider>();
     rb             = GetComponent <Rigidbody>();
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        timeCount += Time.deltaTime;

        if (timeCount > 5 && isSpawning == true)
        {
            RandomPosition pos = this.gameObject.GetComponent <RandomPosition>();
            for (int i = difficultyJelly; i > 0; i--)
            {
                Vector3 randomPosition = pos.getRandomPosition();
                Instantiate(Jellyfish, randomPosition, Quaternion.identity);
            }
            for (int i = difficultyTrash; i > 0; i--)
            {
                Vector3 randomPosition = pos.getRandomPosition();
                Instantiate(Trashbag, randomPosition, Quaternion.identity);

                /*               GameObject trash = Instantiate(Trashbag, randomPosition, Quaternion.identity);
                 *             TrashBag garbage = trash.GetComponent<TrashBag>();
                 *             garbage.setTrashStartingPosition(randomPosition);*/
            }
            timeCount -= 5;

            difficultyUpdated++;
            if (difficultyUpdated % 4 == 0)
            {
                difficultyJelly++;
            }
            if (difficultyUpdated % 3 == 0)
            {
                difficultyTrash++;
            }
        }
    }
Exemplo n.º 3
0
    public void OnMouseUp()
    {
        GetComponent <AudioSource>().PlayOneShot(boxOpen, 0.4f);
        SpriteRenderer sprite = gameObject.GetComponent <SpriteRenderer>();

        if (!isOpen)
        {
            sprite.sprite = Sprite.Create(openSprite, new Rect(0.0f, 0.0f, openSprite.width, openSprite.height), new Vector2(0.5f, 0.5f), 100.0f);
            isOpen        = true;
            for (int index = 0; index < inventory.Count; index++)
            {
                inventory[index].transform.position = RandomPosition.GetRandomTablePosition();
                inventory[index].SetActive(true);
            }
            lastOwnedItems = new List <GameObject>(inventory);
            inventory.Clear();
        }
        else
        {
            sprite.sprite = Sprite.Create(closedSprite, new Rect(0.0f, 0.0f, openSprite.width, openSprite.height), new Vector2(0.5f, 0.5f), 100.0f);
            isOpen        = false;
            for (int i = 0; i < lastOwnedItems.Count; i++)
            {
                GameObject item = lastOwnedItems[i];
                if (item != null && item.GetComponent <Item>().GetBox() == gameObject.name)
                {
                    inventory.Add(item);
                    item.SetActive(false);
                }
            }
            lastOwnedItems.Clear();
        }
    }
Exemplo n.º 4
0
 void Awake()
 {
     mapPosition    = GetComponent <MapPosition>();
     randomPosition = GetComponent <RandomPosition>();
     // float [,] lala = mapPosition.GetMapPosition();
     // Debug.Log(lala[0, 1]);
 }
Exemplo n.º 5
0
        public async Task GetPins()
        {
            IsBusy = true;

            //Setting the current location
            var locator  = CrossGeolocator.Current;
            var position = await locator.GetPositionAsync(new TimeSpan(0, 0, 10));

            var map = (Xamarin.Forms.Maps.Map) this.View.FindByName("map");

            map.MoveToRegion(Xamarin.Forms.Maps.MapSpan.FromCenterAndRadius(new Xamarin.Forms.Maps.Position(position.Latitude, position.Longitude), Xamarin.Forms.Maps.Distance.FromKilometers(1)));

            //Setting the zoom on current position
            var zoomLevel      = 14; //Level between 1 and 18
            var latlongdegress = 360 / (Math.Pow(2, zoomLevel));

            map.MoveToRegion(new Xamarin.Forms.Maps.MapSpan(map.VisibleRegion.Center, latlongdegress, latlongdegress));

            for (int i = 0; i < 8; i++)
            {
                map.Pins.Add(new Pin()
                {
                    Address  = $"Pin {i}",
                    Label    = $"Buteko {i}",
                    Position = RandomPosition.Next(new Position(position.Latitude, position.Longitude), 0.001, 0.001),
                    Type     = PinType.Place
                });
            }

            await Task.Delay(500);

            IsBusy = false;
        }
Exemplo n.º 6
0
 public Location GetNewLocation()
 {
     _pinCreatedCount++;
     return(new Location(
                $"Pin {_pinCreatedCount}",
                $"Desc {_pinCreatedCount}",
                RandomPosition.Next(new Position(-33.933329, 18.6333308), 4, 10)));
 }
 private void Awake()
 {
     ballPos    = FindObjectOfType <RandomPosition>();
     batter     = FindObjectOfType <PathFollower>();
     projectile = FindObjectOfType <Projectile>();
     text.text  = "";
     ballPos.FindNewPosition();
 }
Exemplo n.º 8
0
    void Start()
    {
        mapPositionScript    = gameObject.GetComponent <MapPosition>();
        randomPositionScript = gameObject.GetComponent <RandomPosition>();
        mapArea = mapPositionScript.GetMapPosition();

        StartCoroutine(startHurricane());
    }
Exemplo n.º 9
0
 void updatePositions()
 {
     foreach (GameObject floatingObject in floatingObjects)
     {
         RandomPosition randomPosition = floatingObject.GetComponent <RandomPosition>();
         randomPosition.newPositionAndRotation();
     }
 }
            Place NewPlace()
            {
                ++_pinCreatedCount;

                return(new Place(
                           $"Pin {_pinCreatedCount}",
                           $"Desc {_pinCreatedCount}",
                           RandomPosition.Next(startPosition, 8, 19)));
            }
Exemplo n.º 11
0
    void Awake()
    {
        randomPositionScript = gameObject.GetComponent <RandomPosition>();
        mapPositionScript    = gameObject.GetComponent <MapPosition>();

        float[,] mapArea = mapPositionScript.GetMapPosition();
        healthSliders    = (Slider[])FindObjectsOfType(typeof(Slider));
        CreatePlayers(mapArea);
    }
Exemplo n.º 12
0
    private GameObject InstantiateDebris()
    {
        int index = Random.Range(0, debrisPrefabs.Count);

        GameObject debrisObject = (GameObject)Instantiate(debrisPrefabs[index]);

        debrisObject.transform.position = RandomPosition.Get();

        return(debrisObject);
    }
Exemplo n.º 13
0
    void Start()
    {
        mapPositionScript    = gameObject.GetComponent <MapPosition>();
        randomPositionScript = gameObject.GetComponent <RandomPosition>();

        mapArea = mapPositionScript.GetMapPosition();

        TileBreak.OnBreak += listenOnTileBreak;

        StartCoroutine(StartHail());
    }
Exemplo n.º 14
0
        Place NewPlace()
        {
            var rand = new Random(Environment.TickCount);

            ++_pinCreatedCount;

            return(new Place(
                       $"Pin {_pinCreatedCount}",
                       $"Desc {_pinCreatedCount}",
                       RandomPosition.Next(PinItemsSourcePage.startPosition, 8, 19),
                       rand.Next(0, 4)));
        }
Exemplo n.º 15
0
    void Start()
    {
        mapPositionScript    = gameObject.GetComponent <MapPosition>();
        randomPositionScript = gameObject.GetComponent <RandomPosition>();

        mapArea = mapPositionScript.GetMapPosition();

        InitFoodSpawn();

        TileBreak.OnBreak += listenOnTileBreak;
        Food.OnRemove     += listenOnFoodDestroy;
    }
Exemplo n.º 16
0
    // Use this for initialization
    void Start()
    {
        foreach (GameObject floatingObject in floatingObjects)
        {
            RandomPosition randomPosition = floatingObject.AddComponent <RandomPosition>();

            randomPosition.target          = target;
            randomPosition.lookatRandomnes = new Vector3(1, 1, 1);
            randomPosition.minDistance     = minDistance;
            randomPosition.maxDistance     = maxDistance;
            randomPosition.agent           = floatingObject;
        }
    }
    private void Start()
    {
        dataSaver = new DataSaver();
        // path = Application.dataPath;
        path = "/Users/cs-group/person-im";
        //path = "/Volumes/SXX^_^/person-im";
        loadRole = GetComponent <LoadRole>();
        loadRole.stringLength = sameName.Length;
        randomPosition        = GetComponent <RandomPosition>();

        rotateTimes = Mathf.RoundToInt(360 / rotateAngle);
        loadRole.GeneratePeople(sameName, roleID);
        dataSaver.CreateDirectory(path, loadRole.currentRole[0].name);
    }
Exemplo n.º 18
0
    void Update()
    {
        timeElapsed += Time.deltaTime;

        if (timeElapsed >= spawnInterval)
        {
            var enemies = GameObject.FindGameObjectsWithTag("Enemy").Length;
            if (enemies >= 20)
            {
                return;
            }
            var spawnPos = RandomPosition.GetRandomPos(transform.position, spawnRange);
            var obj      = Instantiate(enemyObject, spawnPos, Quaternion.identity);
            obj.tag     = "Enemy";
            timeElapsed = 0f;
        }
    }
Exemplo n.º 19
0
        public static void MakeStep(Config config, Player player, World world)
        {
            if (player.IsNeutrall)
            {
                return;
            }

            var enemyUnits = world.OverlapUnits(player.AvgPosition, (player.Units.FirstOrDefault()?.CurrentStats.ViewRadius ?? 1f) + 0.5f)
                             .Where((u) => u.Owner != null && u.Owner != player && u.CurrentStats.UnitVisible);
            var enemyCount = enemyUnits.GroupBy((u) => u.Owner.UserId).Select((o) => o.First().Owner)
                             .Select((o) => o.IsAI ? (o.IsNeutrall ? 6 : o.Units.Count) : 1).DefaultIfEmpty(0).Sum();

            Vector2 inputDir = RandomPosition.GetRandomPosition(byte.MaxValue + player.NetworkId * 17, 1f);
            float   t        = Math.Clamp((world.ZoneRadius * world.ZoneRadius * 0.8f) - player.AvgPosition.SqrLength(), 0f, 10f) / 10f;

            inputDir = inputDir * t + (player.AvgPosition * -1f) * (1f - t);

            bool rise = false;

            if (player.GetCooldown() < 0.3f)
            {
                var neutralUnits = world.OverlapUnits(player.AvgPosition, config.RiseRadius).Where((u) => u.Owner == null);
                rise = neutralUnits.Count() > 0;
                if (!rise)
                {
                    var nearUnits = world.OverlapUnits(player.AvgPosition, config.MaxViewRange);
                    var nearUnit  = nearUnits.Where((u) => u.Owner == null).FirstOrDefault();
                    if (nearUnit != null)
                    {
                        inputDir = nearUnit.Position - player.AvgPosition;
                    }
                }
            }
            else if (enemyCount > 0 && (player.Units.Count * 2 >= enemyCount || world.ZoneRadius < 3f || player.Units.Count == config.MaxUnitCount))
            {
                inputDir = Vector2.Empty;
            }

            player.SetInput(new Packets.ClientInput()
            {
                MoveX = inputDir.X,
                MoveY = inputDir.Y,
                Rise  = rise
            });
        }
Exemplo n.º 20
0
    void Start()
    {
        Debug.Log(Directory.GetCurrentDirectory());
        GameObject agent = transform.parent.gameObject;

        annotations          = agent.GetComponent <TargetAnnotation>();
        initializer          = agent.GetComponent <RandomInit>();
        positionDrawer       = agent.GetComponent <RandomPosition>();
        positionDrawer.agent = transform.gameObject;
        rbody         = GetComponent <Rigidbody>();
        engine        = transform.Find("Engine").GetComponent <Engine>();
        accelerometer = transform.Find("Accelerometer").GetComponent <Accelerometer>();
        depthSensor   = transform.Find("DepthSensor").GetComponent <DepthSensor>();
        // calculate max velocity with set parameters
        maxVelocity = new Vector3(engine.maxForceLateral / (rbody.drag * rbody.mass),
                                  engine.maxForceVertical / (rbody.drag * rbody.mass),
                                  engine.maxForceLongitudinal / (rbody.drag * rbody.mass));
        maxYawVelocity = engine.maxTorqueYaw / (rbody.inertiaTensor.y * rbody.angularDrag);
    }
Exemplo n.º 21
0
    void OnValidate()
    {
        GameObject agent = transform.parent.gameObject;

        annotations          = agent.GetComponent <TargetAnnotation>();
        initializer          = agent.GetComponent <RandomInit>();
        positionDrawer       = agent.GetComponent <RandomPosition>();
        positionDrawer.agent = transform.gameObject;
        if (mode == RobotAcademy.DataCollection.gate)
        {
            annotations.target    = gateTargetObject;
            positionDrawer.target = gateTargetObject;
        }
        else if (mode == RobotAcademy.DataCollection.path)
        {
            annotations.target    = pathTargetObject;
            positionDrawer.target = pathTargetObject;
        }
    }
Exemplo n.º 22
0
        private int GetRandom(RandomPosition position, int min, int max)
        {
            if (_deterministic)
            {
                switch (position)
                {
                case RandomPosition.RandomX:
                    return(7);

                case RandomPosition.RandomH:
                    return(2);

                case RandomPosition.RandomK:
                    return(5);

                default:
                    throw new ArgumentException("this position is not supported");
                }
            }

            return(Random.Next(min, max));
        }
Exemplo n.º 23
0
    // Start is called before the first frame update
    void Start()
    {
        audiosource = GetComponent <AudioSource>();
        if (numItemsToUse < 1)
        {
            numItemsToUse = 20;
        }


        for (int i = 0; i < numItemsToUse; i++)
        {
            // Get random item
            GameObject item = items[Random.Range(0, items.Count)];
            items.Remove(item);
            item.gameObject.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);

            GameObject createdObject;
            createdObject = Instantiate(item, RandomPosition.GetRandomTablePosition(), Quaternion.identity);
            unclaimedItems.Add(createdObject);
        }
        audiosource.PlayOneShot(organizationBell, 0.3f);
        lastAudio = "orgbell";
    }
Exemplo n.º 24
0
 private void Awake()
 {
     rand = GetComponent <RandomPosition>();
     rb   = GetComponent <Rigidbody>();
     rand.SetPosition();
 }
Exemplo n.º 25
0
        private static List <Position> Create(RandomPosition randomPositionFun, int expectedKnights)
        {
            var genes = Enumerable.Range(0, expectedKnights).Select(k => randomPositionFun());

            return(genes.ToList());
        }
 public RandomPositionTests()
 {
     _fixture        = new Fixture();
     _random         = new Mock <IRandom>();
     _randomPosition = new RandomPosition(_random.Object);
 }
Exemplo n.º 27
0
 void HandleInvalidItem(GameObject item)
 {
     Debug.Log("NOPE THAT WAS WRONG");
     item.transform.position = RandomPosition.GetRandomTablePosition();
     ShowCheckOrX(false, true);
 }
Exemplo n.º 28
0
    public void replaceSceneObject(Area area, float areasLength, int areasX, bool oposite = false)
    {
        print(area.name + " AREA");
        borderTransforms = new List <Transform> ();
        this.area        = area;
        GameObject[] gos     = area.getSceneObjects();
        bool         nubesOn = false;

        foreach (GameObject go in gos)
        {
            SceneObject sceneObject = null;
            Vector3     pos         = go.transform.position;
            pos.z += areasLength;
            pos.x += areasX;
            if (oposite)
            {
                pos.z *= -1;
            }


            //  if (!nubesOn)
            //  {
            //  nubesOn = true;
            //   addDecoration("Nubes_real", pos, new Vector3(0, Random.Range(0,2), 5));

            //  }

            switch (go.name)
            {
            case "extralargeBlock1":
            case "flyer":
            case "largeBlock1":
            case "mediumBlock1":
            case "smallBlock1":
            case "extraSmallBlock1":
            case "Coin":
            case "bloodx1":
            //case "Yuyo":
            case "enemyFrontal":
            case "enemyWater":
            case "enemySide":
            case "enemyBack":
            case "castle":
            case "SideMountain":
            case "bonusEntrance":
            case "Cascade":
            case "firewall":
            case "Baranda1":
            case "Tumba":
            case "enemyNaveSimple":

                if (go.name == "smallBlock1" || go.name == "extraSmallBlock1")
                {
                    sceneObject = Pool.GetObjectForType(go.name + "_real", true);
                }
                else
                {
                    sceneObject = Pool.GetObjectForType(go.name + "_real", false);
                }

                if (sceneObject)
                {
                    sceneObject.isActive = false;
                    sceneObject.Restart(pos);
                    sceneObject.transform.rotation = go.transform.rotation;

                    //if (go.name == "Yuyo")
                    //	sceneObject.SetMaterialByVideoGame ();

                    //sceneObject.changeMaterial("pasto");

                    if (go.name == "extralargeBlock1")
                    {
                        //GameObject goNew = new GameObject ();
                        //goNew.transform.position = pos;
                        //goNew.transform.rotation = go.transform.rotation;
                        //borderTransforms.Add (goNew.transform);

//						int num = Random.Range(1, 4);
//						string decorationName = "";
//						if (num == 1)
//							decorationName = "flores1_real";
//						if (num == 2)
//							decorationName = "flores2_real";
//						else if (num == 3)
//							decorationName = "floorFlowers_real";
//
//						if (decorationName != "")
//							addDecoration(decorationName, pos, Vector3.zero);
                    }
                    //  }
                    if (go.GetComponent <DecorationManager>())
                    {
                        addDecoration("Baranda1_real", pos, new Vector3(5.5f, 0, 3));
                        addDecoration("Baranda1_real", pos, new Vector3(-5.5f, 0, 3));
                        addDecoration("Baranda1_real", pos, new Vector3(5.5f, 0, -3));
                        addDecoration("Baranda1_real", pos, new Vector3(-5.5f, 0, -3));
                    }
                }
                else
                {
                    Debug.LogError("___________NO EXISTIO EL OBJETO: " + go.name);
                    Data.Instance.events.ForceFrameRate(0);
                }
                break;
            }



            SceneObject clone = null;


            if (go.name == "FloorSurface")
            {
                clone = FloorSurface;
            }
            if (go.name == "PisoPinche")
            {
                clone = PisoPinche;
            }
            else if (go.name == "house1")
            {
                clone = house1;
            }
            else if (go.name == "house2")
            {
                clone = house2;
            }
            else if (go.name == "house3")
            {
                clone = house3;
            }
            else if (go.name == "house4")
            {
                clone = house4;
            }
            else if (go.name == "rampa")
            {
                clone = rampa;
            }
            else if (go.name == "rampaHuge")
            {
                clone = rampaHuge;
            }
            else if (go.name == "wallBig")
            {
                //  addDecorationWithRotation("Graffiti_Real", pos, go.transform.localEulerAngles);
                clone = wallBig;
            }
            else if (go.name == "wallMedium")
            {
                clone = wallMedium;
            }
            else if (go.name == "wallSmall")
            {
                clone = wallSmall;
            }
            else if (go.name == "wallSuperSmall")
            {
                clone = wallSuperSmall;
            }
            else if (go.name == "jumper")
            {
                clone = jumper;
            }
            else if (go.name == "Lava")
            {
                clone = Lava;
            }
            else if (go.name == "Water")
            {
                clone = Water;
            }
            else if (go.name == "Boss1")
            {
                clone = Boss1;
            }
            else if (go.name == "Boss2")
            {
                clone = Boss2;
            }
            else if (go.name == "BossCalecitas1")
            {
                clone = BossCalecitas1;
            }
            else if (go.name == "BossCreator")
            {
                clone = BossCreator;
            }
            else if (go.name == "BossSpace1")
            {
                clone = BossSpace1;
            }
            else if (go.name == "BossPacmans")
            {
                clone = BossPacmans;
            }
            else if (go.name == "BossGalaga")
            {
                clone = BossGalaga;
            }
            else if (go.name == "BossPacmansIntro")
            {
                clone = BossPacmansIntro;
            }
            else if (go.name == "Calecita")
            {
                clone = Calecita;
            }
            else if (go.name == "Starting")
            {
                clone = Starting;
            }
            else if (go.name == "bomb1")
            {
                clone = bomb1;
            }
            else if (go.name == "tunel1")
            {
                clone = tunel1;
            }
            else if (go.name == "tunel2")
            {
                clone = tunel2;
            }
            else if (go.name == "cilindro")
            {
                clone = cilindro;
            }
            else if (go.name == "enemyGhost")
            {
                clone = enemyGhost;
            }
            else if (go.name == "palmTall")
            {
                clone = palm_tall;
                go.transform.localEulerAngles = new Vector3(0, Random.Range(0, 4) * 90, 0);
            }
            else if (go.name == "palm")
            {
                int ran = Random.Range(0, 60);
                if (ran < 20)
                {
                    clone = palm;
                }
                else if (ran < 40)
                {
                    clone = palm2;
                }
                else
                {
                    clone = palm3;
                }

                go.transform.localEulerAngles = new Vector3(0, Random.Range(0, 4) * 90, 0);
                //}
            }
            else if (go.name == "streetFloor")
            {
                clone = streetFloor;
            }
            else if (go.name == "streetFloorSmall")
            {
                clone = streetFloorSmall;
            }
            else if (go.name == "levelSignal")
            {
                clone = levelSignal;
            }
            else if (go.name == "GrabbableJetpack")
            {
                clone = GrabbableJetpack;
            }
            else if (go.name == "GrabbableInvensible")
            {
                clone = GrabbableInvensible;
            }
            else if (go.name == "borde1")
            {
                clone = borde1;
            }
            else if (go.name == "fences")
            {
                clone = fences;
            }
            else if (go.name == "rainbow")
            {
                clone = rainbow;
            }
            else if (go.name == "Listener")
            {
                clone = Listener;
            }
            else if (go.name == "cruz")
            {
                clone = cruz;
            }
            else if (go.name == "CruzGrande")
            {
                clone = CruzGrande;
            }
            else if (go.name == "rueda1")
            {
                clone = rueda1;
            }
            else if (go.name == "helice1")
            {
                clone = helice1;
            }
            else if (go.name == "helice2")
            {
                clone = helice2;
            }
            else if (go.name == "subibaja")
            {
                clone = subibaja;
            }
            else if (go.name == "cepillo")
            {
                clone = cepillo;
            }
            else if (go.name == "pisoRotatorio")
            {
                clone = pisoRotatorio;
            }
            else if (go.name == "sombrilla")
            {
                clone = sombrilla;
            }
            else if (go.name == "GrabbableMissile")
            {
                clone = GrabbableMissile;
            }
            else if (go.name == "FloorSlider")
            {
                clone = FloorSlider;
            }


            if (clone)
            {
                sceneObject = Instantiate(clone, pos, Quaternion.identity) as SceneObject;
                sceneObject.transform.parent   = Pool.Scene.transform;
                sceneObject.transform.rotation = go.transform.rotation;

                if (go.GetComponent <BossSettings>())
                {
                    BossSettings mo = go.GetComponent <BossSettings>();
                    CopyComponent(mo, sceneObject.gameObject);
                }

                sceneObject.Restart(pos);
            }
            if (go.GetComponent <Move>() && sceneObject.GetComponent <Move>() == null)
            {
                Move mo = go.GetComponent <Move>();
                CopyComponent(mo, sceneObject.gameObject);
            }
            if (go.GetComponent <MoveObject>())
            {
                MoveObject mo = go.GetComponent <MoveObject>();
                CopyComponent(mo, sceneObject.gameObject);
            }
            if (go.GetComponent <Dropper>())
            {
                Dropper mo = go.GetComponent <Dropper>();
                CopyComponent(mo, sceneObject.gameObject);
            }

            if (go.GetComponent <EnemyPathRunnerBehavior>())
            {
                EnemyPathRunnerBehavior mo = go.GetComponent <EnemyPathRunnerBehavior>();
                CopyComponent(mo, sceneObject.gameObject);
            }
            if (go.GetComponent <EnemyShooter>())
            {
                EnemyShooter mo = go.GetComponent <EnemyShooter>();
                CopyComponent(mo, sceneObject.gameObject);
            }
            if (go.GetComponent <EnemyRunnerBehavior>())
            {
                EnemyRunnerBehavior mo = go.GetComponent <EnemyRunnerBehavior>();
                CopyComponent(mo, sceneObject.gameObject);
            }
            if (go.GetComponent <Jump>())
            {
                Jump mo = go.GetComponent <Jump>();
                CopyComponent(mo, sceneObject.gameObject);
            }
            if (go.GetComponent <EnemyPathsMultiples>())
            {
                EnemyPathsMultiples mo = go.GetComponent <EnemyPathsMultiples>();
                CopyComponent(mo, sceneObject.gameObject);
            }



            if (go.GetComponent <Subibaja>())
            {
                Subibaja mo = go.GetComponent <Subibaja>();
                CopyComponent(mo, sceneObject.gameObject);
            }

            if (go.GetComponent <ListenerDispatcher>())
            {
                ListenerDispatcher mo = go.GetComponent <ListenerDispatcher>();
                CopyComponent(mo, sceneObject.gameObject);
            }
            if (go.GetComponent <FlyingBehavior>())
            {
                FlyingBehavior mo = go.GetComponent <FlyingBehavior>();
                CopyComponent(mo, sceneObject.gameObject);
            }
            if (go.GetComponent <FullRotation>())
            {
                FullRotation mo = go.GetComponent <FullRotation>();
                CopyComponent(mo, sceneObject.gameObject);
            }
            if (go.GetComponent <Bumper>())
            {
                Bumper mo = go.GetComponent <Bumper>();
                CopyComponent(mo, sceneObject.gameObject);
            }
            if (go.GetComponent <RandomPosition>())
            {
                RandomPosition mo = go.GetComponent <RandomPosition>();
                pos = mo.getPosition(pos);
            }
        }
        //AddBorders ();
    }
Exemplo n.º 29
0
 private static Vector2 GetPos(int i, float zone, float time)
 {
     return(RandomPosition.GetRandomPosition(i, time) * zone * RandomPosition.GetRandomFloat(i + 5, time));
 }
 public Particle(RandomPosition randomPosition, ParticleFlyWeight particleFlyweight)
 {
     this.randomPosition    = randomPosition;
     this.particleFlyweight = particleFlyweight;
 }