示例#1
0
    private void Awake()
    {
        fadePlane = GameObject.FindGameObjectWithTag("FadeScreen").GetComponent <Image>();

        scorchMark = GameObject.FindGameObjectWithTag("ScorchMark").GetComponent <SpriteRenderer>();

        resultsUI   = GameObject.FindGameObjectWithTag("Results").GetComponent <DropDownMenu>();
        endOfDayUI  = GameObject.FindGameObjectWithTag("EndOfDay").GetComponent <DropDownMenu>();
        endOfWeekUI = GameObject.FindGameObjectWithTag("EndOfWeek").GetComponent <DropDownMenu>();

        rightButton = GameObject.FindGameObjectWithTag("RightArrow").GetComponent <SlideInUI>();
        leftButton  = GameObject.FindGameObjectWithTag("LeftArrow").GetComponent <SlideInUI>();

        day = GameObject.FindGameObjectWithTag("DayManager").GetComponent <Day>();

        BarAnimation[] statBars = FindObjectsOfType <BarAnimation>();

        burnTimeBar     = statBars[0];
        turningPowerBar = statBars[1];

        jetPack = FindObjectOfType <JetPack>();
        jCamera = FindObjectOfType <JetpackCamera>();

        fadePlane.gameObject.SetActive(true);

        selectedCatagories = new bool[3];

        shop = GetComponent <Shop>();

        fireButton = GameObject.FindGameObjectWithTag("FireButton").GetComponent <SlideInUI>();

        flyHUD = GameObject.FindGameObjectWithTag("FlyHUD").GetComponent <SlideInUI>();

        destinationUI = GameObject.FindGameObjectWithTag("DestinationUI").GetComponent <SlideInUI>();

        destinationText = GameObject.FindGameObjectWithTag("DestinationUI").GetComponentInChildren <Text>();

        destinationUIDown = GameObject.FindGameObjectWithTag("DestinationUI").GetComponent <DropDownMenu>();

        Transform ComponentSelection = GameObject.FindGameObjectWithTag("ComponentSelection").transform;

        currentStats        = GameObject.FindGameObjectWithTag("CurrentStats").GetComponent <DropDownMenu>();
        componentsSelection = ComponentSelection.GetComponent <DropDownMenu>();

        componentButtons = new RectTransform[3];

        componentButtons[0] = ComponentSelection.GetChild(0).GetComponent <RectTransform>();
        componentButtons[1] = ComponentSelection.GetChild(1).GetComponent <RectTransform>();
        componentButtons[2] = ComponentSelection.GetChild(2).GetComponent <RectTransform>();

        scorchMarkStartAlpha = scorchMark.color.a;
    }
示例#2
0
    private void Awake()
    {
        //Get the shop
        shop = FindObjectOfType <Shop>();

        Jcamera = FindObjectOfType <JetpackCamera>();
        UI      = FindObjectOfType <UIManager>();

        audioSource = GetComponent <AudioSource>();
        customer    = GetComponent <Customer>();

        startPos = transform.position;
        startRot = transform.rotation;
    }