Пример #1
0
    public static void Walk(ClassHero classHero, Vector2 directions)
    {
        BehaviourPhysics.Move(classHero.gameObject, directions, classHero.speed);

        BehaviourAnimation.Flip(classHero.gameObject, directions);
        BehaviourAnimation.Play(classHero.gameObject, "Walk");
    }
Пример #2
0
    void Update()
    {
        if (hp.fillAmount <= 0)
        {
            Dictionary <string, object> d = new Dictionary <string, object>();
            d.Add("Check Point", "Lies - Tutorial");
            GameManagerGeneric.Instance.SaveInfo(d);
            SceneManager.LoadScene("Game Over");
        }

        if (blocks.transform.position.y < -100)
        {
            BehaviourPhysics.Move(blocks, Vector2.up, 0);
            Vector3 pos = blocks.transform.position;
            pos.y = -100;
            blocks.transform.position = pos;
        }
        else if (blocks.transform.position.y > 100)
        {
            BehaviourPhysics.Move(blocks, Vector2.up, 0);
            Vector3 pos = blocks.transform.position;
            pos.y = 100;
            blocks.transform.position = pos;
        }

        if (endChapter && music.time >= 100)
        {
            NextScene();
        }
    }
Пример #3
0
 private void Spin(Vector2 direction)
 {
     direction.x += direction.y;
     direction.y  = direction.x - direction.y;
     direction.x  = direction.x - direction.x;
     BehaviourPhysics.AddTorque(cubeClass.gameObject, direction, cubeClass.forceJump);
 }
Пример #4
0
    public static void Jump(ClassHero classHero)
    {
        BehaviourPhysics.Force(classHero.gameObject, Vector2.up, classHero.forceJump);

        AudioClip audio = classHero.sfx[0];

        BehaviourSound.Play(classHero.gameObject, audio);
    }
Пример #5
0
 public void Jump()
 {
     if (CanJump())
     {
         SoundManager.Instance.Play("SFX/Jump");
         BehaviourPhysics.Force(gameObject, Vector3.up, forceJump);
         onFloor = false;
     }
 }
Пример #6
0
    public static void Attack(ClassHero classHero)
    {
        //BehaviourPhysics.Force(classHero.gameObject, Vector2.right * classHero.faceRight, classHero.forceAttack);
        BehaviourPhysics.Move(classHero.gameObject, Vector2.right * classHero.faceRight, classHero.forceAttack);

        BehaviourAnimation.Play(classHero.gameObject, "Attack");

        if (!classHero.isAttack)
        {
            AudioClip audio = classHero.sfx[2];
            BehaviourSound.Play(classHero.gameObject, audio);
        }
    }
Пример #7
0
    public static void Idle(ClassHero classHero)
    {
        BehaviourPhysics.Move(classHero.gameObject, Vector2.right, 0);

        BehaviourAnimation.Play(classHero.gameObject, "Idle");
    }
Пример #8
0
 public static void Walk(ClassTrashCan dataTrashCan, int direction)
 {
     BehaviourPhysics.Turn(dataTrashCan.transform.parent.gameObject, Vector3.forward * direction, dataTrashCan.moveSpeed);
     //BehaviourAnimation.Play(dataTrashCan.gameObject, "Walk");
     //BehaviourSound.Play("Walk");
 }
Пример #9
0
 private void MoveArrows(float velocity)
 {
     velocity *= Random.Range(130f, 150f);
     BehaviourPhysics.Move(arrows, Vector2.up, velocity);
 }
Пример #10
0
 private void MoveBlocks(float velocity)
 {
     velocity *= Random.Range(50f, 60f);
     BehaviourPhysics.Move(blocks, Vector2.up, velocity);
 }
Пример #11
0
    private void CreateItem()
    {
        var item = spawer.Spawn();

        BehaviourPhysics.Move(item, Vector3.back, speed);
    }
Пример #12
0
 public static void Move(ClassKokoro classKokoro, Vector2 directions)
 {
     BehaviourPhysics.Move(classKokoro.gameObject, directions, classKokoro.speed);
 }
Пример #13
0
 public static void Idle(ClassGeneric classKokoro, Vector2 directions)
 {
     BehaviourPhysics.Move(classKokoro.gameObject, directions, 0);
 }
Пример #14
0
 public static void Idle(ClassEnemy classEnemy)
 {
     BehaviourPhysics.Move(classEnemy.gameObject, Vector2.right, 0);
 }
Пример #15
0
 public static void Spin(ClassEnemy classEnemy)
 {
     BehaviourPhysics.Torque(classEnemy.gameObject, classEnemy.speed);
 }
Пример #16
0
 public static void Walk(ClassEnemy classEnemy, Vector2 directions)
 {
     BehaviourPhysics.Move(classEnemy.gameObject, directions, classEnemy.speed);
 }