Пример #1
0
        //public bool LerpProperties;
        //public Axis LerpAxis;
        //public Color BeginColor;
        //public Color EndColor;


        public override void Awake()
        {
            for (int i = 0; i < ObjectNumber; ++i)
            {
                Vector3 position = new Vector3 {
                    x = CuboidArea.RandomX(),
                    y = CuboidArea.RandomY(),
                    z = CuboidArea.RandomZ()
                };
                GameObject obj = Spawn();
                obj.transform.position = position;
            }
        }
Пример #2
0
        public void Spawn()
        {
            var rotation = Quaternion.Euler(Rotation);

            for (int index = 0; index < ObjectNumber; ++index)
            {
                var position = new Vector3
                {
                    x = CuboidArea.RandomX(),
                    y = CuboidArea.RandomY(),
                    z = CuboidArea.RandomZ()
                };
                Instantiate(ObjectPrefab, position, rotation, ParentTransform);
            }
        }