Пример #1
0
    // Use this for initialization
    void Start()
    {
        provider    = GlobalContentProvider.Instance;
        foodManager = provider.GetCurrentFoodManager();
        canvas      = this.gameObject;
        detail      = canvas.transform.Find("ScrollView_5/ScrollRect/Content");
        backBtn     = canvas.transform.Find("Title/BackBtn").GetComponent <Button>();
        backBtn.onClick.AddListener(OnBackClick);

        // Set up the Editor before calling into the realtime database.
        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://armenu-2220c.firebaseio.com/");

        //set the layout content
        DishContent _content = new DishContent(
            foodManager.GetFoodName(),
            foodManager.GetFoodImage(),
            0f,
            foodManager.GetFoodDescription(),
            null,
            foodManager.GetFoodPrice(),
            1,
            "",
            comments
            );

        setContent(_content);
    }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     //get foodManager from parent
     foodManager = transform.parent.gameObject.GetComponent <FoodTargetManager>();
     //get selected variant model
     baseFoodModel = foodManager.GetSelectedVarModel();
     CreateModel();
 }
Пример #3
0
    protected virtual void Start()
    {
        mTrackableBehaviour = GetComponent <TrackableBehaviour>();
        if (mTrackableBehaviour)
        {
            mTrackableBehaviour.RegisterTrackableEventHandler(this);
        }

        provider       = GlobalContentProvider.Instance;
        foodManager    = GetComponent <FoodTargetManager>();
        baseFoodObject = transform.Find("BaseFoodObject").gameObject;
        selectCircle   = transform.Find("SelectCircle").gameObject;
    }
Пример #4
0
    // Use this for initialization
    void Start()
    {
        provider    = GlobalContentProvider.Instance;
        foodManager = provider.GetCurrentFoodManager();
        foodKey     = foodManager.GetFoodKey();

        canvas = GameObject.Find("ReviewCanvas");
        detail = canvas.transform.Find("ScrollView_5/ScrollRect/Content");

        //get ref to comment and username input
        commentInput  = detail.Find("CommentField").GetComponent <InputField>();
        usernameInput = detail.Find("Username").GetComponent <InputField>();

        //add listener for button
        detail.Find("Submit").GetComponent <Button>().onClick.AddListener(OnSubmitClick);
        detail.Find("Share").GetComponent <Button>().onClick.AddListener(OnShareClick);

        //get ref to rating
        rating = detail.Find("Rating").Find("Score").GetComponent <Slider>();

        //get toast
        toast = detail.Find("Toast").GetComponent <Toast>();

        //get back btn
        backBtn = canvas.transform.Find("Title/BackBtn").GetComponent <Button>();
        backBtn.onClick.AddListener(OnBackClick);

        // Set up the Editor before calling into the realtime database.
        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://armenu-2220c.firebaseio.com/");

        // Get the reference for comment
        commentsRef = FirebaseDatabase.DefaultInstance
                      .GetReference("Meal/" + foodKey + "/Comments");
        // Get the reference for rating
        ratingRef = FirebaseDatabase.DefaultInstance
                    .GetReference("Meal/" + foodKey + "/Rating");

        // // Try to get the rating key
        // GlobalContentProvider.Instance.ratings.TryGetValue(foodKey, out ratingKey);
        // // if there is no rating key associated with this meal in this session -> push new one
        // if (ratingKey == "" || ratingKey == null) {
        //  currentRatingRef = ratingRef.Push();
        //  ratingKey = currentRatingRef.Key;
        //  GlobalContentProvider.Instance.ratings.Add(foodKey, ratingKey);
        // } else {
        //  currentRatingRef = ratingRef.Child(ratingKey);
        // }

        setContent();
    }
Пример #5
0
    public bool SetCurrentFoodManager(FoodTargetManager man)
    {
        if (currentFoodManager == null)
        {
            currentFoodManager = man;

            foreach (FoodManagerListener listeners in manListeners)
            {
                listeners.OnNewFoodManager();
            }

            return(true);
        }

        return(false);
    }
Пример #6
0
    public bool RemoveCurrentFoodManager(FoodTargetManager man)
    {
        if (man == currentFoodManager)
        {
            currentFoodManager = null;

            foreach (FoodManagerListener listeners in manListeners)
            {
                listeners.OnFoodManagerLost();
            }

            return(true);
        }

        return(false);
    }
Пример #7
0
    // Use this for initialization
    void Start()
    {
        // Referencing the order canvas and the current model and the input fields
        canvas            = GameObject.Find("OrderCanvas");
        foodManager       = transform.parent.GetComponent <FoodTargetManager> ();
        quantityInput     = GameObject.Find("QuantityInput").GetComponent <InputField> ();
        requirementsInput = GameObject.Find("RequirementsInput").GetComponent <InputField> ();

        // Set up the Editor before calling into the realtime database.
        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://armenu-2220c.firebaseio.com/");

        // Get the root reference location of the database.
        rootRef = FirebaseDatabase.DefaultInstance.RootReference;

        // set default to inactive
        canvas.SetActive(false);
    }
Пример #8
0
 void Start()
 {
     //get foodManager
     foodManager = transform.parent.gameObject.GetComponent <FoodTargetManager>();
     //get models
     variantModels = foodManager.GetVarModels();
     //initialize prop block
     propBlock = new MaterialPropertyBlock();
     //scaleVector to scale the models
     scaleVector = new Vector3(itemScale, itemScale, itemScale);
     //initialize clones array
     clones = new GameObject[variantModels.Length];
     //create models for first time
     CreateSmallModels();
     //get 3D text object
     variantName = transform.GetChild(0).gameObject;
     //show variant name
     ChangeVariantName(foodManager.GetSelectedVarName());
 }
Пример #9
0
    // Use this for initialization
    void Start()
    {
        provider    = GlobalContentProvider.Instance;
        foodManager = provider.GetCurrentFoodManager();

        canvas = this.gameObject;
        detail = canvas.transform.Find("ScrollView_5/ScrollRect/Content");
        //quantityInput = GameObject.Find ("Amount").GetComponent<InputField> ();
        quantityInput = detail.Find("Amount").GetComponent <InputField>();
        quantityInput.onEndEdit.AddListener(delegate { onQuantityChanged(); });
        //requirementsInput = GameObject.Find ("RequirementsInput").GetComponent<InputField> ();
        requirementsInput = detail.Find("AdditionalInfo").GetComponent <InputField>();
        //get toast
        toast = detail.Find("Toast").GetComponent <Toast>();
        //get back btn
        backBtn = canvas.transform.Find("Title/BackBtn").GetComponent <Button>();
        backBtn.onClick.AddListener(OnBackClick);
        //get confirm dialog
        confirmDialog = transform.Find("ConfirmDialog").GetComponent <ConfirmDialog>();

        // Set up the Editor before calling into the realtime database.
        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://armenu-2220c.firebaseio.com/");

        // Get the root reference location of the database.
        rootRef = FirebaseDatabase.DefaultInstance.RootReference;

        //set the layout content
        DishContent _content = new DishContent(
            foodManager.GetFoodName() + " (" + foodManager.GetSelectedVarName() + ")",
            null,
            0f,
            null,
            null,
            foodManager.GetFoodPrice(),
            1,
            "",
            null
            );

        setContent(_content);
    }