public void AddPressedDelegate(OnPressedDelegate d)
 {
     if(pressedDelegate == null)
         pressedDelegate = d;
         else
         pressedDelegate += d;
 }
Beispiel #2
0
    static public void LastButton(string text, OnPressedDelegate onPressed)
    {
        delegates.Add(onPressed);

        GUI.SetNextControlName("Boton" + cantidadBotones.ToString());

        if (GUI.Button(new Rect(10, 400 - 70, 380, 30), text))
            onPressed();

        cantidadBotones++;
    }
Beispiel #3
0
    static public void Button(string text, OnPressedDelegate onPressed)
    {
        delegates.Add(onPressed);

        GUI.SetNextControlName("Boton" + cantidadBotones.ToString());

        if (GUI.Button(new Rect(10 * WidthRatio, 40 * HeightRatio + 30 * 2 * cantidadBotones * HeightRatio, 380 * WidthRatio, 30 * HeightRatio), text, fontStyle))
        {
            onPressed();
        }
        cantidadBotones++;
    }
    static public void LastButton(string text, OnPressedDelegate onPressed)
    {
        delegates.Add(onPressed);

        GUI.SetNextControlName("Boton" + cantidadBotones.ToString());

        if (GUI.Button(new Rect(10, 400 - 70, 380, 30), text))
        {
            onPressed();
        }

        cantidadBotones++;
    }
 public void RemovePressedDelegate(OnPressedDelegate d)
 {
     if(pressedDelegate != null) pressedDelegate -= d;
 }
 public override void Enter()
 {
     angle = context.playerTransform.eulerAngles.y;
     GameObject obj = Create3DArrow();
     arrow = (PointToPoint)obj.AddComponent(typeof(PointToPoint));
     arrow.setVector(context.playerTransform.TransformDirection(Vector3.right));
     onPressedDelegate = new OnPressedDelegate(this.OnPressedAim);
     context.buttonAim.AddPressedDelegate(onPressedDelegate);
     context.buttonAim.StartBlinking();
     context.playerControl.setControl(PlayerControl.Type.Joystick);
 }
 public override void Enter()
 {
     d = new OnPressedDelegate(this.OnPressedFire);
     context.buttonFire.AddPressedDelegate(d);
     context.buttonFire.StartBlinking();
 }
 public override void Enter()
 {
     d = new OnPressedDelegate(this.OnPressedBoost);
     context.buttonBoost.AddPressedDelegate(d);
     context.buttonBoost.StartBlinking();
 }
 public override void Enter()
 {
     d = new OnPressedDelegate(this.OnPressedAim);
     context.buttonAim.AddPressedDelegate(d);
     context.buttonAim.StartBlinking();
     arrow = CreateBlinking2DArrow();
 }
Beispiel #10
0
 public override void Enter()
 {
     isUp = true;
     initialDepth = minDepth = maxDepth = context.depth;
     StartBlinkingDepthText();
     GameObject obj = Create3DArrow();
     arrow = (PointUpOrDown)obj.AddComponent(typeof(PointUpOrDown));
     onPressedDelegate = new OnPressedDelegate(this.OnPressedAim);
     context.buttonAim.AddPressedDelegate(onPressedDelegate);
     context.buttonAim.StartBlinking();
     context.playerControl.setControl(PlayerControl.Type.Joystick);
 }