Beispiel #1
0
        protected virtual void Update()
        {
            cooldown -= Time.deltaTime;

            if (cooldown <= 0.0f)
            {
                cooldown = Delay;

                var angle = Random.Range(0.0f, 360.0f);

                D2dStamp.All(Paint, transform.position, Size, angle, Shape, Color, Layers);
            }
        }
Beispiel #2
0
        protected virtual void Start()
        {
            if (Stamp == true)
            {
                var stampPosition = transform.position;
                var stampAngle    = StampRandomDirection == true?Random.Range(-180.0f, 180.0f) : 0.0f;

                D2dStamp.All(StampPaint, stampPosition, StampSize, stampAngle, StampShape, StampColor, Mask);
            }

            if (Raycast == true && RaycastCount > 0)
            {
                StartCoroutine(DelayForce());
            }
        }
Beispiel #3
0
        protected virtual void Update()
        {
            // Main camera exists?
            var mainCamera = Camera.main;

            if (mainCamera != null)
            {
                // World position of the mouse
                var position = D2dHelper.ScreenToWorldPosition(Input.mousePosition, Intercept, mainCamera);

                // Begin dragging
                if (Input.GetKey(Requires) == true && down == false)
                {
                    down = true;
                }

                // End dragging
                if (Input.GetKey(Requires) == false && down == true)
                {
                    down = false;

                    // Stamp at that point
                    D2dStamp.All(Paint, position, Size, Angle, Shape, Color, Layers);
                }

                // Update indicator?
                if (down == true && IndicatorPrefab != null)
                {
                    if (indicatorInstance == null)
                    {
                        indicatorInstance = Instantiate(IndicatorPrefab);
                    }

                    indicatorInstance.transform.position = position;
                }
                // Destroy indicator?
                else if (indicatorInstance != null)
                {
                    Destroy(indicatorInstance.gameObject);
                }
            }
        }
Beispiel #4
0
 public static void All(D2dDestructible.PaintType paint, Vector2 startPos, Vector2 endPos, float thickness, Texture2D shape, Color color, int layerMask = -1)
 {
     D2dStamp.All(paint, CalculateMatrix(startPos, endPos, thickness), shape, color, layerMask);
 }