Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

How to make it configurable that specify function x to execute before function y?

Discussion in 'Scripting' started by Ideography, Jun 19, 2018.

  1. Ideography

    Ideography

    Joined:
    Nov 16, 2015
    Posts:
    1
    I'm trying to make a general configurable promotion manager.
    Here are some technical challenges I met.

    i. I'd like to configure the opportunities that the promotion to show. For example, while after a level.
    ii. How to setup different opportunities after load another scene? The PromotionManager is a DontDestroyOnLoad singleton, I may have Button[] and Opportunity[] that configurable can show the promotions, but how can I make the last level's configuration cleared and setup for the new level after switch to another level?

    Thanks!
     
  2. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
    I'm afraid the details of the requirement are far from adequate. :) Here are some points you might like to consider to expand upon it :-
    1. What is a "promotion" (for example, is it an enum, a string, a class or something else entirely)?
    2. What do you mean by "level"- are you referring to Unity scenes?
    3. What is an "opportunity"?
    4. You want to link a UI button to an "opportunity" but be able to have some criteria as to whether a prticular button/ opportunity is shown/ enabled. Is that right?
    5. Maybe consider providing a Use Case- a simple logical walkthrough of an expected typical scenario.