Пример #1
0
 void Start()
 {
     anim    = GetComponent <Animator>();
     plat    = GetComponent <PlatformerCollision>();
     pls     = GetComponent <PlayerSound>();
     plygrab = GetComponent <PlayerGrab>();
     FindWaters();
 }
Пример #2
0
    void Start()
    {
        audioSource         = GetComponent <AudioSource>();
        plat                = GetComponent <PlatformerCollision>();
        as_jetpackusing     = gameObject.AddComponent <AudioSource>();
        as_jetpackrefilling = gameObject.AddComponent <AudioSource>();

        as_jetpackusing.spatialBlend = 1;
        as_jetpackusing.clip         = jetpackusing;
        as_jetpackusing.loop         = true;

        as_jetpackrefilling.spatialBlend = 1;
        as_jetpackrefilling.clip         = jetpackrefilling;
        as_jetpackrefilling.loop         = true;
    }
Пример #3
0
 public void Start()
 {
     playerMovement = GetComponent <PlayerMovement>();
     plat           = GetComponent <PlatformerCollision>();
     plag           = GetComponent <PlayerGrab>();
 }
Пример #4
0
    void Start()
    {
        collisionScript = gameObject.GetComponent<PlatformerCollision>();
        animationScript = gameObject.GetComponent<AnimationManager>();

        accelerationX = MAXVELOCITY / 5;
        decelerationX = -1 * (accelerationX * 1.5f);

        accelerationY = 5;
        gravity = 1 * accelerationY;

        resetPos = gameObject.transform.position;

        width = gameObject.rigidbody2D.renderer.bounds.size.x;
        height = gameObject.rigidbody2D.renderer.bounds.size.y;

        InputManager.Instance.OnKeyLeft += OnKeyLeft;
        InputManager.Instance.OnKeyRight += OnKeyRight;
        InputManager.Instance.OnKeyJump += OnKeyJump;
        InputManager.Instance.OnKeyReset += OnKeyReset;

        InputManager.Instance.ReleaseKeyLeftRight += ReleaseKeyLeftRight;
        InputManager.Instance.ReleaseKeyJump += ReleaseKeyJump;
    }