示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        gameManager   = (GameManager)FindObjectOfType(typeof(GameManager));
        heartsManager = (HeartsManager)FindObjectOfType(typeof(HeartsManager));
        audioManager  = (AudioManager)FindObjectOfType(typeof(AudioManager));

        frontState        = new FrontState(this);
        backState         = new BackState(this);
        flippingState     = new FlippingState(this);
        backFlippingState = new BackFlippingState(this);
        hideAwayState     = new HideAwayState(this);

        actualState = backState;
    }
    void Awake()
    {
        panels = new PanelsManager(OptionPanel, MenuPanel, RuntimePanel, MessagePanel, ShadowPanel, HeartPanel, LoadPanel, OpeningPanel);
        runtime = new RuntimeManager(RuntimePanel.GetComponentsInChildren<Button>(true));
        hearts = new HeartsManager();
        load = new LoadManager(LoadPanel);
        menu = new MenuManager(MenuPanel);
        opening = new OpeningManager(OpeningPanel);

        background = gameObject.GetComponent<Image>();
    }