Exemplo n.º 1
0
    //reference to a object/script with all images and answers

    // Use this for initialization
    void Start()
    {
        audioPlayer = GetComponent <AudioSource>();

        Q1.onClick.AddListener(OnClickAction1);
        Q2.onClick.AddListener(OnClickAction2);
        Q3.onClick.AddListener(OnClickAction3);
        Q4.onClick.AddListener(OnClickAction4);
        candyButton.onClick.AddListener(OnClickCandy);
        askButton.onClick.AddListener(MakeQuestionsAppear);

        GameObject g = GameObject.FindGameObjectWithTag("Scroll");

        proto = GetComponentInParent <ProtoTypeManager>();


        scrollAct = g.GetComponent <ScrollUp>();

        if (_isGod)
        {
            //set characterAmount to god characters
        }
        else
        {
            //set characterAmount to childcharacters
        }
        rnd = Random.Range(0, characterAmount);

        //get character img
        // Characterimg = characterarray [rnd]

        //get answer list
        //characterAnswers = characterAnswers Array [rnd]
        GetComponentInChildren <SpriteRenderer>().sprite = Characterimg;
    }
Exemplo n.º 2
0
    private void Update()
    {
        IsFiring  = Input.GetButton(GameConstants.Axis_Fire);
        IsVenting = Input.GetButton(GameConstants.Axis_Vent);

        var scroll = Input.GetAxis(GameConstants.Axis_Scroll);

        if (scroll > 0f)
        {
            ScrollUp.Invoke();
        }
        else if (scroll < 0f)
        {
            ScrollDown.Invoke();
        }
    }