Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (brushPlayer == null && GameObject.FindGameObjectWithTag("LocalPlayer") != null)
        {
            brushPlayer = GameObject.FindGameObjectWithTag("LocalPlayer").GetComponent <PlayerBehaviour>();
        }

        if (brushPlayer == null)
        {
            return;
        }

        for (int i = 0; i < pinchDetectors.Length; i++)
        {
            var detector = pinchDetectors[i];

            if (detector.DidStartPinch)
            {
                brushPlayer.CmdCreateBrush(this.transform.position, false);
                currentBrush = brushPlayer.currentBrush;
            }

            if (detector.DidEndPinch)
            {
                currentBrush = null;
            }

            if (detector.IsPinching)
            {
                Paint(detector.Position);
            }
        }
    }
Exemplo n.º 2
0
 void Instantiate(PlaygroundParticlesC brush)
 {
     brushPlayer.CmdCreateBrush(this.transform.position, true);
 }