コード例 #1
0
 void Flash_Enter()
 {
     // disable movement and enable dash component
     movementStateMachine.ChangeState(MovementStates.Disabled);
     aimingStateMachine.ChangeState(AimStates.Disabled);
     flash.Begin();
 }
コード例 #2
0
ファイル: Player.cs プロジェクト: TwoScoopGames/kickbot-unity
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag == "Wall" || other.gameObject.tag == "Window")
        {
            if (onWall)
            {
                particlesDust.Play();
            }
            else
            {
                movement.velocity.x = 0;
                movement.velocity.y = 0;
                onWall        = true;
                leftJumpTime  = -1;
                rightJumpTime = -1;

                animator.SetTrigger("Land");
                particlesKick.Play();

                var wallIsOnLeft = transform.position.x < 0;
                if (wallIsOnLeft)
                {
                    var v = transform.position;
                    v.x = other.transform.position.x +
                          (other.bounds.size.x / 2f) +
                          (collider.bounds.size.x / 2f);
                    transform.position = v;

                    renderer.flipX = false;
                }
                else
                {
                    var v = transform.position;
                    v.x = other.transform.position.x -
                          (other.bounds.size.x / 2f) -
                          (collider.bounds.size.x / 2f);
                    transform.position = v;

                    renderer.flipX = true;
                }
            }
        }
        else if (other.gameObject.tag == "Hazard")
        {
            isDead = true;
            animator.SetTrigger("Explode");
            var clips = other.gameObject.GetComponent <DeathAudioClip>();
            SoundManager.instance.Play(clips.audioClips);
            particlesDeath.Play();
            particlesDeathSmoke.Play();
            flash.Begin();
        }
    }
コード例 #3
0
        private void Grid_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
        {
            if (!InEditMode)
            {
                if (Flash.GetCurrentState() != ClockState.Stopped)
                {
                    Flash.Stop();
                }

                Flash.Begin();

                CopyCode();
                NotifyCopyRequested();
            }
        }
コード例 #4
0
        private void Initialize(Account account, bool flash, MainPage mainPage)
        {
            InitializeComponent();

            this.account  = account;
            this.mainPage = mainPage;
            otp           = new OTP(account.Secret);

            DataContext = account;

            DisplayCodeFormatted();

            if (flash)
            {
                Flash.Begin();
            }
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: RonNewcomb/pieces
    static void CodeGeneration()
    {
        // create file
        CodeGen codegen = new Flash();

        codegen.Begin("complish");
        codegen.WriteStringTable(literalStrings);

        foreach (multimethod method in multimethods)
        {
            if (method.parsed_body == null || method.parsed_body.Count == 0)
            {   // it's data not code
                parameter subject = null;
                fiveforms verb    = null;
                foreach (term term in method.signature)
                {
                    if (term.which == PartsOfSpeech.verb)
                    {
                        verb = term.verb;
                        break;
                    }
                    else if (term.which == PartsOfSpeech.noun)
                    {
                        subject = term.noun;
                    }
                }
                if (verb == null)
                {
                    continue;
                }
                bool subjectNamesStruct = (verb == TheVerbIs);
                if (subjectNamesStruct && subject == null)
                {
                    continue;//compiler error? named instance? global var?
                }
                //Console.WriteLine("struct {0} {1}  // #{2}{3}", subjectNamesStruct ? subject.fullname1.Replace(' ', '_') : verb.singular + "_relation", "{", method.prompt, method.problems > 0 ? " ?" : "");
                foreach (term term in method.signature)
                {
                    if (term.which != PartsOfSpeech.noun)
                    {
                        continue;
                    }
                    if (subjectNamesStruct && term.noun == subject)
                    {
                        continue;
                    }

                    /*if (term.noun.art != Article.many)
                     *  Console.WriteLine("\t{0} {1};", NameOfType(term.noun.type), term.noun.fullname1.Replace(' ', '_'));
                     * else
                     *  Console.WriteLine("\tList<{0}> {1};", NameOfType(term.noun.type), term.noun.fullname1.Replace(' ', '_'));*/
                }
                //Console.WriteLine("}");
                //Console.WriteLine();
            }
            else // it's code not data
            {
                ;// Console.WriteLine("#{0} called from {1} places", method.prompt, method.called);
            }
        }

        codegen.WriteInt(10);
        codegen.Finish();

        Console.Write("---- press enter ----");
        Console.ReadLine();
    }