Example #1
0
        void OnGUI()
        {
            GUILayout.BeginArea(new Rect(10, 10, 120, 170));

            GUI.enabled = m_allowToSpawnShape;

            GUILayout.Label(m_message);

            if (GUILayout.Button("Spawn box"))
            {
                SpawnShape.Broadcast(ShapeType.Box);
            }

            if (GUILayout.Button("Spawn sphere"))
            {
                SpawnShape.Broadcast(ShapeType.Sphere);
            }

            GUI.enabled = true;

            GUILayout.Space(5);

            if (GUILayout.Button("Critical Message"))
            {
                CriticalMessage.Broadcast();
            }

            m_criticalMessageSubscription.Enabled = GUILayout.Toggle(m_criticalMessageSubscription.Enabled, "Handle critical");


            GUILayout.EndArea();
        }
Example #2
0
    //all basic shapes can be created with this
    public static Vector3[] Simple(SpawnShape shape, float radius, float angleOffset = 0f, int fillerAmount = 0)
    {
        Vector3[] keyPoints = PrimaryPoints((int)shape, radius, angleOffset);

        //add filler
        return(Filler(keyPoints, fillerAmount));
    }
Example #3
0
 private void Start()
 {
     for (int i = 0; i < cells.Length; i++)
     {
         cells[i] = 0;
     }
     spawner = FindObjectOfType <SpawnShape>();
 }
Example #4
0
        //set values in creator to passed in patternInfo, used in Edit
        public void SetInfo(PatternInfo info)
        {
            transform.position = info.relativePosition;
            //transform.rotation = info.rotation;

            amountOfPoints = info.fillerAmount;
            radius         = info.radius;
            angleOffset    = info.angleOffset;
            spawnShape     = info.shape;

            Configure();
        }
Example #5
0
        private void OnValidate()
        {
            if (spawnShape != currentShape)
            {
                currentShape = spawnShape;
                Configure();
            }

            if (amountOfPoints <= 0)
            {
                amountOfPoints = 1;
            }
        }
        public SimpleItem[] SpawnPrefabs(SimpleItem prefab, int amount, SpawnShape shape)
        {
            switch (shape)
            {
            case SpawnShape.Line:
                _items = SpawnLine(prefab, amount);
                break;

            case SpawnShape.Circle:
                _items = SpawnCircle(prefab, amount);
                break;
            }

            return(_items);
        }