Exemple #1
0
    void Movement()
    {
        Vector3            movementPlayer;
        OffensiveBehaviour offensiveScript = GetComponent <OffensiveBehaviour>();
        RepairManBehaviour repairmanScript = GetComponent <RepairManBehaviour>();

        if (typePlayer == 0)
        {
            movementPlayer = new Vector3(Input.GetAxis("HorizontalOffensive"), Input.GetAxis("VerticalOffensive"), 0f);
            if (Input.GetAxis("HorizontalOffensive") == 0 && Input.GetAxis("VerticalOffensive") == 0)
            {
                inMovement = false;
            }
            else
            {
                inMovement = true;
            }

            anim.SetBool("up", offensiveScript.upOff);
            anim.SetBool("right", offensiveScript.rightOff);
            anim.SetBool("down", offensiveScript.downOff);
            anim.SetBool("left", offensiveScript.leftOff);
            anim.SetBool("attack", offensiveScript.isAttacking);
        }

        else
        {
            movementPlayer = new Vector3(Input.GetAxis("HorizontalRepairman"), Input.GetAxis("VerticalRepairman"), 0f);
            if (Input.GetAxis("HorizontalRepairman") == 0 && Input.GetAxis("VerticalRepairman") == 0)
            {
                inMovement = false;
            }
            else
            {
                inMovement = true;
            }

            anim.SetBool("up", repairmanScript.upRep);
            anim.SetBool("right", repairmanScript.rightRep);
            anim.SetBool("down", repairmanScript.downRep);
            anim.SetBool("left", repairmanScript.leftRep);
        }

        //use of getaxisraw? - smooth movement V
        //animation in blend tree V
        //offensive's attack it's a circular atack X -> Cone Attack V

        /*if we manage to finish the 3 phases of the tutorial:
         * create arcade mode
         * score for the arcade (saved in the game)/
         *
         * /if you complete the arcade:
         * level editor*/

        if (typePlayer == 0 && offensiveScript.isAttacking || !canWalk)
        {
        }
        else
        {
            transform.position = transform.position + movementPlayer * speed * Time.deltaTime;
        }
    }
Exemple #2
0
 void Awake()
 {
     enemyBehaviour = new OffensiveBehaviour();
     base.Init();
 }