Example #1
0
    // Update is called once per frame
    void Update()
    {
        switch (ModeSelect)
        {
        case "ReStart":
            if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.RightArrow))
            {
                ModeSelect = "Title";
            }
            if (FadePanel.AlphaGet() > 1.0f)
            {
                FloorCount.ResetCount(); SceneManager.LoadScene("GameScene");
            }
            RGame.GetComponent <SelectMode>().ColorChange(ModeSelect);

            break;

        case "Title":
            if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.RightArrow))
            {
                ModeSelect = "ReStart";
            }
            if (FadePanel.AlphaGet() > 1.0f)
            {
                FloorCount.ResetCount(); SceneManager.LoadScene("TitleScene");
            }
            RTitle.GetComponent <SelectMode>().ColorChange(ModeSelect);

            break;
        }
    }
Example #2
0
    IEnumerator FadeInRoutine(FadePanel target, float duration, bool destroyOnComplete = true)
    {
        target.fadePanel.raycastTarget = true;
        Color newColor = target.fadePanel.color;

        float modifyAmount = 1;

        modifyAmount /= duration;
        modifyAmount /= 2;

        while (target.fadePanel.color.a < 1)
        {
            newColor.a            += modifyAmount * Time.deltaTime;
            target.fadePanel.color = newColor;
            yield return(null);
        }

        if (target.onFadedOut != null)
        {
            target.onFadedOut.Invoke();
        }

        if (destroyOnComplete)
        {
            Destroy(target.gameObject);
        }
    }
    public void fadeIn()
    {
        if (m_fadePanel == null)
        {
            m_fadePanel = GetComponent<Transform>().Find("FadePanel").GetComponent<FadePanel>();
        }

        m_fadePanel.fadeInOut(FadePanel.FadeEnum.FE_IN);
    }
Example #4
0
 private void Reset()
 {
     mainMenuPanel      = FindObjectOfType <MainMenuPanel>();
     gameOverPanel      = FindObjectOfType <GameOverPanel>();
     levelCompletePanel = FindObjectOfType <LevelCompletePanel>();
     fadePanel          = FindObjectOfType <FadePanel>();
     optionsPanel       = FindObjectOfType <OptionsPanel>();
     creditsPanel       = FindObjectOfType <CreditsPanel>();
 }
Example #5
0
    //
    void Awake()
    {
        _fadePanel = Instantiate(PrefFadePanel);
        _fadePanel.transform.SetParent(transform, false);

        _image = GetComponent <Image>();

        Hide();
    }
Example #6
0
    //--------------------------------------------------

    //--------------------------------------------------
    void Awake()
    //--------------------------------------------------
    {
        if (null != instance)
        {
            DestroyImmediate(this.gameObject);
        }
        instance = this;
    }
    public void Start()
    {
        fadePanel = FindObjectOfType<FadePanel>();

        if(SceneManager.GetActiveScene ().name == "00 Splash")
        {
            fadePanel.makeTransparent = true;
            StartCoroutine(Wait());
        }
    }
Example #8
0
    /// <summary>
    ///
    /// </summary>
    private void Awake()
    {
        Instance = this;
        image    = GetComponent <RawImage>();

        this.gameObject.SetActive(true);
        if (fadeInOnAwake)
        {
            FadeIn(fadeTime);
        }
    }
Example #9
0
    // Use this for initialization
    void Start()
    {
        m_FadePanelGO = Instantiate(Resources.Load("UI/FadePanel")) as GameObject;

        m_ExitBtn = Instantiate(Resources.Load("UI/ExitBtn")) as GameObject;

        m_FadePanel = m_FadePanelGO.GetComponent <FadePanel>();

        UIInit(m_FadePanelGO, this.transform);
        UIInit(m_ExitBtn, this.gameObject.transform);
    }
Example #10
0
    public void goToMenu()
    {
        if (m_fadePanel == null)
        {
            m_fadePanel = GetComponent<Transform>().Find("FadePanel").GetComponent<FadePanel>();
        }

        m_fadePanel.fadeInOut(FadePanel.FadeEnum.FE_OUT);

        Invoke("loadMenu", 1);
    }
    // Start is called before the first frame update
    void Start()
    {
        // Search for controllers:
        if (!hasSearchedForControllers && !toggleDebugMode.startInDebugMode)
        {
            hasSearchedForControllers = true;

            connectedControllers = XCI.GetNumPluggedCtrlrs();
            if (connectedControllers == 1)
            {
                Debug.Log("Only " + connectedControllers + " Xbox controller plugged in.");
                controllerFound = true;
            }
            else if (connectedControllers == 0)
            {
                Debug.Log("No Xbox controllers plugged in!");
            }
            else
            {
                Debug.Log(connectedControllers + " Xbox controllers plugged in.");
                controllerFound = true;
            }

            XCI.DEBUG_LogControllerNames();
        }

        // Adding the player containers to a list.
        for (int i = 0; i < playerContainersGroup.transform.childCount; ++i)
        {
            playerContainers.Add(playerContainersGroup.transform.GetChild(i).transform.gameObject.GetComponent <PlayerContainer>());
        }

        // Adding to the yet to bed added list
        for (int c = 1; c < connectedControllers + 1; ++c)
        {
            XboxController xboxController = ((XboxController)c);

            if (xboxController == XboxController.All)
            {
                continue;
            }

            connectedControllerList.Add(xboxController);
        }

        // Getting the fade panel.
        panel = fadePanel.GetComponent <FadePanel>();

        // Setting up the timer.
        gameStartTimer     = maxGameStartTimer;
        gameStartText.text = startingGameInText + gameStartTimer.ToString("0.00");
    }
    // Update is called once per frame
    void Update()
    {
        if (!bossComplete)
        {
            xx = transform.position.x; yy = transform.position.y; zz = transform.position.z;
            if (!init)
            {
                timerA++;
                if (timerA > 33)
                {
                    if (transform.position.y < startPos.transform.position.y)
                    {
                        transform.position = new Vector3(xx, yy + 0.1f, zz);
                    }
                    else
                    {
                        init = true; timerA = 0;
                    }
                }
            }

            if (init)
            {
                if (Input.GetMouseButton(0))
                {
                    mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
                }

                float   step      = mSpeed * Time.deltaTime;
                Vector3 targetpos = new Vector3(mousePos.x, yy, zz); xMove = targetpos.x;
                if (Vector3.Distance(transform.position, mousePos) > 0.000001f)
                {
                    transform.position = Vector2.Lerp(transform.position, targetpos, step);
                }
            }
        }

        if (bossComplete)
        {
            EndTimer++;
            this.transform.position = new Vector3(this.transform.position.x, this.transform.position.y + 0.1f, this.transform.position.z);
            if (EndTimer > 60)
            {
                FadePanel.SendMessage("FadeOut");
            }
            if (EndTimer > 190)
            {
                EndGameObject.SendMessage("EndGame");
            }
        }
    }
Example #13
0
        void Awake()
        {
            if (m_LeaderboardPanel == null)
            {
                m_LeaderboardPanel = FindObjectOfType <LeaderboardPanel>();
            }
            if (m_ConfirmLogoutPanel == null)
            {
                m_ConfirmLogoutPanel = FindObjectOfType <ConfirmLogoutPanel>();
            }

            // show login panels
            if (m_LoginSignupPanels == null)
            {
                m_LoginSignupPanels = FindObjectOfType <LoginSignUpPanels>();
            }
            if (m_LoginSignupPanels)
            {
                m_LoginSignupPanels.gameObject.SetActive(true);
            }

            if (m_InfoPanel == null)
            {
                m_InfoPanel = FindObjectOfType <InfoPanel>();
            }
            if (m_MainMenuPanel == null)
            {
                m_MainMenuPanel = FindObjectOfType <MainMenuPanel>();
            }
            if (m_FadePanel == null)
            {
                m_FadePanel = FindObjectOfType <FadePanel>();
            }
            if (m_LevelPanel == null)
            {
                m_LevelPanel = FindObjectOfType <LevelPanel>();
            }
            if (m_ShopCanvas == null)
            {
                m_ShopCanvas = FindObjectOfType <ShopCanvas>();
            }
            if (m_BoostLoading == null)
            {
                m_BoostLoading = FindObjectOfType <BoostLoading>();
            }
            if (m_ScorePanel == null)
            {
                m_ScorePanel = FindObjectOfType <ScoreMenuPanel>();
            }
        }
Example #14
0
    private IEnumerator ShopIntroSequence()
    {
        float          alpha  = 0.0f;
        SpriteRenderer render = FadePanel.GetComponent <SpriteRenderer>();

        while (alpha < 1.0f)
        {
            alpha       += 0.1f;
            render.color = new Color(0.0f, 0.0f, 0.0f, alpha);

            yield return(new WaitForSeconds(0.2f));
        }
        StartShopping();
        yield return(null);
    }
Example #15
0
    public void setActive(bool state)
    {
        Active = state;

        //makes active
        contents.SetActive(state);

        if (state)
        {
            FadePanel fade = contents.GetComponent <FadePanel>();
            if (fade != null)
            {
                fade.triggered = true;
            }
        }
    }
Example #16
0
    public IEnumerator ShopOutroSequence()
    {
        float          alpha  = 0.99f;
        SpriteRenderer render = FadePanel.GetComponent <SpriteRenderer>();

        while (alpha > 0.0f)
        {
            alpha       -= 0.1f;
            render.color = new Color(0.0f, 0.0f, 0.0f, alpha);

            yield return(new WaitForSeconds(0.2f));
        }
        render.color = new Color(0.0f, 0.0f, 0.0f, 0.0f);
        EndShopping();
        yield return(null);
    }
Example #17
0
    void LevelSection(int levelnum, int gamemode) //levelNum set from GameModeSection new in v.1.3 - 2.0
    {
        if (!clicked)
        {
            StartCoroutine(LevelLoad(5, levelnum));
            GetComponent <AudioSource>().PlayOneShot(clickSound, .5f);
            GetComponent <AudioSource>().PlayOneShot(lightWind, 3);

            if (levelnum == 1)
            {
                Scenemanager.GetComponent <SceneGM>().GameMode = gamemode; //reseting GameMode to default
                CamHolder.GetComponent <Animation>().Play("MM_Way01");     //Changed to legacy animation new in v.1.3 - 2.0
            }

            FadePanel.GetComponent <Animator>().Play("MM_FadePanelIn", -1, 0);
            //Scenemanager.GetComponent<SceneGM>().GameMode = 0; //0 for loading default game mode
            clicked = true;
        }
    }
Example #18
0
 void Update()
 {
     fp           = gOPanel.GetComponent <FadePanel>();
     checkPHealth = GameObject.FindWithTag("Player").GetComponent <Health>();
     checkEHealth = GameObject.FindWithTag("Enemy").GetComponent <Health>();
     if (checkPHealth.dead == true || checkEHealth.dead == true)
     {
         GameObject.FindWithTag("Player").GetComponent <Rigidbody2D>().constraints = RigidbodyConstraints2D.FreezeAll;
         GameObject.FindWithTag("Enemy").GetComponent <Rigidbody2D>().constraints  = RigidbodyConstraints2D.FreezeAll;
         if (checkPHealth.deathTag == "Player")
         {
             gOPanel.GetComponentInChildren <Text>().text = "Player 2";
             gOPanel.SetActive(true);
             fp.GOPanelFadeON = true;
         }
         else if (checkEHealth.deathTag == "Enemy")
         {
             gOPanel.GetComponentInChildren <Text>().text = "Player 1";
             gOPanel.SetActive(true);
             fp.GOPanelFadeON = true;
         }
     }
 }
Example #19
0
    // Use this for initialization
    void Awake()
    {
        _seAudioSource      = gameObject.AddComponent <AudioSource>();
        _seAudioSource.loop = false;

        GameObject o = Instantiate(PrefFadePanel);

        o.transform.SetParent(transform, false);
        _fadePanel = o.GetComponent <FadePanel>();

        // attach event handler
        Story.Mode storyMode = Manager.Instance.Object.StoryMode;

        storyMode.CmdAppearEvent.Attach(onCmdAppear);
        storyMode.CmdFilterEvent.Attach(onCmdFilter);
        storyMode.CmdBackgroundEvent.Attach(onCmdBackground);
        storyMode.CmdPictureEvent.Attach(onCmdPicture);
        storyMode.CmdSEEvent.Attach(onCmdSE);
        storyMode.CmdTargetAppearEvent.Attach(onCmdTargetAppear);
        storyMode.CmdDisappearEvent.Attach(onCmdDisappear);

        storyMode.ScenarioStartEvent.Attach(onScenarioStart);
        storyMode.ScenarioEndEvent.Attach(onScenarioEnd);
    }
Example #20
0
 void Start()
 {
     fade_panel_script = GetComponentInChildren <FadePanel>();
     panel_image       = fade_panel_script.gameObject.GetComponent <Image>();
     currentColor      = start_color;
 }
Example #21
0
 // Use this for initialization
 void Start()
 {
     fadePanel = FindObjectOfType<FadePanel>();
     CheckForStartSceneFlash();
 }
Example #22
0
 public void OnFadeOut()
 {
     FadePanel.FadeOut(1);
 }
Example #23
0
 public void OnFadeIn()
 {
     FadePanel.FadeIn(1);
 }
Example #24
0
 void Start()
 {
     fp = GameObject.FindObjectOfType<FadePanel>();
     rsf = GameObject.FindObjectOfType<RainSoundFade>();
     ps = GameObject.FindObjectOfType<PlayerScript>();
 }
Example #25
0
    public void Initialize()
    {
        _panels = new List <PanelBase>();

        //GameObject uiRootObj = GameObject.Instantiate(Resources.Load("UI Root")) as GameObject;

        Root = GameObject.Find("UI Root").GetComponent <UIRoot>();

        //Root.manualHeight = Screen.height;
        //Root.manualWidth = Screen.width;

        UICamera = Root.transform.Find("Camera").GetComponent <Camera>();

        if (GameManager.Inst.SceneType == SceneType.Space)
        {
            HUDPanel = UICamera.transform.Find("HUDPanel").GetComponent <HUDPanel>();
            HUDPanel.Initialize();

            _panels.Add(HUDPanel);

            KeyBindingPanel = UICamera.transform.Find("KeyBindingPanel").GetComponent <KeyBindingPanel>();
            KeyBindingPanel.Initialize();
            _panels.Add(KeyBindingPanel);

            PowerManagementPanel = UICamera.transform.Find("PowerManagement").GetComponent <PowerManagementPanel>();
            PowerManagementPanel.Initialize();
            _panels.Add(PowerManagementPanel);

            EconDebugPanel = UICamera.transform.Find("EconDebugPanel").GetComponent <EconDebugPanel>();
            EconDebugPanel.Initialize();
            _panels.Add(EconDebugPanel);
        }
        else if (GameManager.Inst.SceneType == SceneType.SpaceTest)
        {
            HUDPanel = UICamera.transform.Find("HUDPanel").GetComponent <HUDPanel>();
            HUDPanel.Initialize();


            _panels.Add(HUDPanel);
        }
        else if (GameManager.Inst.SceneType == SceneType.Station)
        {
            StationHUDPanel = UICamera.transform.Find("StationHUDPanel").GetComponent <StationHUDPanel>();
            StationHUDPanel.Initialize();
            RepairPanel = UICamera.transform.Find("RepairPanel").GetComponent <RepairPanel>();
            RepairPanel.Initialize();
            ShipInfoPanel = UICamera.transform.Find("ShipInfoPanel").GetComponent <ShipInfoPanel>();
            ShipInfoPanel.Initialize();
            TraderPanel = UICamera.transform.Find("TraderPanel").GetComponent <TraderPanel>();
            TraderPanel.Initialize();

            ErrorMessagePanel = UICamera.transform.Find("ErrorMessagePanel").GetComponent <ErrorMessagePanel>();
            ErrorMessagePanel.Initialize();

            _panels.Add(StationHUDPanel);
            _panels.Add(RepairPanel);
            _panels.Add(ShipInfoPanel);
            _panels.Add(TraderPanel);
            _panels.Add(ErrorMessagePanel);
        }

        FadePanel = UICamera.transform.Find("FadePanel").GetComponent <FadePanel>();
        FadePanel.Initialize();
        _panels.Add(FadePanel);

        UIZoom = 1;

        UIStateMachine = new UIStateMachine();
        UIStateMachine.Initialize(GameManager.Inst.SceneType);
    }
 private void Awake()
 {
     fade = this;
 }
Example #27
0
 void Start()
 {
     fadePanel = GameObject.FindGameObjectWithTag("FadePanel").GetComponent <FadePanel>();
     gm        = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster>();
 }
Example #28
0
    // Update is called once per frame
    void Update()
    {
        GoGame = gameObject.GetComponent <FadePanel>().GetAllBlack();
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Quit();
        }

        switch (ModeSelect)
        {
        case "Start":
            if (!NoMove)
            {
                GameCheck = true;
                if (Input.GetKeyDown(KeyCode.RightArrow))
                {
                    ModeSelect = "Exit";
                }
                if (Input.GetKeyDown(KeyCode.LeftArrow))
                {
                    ModeSelect = "Exit";
                }
                Mode[0].GetComponent <TextColorChange>().ColorChange(ModeSelect);
                if (Input.GetKeyDown(KeyCode.Return))
                {
                    NoMove = true;
                }
            }
            if (FadePanel.AlphaGet() > 1.0f)
            {
                SceneManager.LoadScene("GameScene");
            }
            break;

        // case "Setting":
        // if(!NoMove){
        //      GameCheck=false;
        //     if (Input.GetKeyDown(KeyCode.RightArrow)) { ModeSelect = "Exit"; }
        //     if (Input.GetKeyDown(KeyCode.LeftArrow)) { ModeSelect = "Start"; }
        //     Mode[2].GetComponent<TextColorChange>().ColorChange(ModeSelect);}
        //        if (Input.GetKeyDown(KeyCode.Return)){NoMove=true;}
        //     break;

        case "Exit":
            if (!NoMove)
            {
                GameCheck = false;
                if (Input.GetKeyDown(KeyCode.RightArrow))
                {
                    ModeSelect = "Start";
                }
                if (Input.GetKeyDown(KeyCode.LeftArrow))
                {
                    ModeSelect = "Start";
                }
                Mode[1].GetComponent <TextColorChange>().ColorChange(ModeSelect);
            }
            if (Input.GetKeyDown(KeyCode.Return))
            {
                AudioManager.Instance.PlaySE("button01b"); NoMove = true; Quit();
            }
            break;
        }
    }
    void Update()
    {
        switch (State)
        {
        case States.Intro:
            if (!StateInitiated)
            {
                Delay++;
                if (Delay > DelayBetweenActions)
                {
                    Delay          = 0;
                    StateInitiated = true;
                }
            }
            else
            if (!StateCompleted)
            {
                StateCompleted = true;
            }
            else
            {
                State          = States.PlayerTurn;
                StateCompleted = false;
                StateInitiated = false;
            }

            break;

        case States.PlayerTurn:
            if (!StateInitiated)
            {
                Delay++;
                if (Delay > DelayBetweenActions)
                {
                    Delay = 0;
                    StartPlayerTurn();
                    StateInitiated = true;
                    StateCompleted = false;
                }
            }
            else
            {
                if (StateCompleted)
                {
                    State          = States.AiTurn;
                    StateCompleted = false;
                    StateInitiated = false;
                }
            }
            break;

        case States.AiTurn:
            if (!StateInitiated)
            {
                Delay++;
                if (Delay > DelayBetweenActions)
                {
                    Delay          = 0;
                    StateInitiated = true;
                    StartEnemyTurn();
                }
            }
            else
            {
                if (StateCompleted)
                {
                    State          = States.PlayerTurn;
                    StateInitiated = false;
                    StateCompleted = false;
                }
            }
            break;

        case States.PlayerDied:
            if (!StateInitiated)
            {
                Delay++;
                if (Delay > DelayBetweenActions)
                {
                    Delay          = 0;
                    StateInitiated = true;
                    StateCompleted = false;
                }
            }
            else
            {
                if (StateCompleted)
                {
                }
            }
            break;

        case States.Victory:
            if (!StateInitiated)
            {
                Delay++;
                if (Delay > 1500)
                {
                    Delay          = 0;
                    StateInitiated = true;
                    StateCompleted = true;
                    Debug.Log("Ending Battle");
                    FadePanel.SendMessage("FadeOutNow");
                    SceneController.SendMessage("MoveToOverworld");
                }
            }
            else
            {
                if (StateCompleted)
                {
                }
            }
            break;

        case States.Escaped:
            if (!StateInitiated)
            {
                Delay++;
                if (Delay > DelayBetweenActions)
                {
                    Delay          = 0;
                    StateInitiated = true;
                    StateCompleted = false;
                }
            }
            else
            {
                if (StateCompleted)
                {
                }
            }
            break;

        default:
            break;
        }
    }
Example #30
0
 void Start()
 {
     fadePanel = GameObject.FindGameObjectWithTag("FadePanel").GetComponent <FadePanel>();
     Invoke("SetFalse", 0.5f);
 }
Example #31
0
 // Use this for initialization
 void Start()
 {
     fadePanel          = GameObject.Find("FadePanel").GetComponent <FadePanel>();
     fadePanel.IsFadeIn = true;
 }
Example #32
0
 void Awake()
 {
     singleton = this;
 }
Example #33
0
 private void Start()
 {
     darkness = GetComponent <CharacterController>().darkness;
 }
 private void Awake()
 {
     fadePanel = panel.GetComponent <FadePanel>();
 }
Example #35
0
 public void FadeToMain()
 {
     FadePanel.SetActive(true);
 }