Пример #1
0
    void Start()
    {
        audioPlayer   = AudioSourcePlayer.AddAsComponent(gameObject, audioManager);
        controller    = GetComponent <Controller2D>();
        sr            = GetComponent <SpriteRenderer>();
        animator      = GetComponent <Animator>();
        impulseSource = GetComponent <CinemachineImpulseSource>();

        gravity         = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2);
        maxJumpVelocity = Mathf.Abs(gravity) * timeToJumpApex;
        minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * minJumpHeight);
        print("Gravity: " + gravity + "  Jump Velocity: " + maxJumpVelocity);
    }
Пример #2
0
    public bool canPlay = true; // Setup board and instantiate items

    // Setup board and instantiate items
    void BoardSetup()
    {
        audioPlayer = AudioSourcePlayer.AddAsComponent(gameObject, audioManager);

        //Instantiate Board and set boardHolder to its transform.
        boardHolder = new GameObject("Board").transform;

        _items = new Item[width, height];

        //Loop along x axis.
        for (int x = 0; x < width; x++)
        {
            //Loop along y axis
            for (int y = 0; y < height; y++)
            {
                _items[x, y] = InstantiateDoddle(x, y);
            }
        }
    }
Пример #3
0
 private void Awake()
 {
     audioPlayer = AudioSourcePlayer.AddAsComponent(gameObject, audioManager);
 }
Пример #4
0
 protected override void OnAwake()
 {
     audioPlayer = AudioSourcePlayer.AddAsComponent(gameObject, audioManager);
 }
Пример #5
0
 private void Awake()
 {
     audioPlayer   = AudioSourcePlayer.AddAsComponent(gameObject, audioManager);
     dialogTrigger = gameObject.GetComponent <DialogueTrigger>();
 }