Exemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            Vector2Event script = (Vector2Event)target;

            //Event Description
            GUILayout.BeginVertical();
            EditorGUILayout.LabelField("Event Description", EditorStyles.centeredGreyMiniLabel);
            EditorStyles.textField.wordWrap = true;
            script.EventDescription         = EditorGUILayout.TextArea(script.EventDescription, GUILayout.MinHeight(100));
            GUILayout.EndVertical();

            //Test Event Button
            GUILayout.BeginVertical(EditorStyles.helpBox);
            EditorGUILayout.LabelField("Test Event", EditorStyles.centeredGreyMiniLabel);
            value = EditorGUILayout.Vector2Field("Value ", value);

            if (GUILayout.Button("Raise"))
            {
                if (Application.isPlaying)
                {
                    script.Raise(value);
                }
            }
            GUILayout.EndVertical();
        }
Exemplo n.º 2
0
    public IEnumerator PassBucketHandler()
    {
        animator.SetTrigger("passEvent");
        Debug.Log("pass animation trigger");
        key = "";

        if (new Vector2(nextPosX, nextPosY) == -Vector2.one)
        {
            lastHolderTossEvent.Raise();
        }
        if (!hasFinished)
        {
            isHoldingBucket = canPassBucket = false;

            GameObject keyObj = transform.GetChild(0).gameObject;
            keyObj.SetActive(false);

            //this.GetComponent<SpriteRenderer>().color = Color.white;
        }

        yield return(new WaitForSeconds(passDuration));

        passBucketEvent.Raise(new Vector2(posX, posY));
        Debug.Log("Raised pass event from " + new Vector2(posX, posY));
    }
Exemplo n.º 3
0
        /// <summary>
        /// Set the state af a tile.
        /// </summary>
        /// <param name="tile">Tile</param>
        /// <param name="state">State</param>
        public void SetNodeState(Vector2Int tile, Enums.TileState state)
        {
            grid[tile.x, tile.y].SetState(state);

            if (state == Enums.TileState.BLOCKED || state == Enums.TileState.DISABLED)
            {
                TileBlockedEvent.Raise(tile);
            }
        }
    public override void Do(Collider2D collider)
    {
        if (!collider)
        {
            return;
        }

        if (collider.CompareTag("Ball"))
        {
            onBallNeedRespawn.Raise(spawnMove);
        }
    }
Exemplo n.º 5
0
 void FixedUpdate() {
     if (!pressed) return;
     OnPressedFixed?.Raise(delta);
 }
Exemplo n.º 6
0
 public void OnDrag(PointerEventData eventData)
 {
     vector2Event.Raise(eventData.delta.normalized);
 }
Exemplo n.º 7
0
 public void CheckNeighborHolding()
 {
     checkNeighborHoldingEvent.Raise(new Vector2(nextPosX, nextPosY));
 }