SetEnabled() public static method

Enables or disables Easy Touch.
public static SetEnabled ( bool enable ) : void
enable bool /// true = enable
/// false = disable ///
return void
    public IEnumerator UpdateXZ(Platform platform)
    {
        EasyTouch.SetEnabled(false);
        var isRotated = layer.isRotated;
        var rotated   = isRotated ? -1 : 1;

        angleForXZRotation = MathAngle.To360Degree(platform.defaultAngleInLayer);
        angleForXZRotation = isRotated ? 360 - angleForXZRotation : angleForXZRotation;

        angleForXZRotation *= Mathf.Deg2Rad;
        var firstX  = CurrentAngleX;
        var firstZ  = CurrentAngleZ;
        var factorX = (float)-Math.Sin(angleForXZRotation) * rotated;
        var factorZ = (float)Math.Cos(angleForXZRotation) * rotated;

        while (true)
        {
            var speed  = speedXZRotation;
            var angleX = speed * factorX;
            var angleZ = speed * factorZ;
            if (XZisRight(firstX, firstZ))
            {
                SetPerfectRotation();
                rotateController.ReshuffleAfterXZRotation(platform);
                layer.isRotated = !layer.isRotated;
                EasyTouch.SetEnabled(true);

                yield break;
            }
            layerTransform.Rotate(angleX, 0, 0, Space.Self);
            layerTransform.Rotate(0, 0, angleZ, Space.Self);
            yield return(new WaitForFixedUpdate());
        }
    }
    public IEnumerator StabilizeY()
    {
        EasyTouch.SetEnabled(false);
        FindNearestAngleY();

        while (true)
        {
            var condition = MathAngle.FirstAngleBiggerThenSecond(CurrentAngleY, rightAngleY - 1) &&
                            MathAngle.FirstAngleBiggerThenSecond(rightAngleY + 1, CurrentAngleY);
            if (condition)
            {
                layerTransform.eulerAngles = new Vector3(CurrentAngleX, rightAngleY, CurrentAngleZ);

                rotateController.ReshuffleAfterYRotation(prevY, rightAngleY, AngleBetweenPlatforms);
                prevY = rightAngleY;
                EasyTouch.SetEnabled(true);

                yield break;
            }
            var angle = GetAngleForYRotation();
            layerTransform.Rotate(0, angle, 0);

            yield return(new WaitForFixedUpdate());
        }
    }
    public async void ReturnEnemy(ReturnEnemySignal signal)
    {
        EasyTouch.SetEnabled(false);
        var enemy   = signal.platform.enemies[0];
        var success = LocateReturnedEnemy(enemy);

        if (!success)
        {
            signalBus.Fire <CancelOperationSignal>();
        }
        else
        {
            signalBus.Fire(new DecreaseMoneySignal {
                amount = signal.platform.Price
            });
            MakeStepAnimation(new List <Enemy>()
            {
                enemy
            }, speedForSimpleMove);
            CheckForTrigger(new List <Enemy>()
            {
                enemy
            });
            await AfterMovementOperations();
        }
        EasyTouch.SetEnabled(true);
    }
Beispiel #4
0
 public override void OnEnter()
 {
     EasyTouch.SetEnabled(mEnable.Value);
     if (!everyFrame)
     {
         Finish();
     }
 }
Beispiel #5
0
        protected override void setEnable(bool value)
        {
            base.setEnable(value);
            if (this.m_inputDispatcherGameObject != null)
            {
                if (value)
                {
                    ResetEasyTouchCameras();
                }

                EasyTouch.SetEnabled(value);
                this.m_inputDispatcherGameObject.SetActive(value);
                this.m_easyTouchComponent.enable = value;
            }
        }
    public async void NextTurn()
    {
        EasyTouch.SetEnabled(false);
        await MoveExistEnemies();
        await AfterMovementOperations();

        if (gameEnded)
        {
            return;
        }

        var newEnemies = CreateEnemies();

        await MoveNewEnemies(newEnemies);
        await AfterMovementOperations();

        EasyTouch.SetEnabled(true);
    }
Beispiel #7
0
 public override void OnEnter()
 {
     EasyTouch.SetEnabled(enable.Value);
     Finish();
 }
Beispiel #8
0
 public override void OnUpdate()
 {
     EasyTouch.SetEnabled(mEnable.Value);
 }
 public void EndGame()
 {
     EasyTouch.SetEnabled(true);
     endScreen.SetActive(true);
 }
Beispiel #10
0
 public void setEnabled(bool b)
 {
     EasyTouch.SetEnabled(b);
 }
Beispiel #11
0
 public static void SetEnabled(bool v)
 {
     EasyTouch.SetEnabled(v);
 }
Beispiel #12
0
 /// <summary>
 /// 设置触摸是否可用
 /// </summary>
 /// <param name="b"></param>
 public static void SetTouchActive(bool b)
 {
     EasyTouch.SetEnabled(b);
 }