Example #1
0
 // Use this for initialization
 void Start()
 {
     allPieces = GetComponentsInChildren <Collider2D>();
     Debug.Log("All pieces in WaterCave: " + allPieces.Length);
     touchOrMouseListener = InputEvent.AddListenerTouchOrMouse(TouchOrMouseStart, null, null, 1.0f);
     piecesTapped         = new Collider2D[correctPieceOrder.Length];
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     originalLocalPosition = gameObject.transform.localPosition;
     originalLocalRotation = gameObject.transform.rotation;
     originalParent        = gameObject.transform.parent;
     originalSprite        = gameObject.GetComponent <SpriteRenderer>().sprite;
     touchOrMouseListener  = InputEvent.AddListenerTouchOrMouse(TouchOrMouseStart, TouchOrMouseChange, TouchOrMouseEnd, 1.0f);
 }
Example #3
0
 void Start()
 {
     correctNums.Add(60);
     correctNums.Add(-30);
     correctNums.Add(30);
     correctNums.Add(90);
     correctNums.Add(-60);
     originalAngle        = transform.eulerAngles.z;  // Store your initial rotation
     touchOrMouseListener = InputEvent.AddListenerTouchOrMouse(TouchOrMouseStart, TouchOrMouseChange, TouchOrMouseEnd, 1.0f);
 }
    // Use this for initialization
    void Start()
    {
        this.manager = goManager.GetComponent <TabletPuzzleManager>();
        InputEvent.AddListenerTouchOrMouse(TouchOrMouseStart, TouchOrMouseChange, TouchOrMouseEnd, 1.0f);

        Vector3 worldCenter = this.goManager.GetComponent <BoxCollider2D>().bounds.center;
        Vector3 chipCenter  = this.GetComponent <BoxCollider2D>().bounds.center;

        this.centerOffset = worldCenter - chipCenter;
    }
    // Register your event listener in Start
    void Start()
    {
        // Register the listener
        InputEvent.AddListenerTouchOrMouse(TouchOrMouseHandler, null, null, pointHistoryLength);

        // Add some pretty material to the lines
        LineRenderer lr = goLineRenderer.GetComponent <LineRenderer>();

        lr.material = new Material(Shader.Find("Particles/Alpha Blended"));
        goLineRenderer.SetActive(false);
    }
 // Use this for initialization
 void Start()
 {
     allPieces = GetComponentsInChildren <Collider2D>();
     Debug.Log("All pieces: " + allPieces.Length);
     touchOrMouseListener = InputEvent.AddListenerTouchOrMouse(TouchOrMouseStart, null, null, 1.0f);
     piecesTapped         = new Collider2D[triesBeforeReset];
     if (moveToTapLocation != null)
     {
         originalMoveToTapPosition = moveToTapLocation.transform.localPosition;
     }
     if (triesBeforeReset < correctPieceOrder.Length)
     {
         Debug.Log("We reset the puzzle before the player can enter the correct length!");
     }
 }
    // wake the sphere
    void PushStart(InputHandler input)
    {
        // Remove the any key listener
        InputEvent.RemoveListener(anyKeyListener);

        // Register a listener for more from the same keyboard key
        key = ((InputHandlerKey)input).key;
        InputEvent.AddListenerKey(key, PushUp, null);

        // Register a listener function for pointer event (click or touch start)
        InputEvent.AddListenerTouchOrMouse(PushUp, null, null);

        // wake the ball
        started = true;
        sphere.GetComponent <Rigidbody>().AddForce(Vector3.right * 5, ForceMode.VelocityChange);
    }
Example #8
0
 // Use this for initialization
 void Start()
 {
     cachedSortingLayer    = GetComponent <SpriteRenderer>().sortingLayerName;
     originalLocalPosition = gameObject.transform.localPosition;
     touchOrMouseListener  = InputEvent.AddListenerTouchOrMouse(TouchOrMouseStart, TouchOrMouseChange, TouchOrMouseEnd, 1.0f);
 }
Example #9
0
 // Use this for initialization
 void Start()
 {
     touchOrMouseListener = InputEvent.AddListenerTouchOrMouse(TouchOrMouseStart, null, null, 1.0f);
 }
Example #10
0
 void Start()
 {
     originalAngle        = transform.eulerAngles.z;  // Store your initial rotation
     touchOrMouseListener = InputEvent.AddListenerTouchOrMouse(TouchOrMouseStart, TouchOrMouseChange, TouchOrMouseEnd, 1.0f);
     maxSlots             = enteredAngles.Length;
 }
 // Use this for initialization
 void Start()
 {
     touchOrMouseListener = InputEvent.AddListenerTouchOrMouse(TouchOrMouseStart, TouchOrMouseChange, TouchOrMouseEnd, 1.0f);
 }
Example #12
0
 // Use this for initialization
 protected virtual void Start()
 {
     InputEvent.AddListenerTouchOrMouse(TouchOrMouseStart, TouchOrMouseChange, TouchOrMouseEnd, 1.0f);
 }
Example #13
0
 // Use this for initialization
 void Start()
 {
     touchOrMouseListener = InputEvent.AddListenerTouchOrMouse(TouchOrMouseStart, null, null, 1.0f);
     colliders            = GetComponentsInChildren <Collider2D>();
 }