예제 #1
0
    private void Awake()
    {
        instance = this;
        GameObject gameObject = new GameObject("topBar", typeof(Image));

        gameObject.transform.SetParent(transform, false);
        gameObject.GetComponent <Image>().color = Color.black;
        topBar           = gameObject.GetComponent <RectTransform>();
        topBar.anchorMin = new Vector2(0, 1);
        topBar.anchorMax = new Vector2(1, 1);
        topBar.sizeDelta = new Vector2(0, 0);

        gameObject = new GameObject("bottomBar", typeof(Image));
        gameObject.transform.SetParent(transform, false);
        gameObject.GetComponent <Image>().color = Color.black;
        bottomBar           = gameObject.GetComponent <RectTransform>();
        bottomBar.anchorMin = new Vector2(0, 0);
        bottomBar.anchorMax = new Vector2(1, 0);
        bottomBar.sizeDelta = new Vector2(0, 0);

        CMDebug.ButtonUI(new Vector2(-200, 0), "Show", () => {
            Show(300, .3f);
        });
        CMDebug.ButtonUI(new Vector2(200, 0), "Hide", () => {
            Hide(.3f);
        });
    }
    // Start is called before the first frame update
    void Start()
    {
        levelUI = LevelUI.GetInstance();

        levelUI.AnnouncerTextLine.gameObject.SetActive(false);
        levelUI.healthSliders[0].gameObject.SetActive(false);
        levelUI.healthSliders[1].gameObject.SetActive(false);
        levelUI.LevelTimer.gameObject.SetActive(false);

        fade.SetActive(true);
        bars = GetComponentInChildren <CinematicBars>();
        bars.Show(200, 1);

        anim = GetComponent <Animator>();

        //player_1.GetComponent<StateManager>().dontMove = true;
        //player_2.GetComponent<StateManager>().dontMove = true;

        DisableFighters();


        cam        = GetComponentInChildren <Camera>();
        lm         = GetComponent <LevelManager>();
        lm.enabled = false;


        anim.SetInteger("Location", 1);
    }
예제 #3
0
    private void Start()
    {
        FunctionTimer.Create(() => { entranceDoorAnims.SetColor(DoorAnims.ColorName.Green); }, 3.0f);
        FunctionTimer.Create(() => { entranceDoorAnims.OpenDoor(); }, 3.5f);

        CinematicBars.Show_Static(150f, .01f);
        FunctionTimer.Create(() => { CinematicBars.Show_Static(0f, .5f); }, 3f);
    }
예제 #4
0
    void Start()
    {
        gameTime = GameObject.Find("GameManager").GetComponent <GameTime>();
        bars     = GameObject.Find("CinematicBars").GetComponent <CinematicBars>();

        sentences = new Queue <string>();

        isSpeaking = false;
    }
예제 #5
0
    //******************************************************************************************************************************
    //
    //      FUNCTIONS
    //
    //******************************************************************************************************************************

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    /// <summary>
    //  This is called before Startup().
    /// </summary>
    private void Awake()
    {
        // Initialize singleton
        if (Instance != null && Instance != this)
        {
            Destroy(this.gameObject);
            return;
        }
        Instance = this;
    }
예제 #6
0
    private void Start()
    {
        dialogueRunner = GetComponentInParent <DialogueRunner>();
        cinematicBars  = dialogueCanvas.GetComponent <CinematicBars>();
        yarnSetSprite  = GetComponent <YarnSetSprite>();

        dialogueRunner.AddCommandHandler("debugLog", DebugLog);
        dialogueRunner.AddCommandHandler("setSprite", SetSprite);
        dialogueRunner.AddCommandHandler("setCharactersCurrentSprite", SetCharactersCurrentSprite);
        dialogueRunner.AddCommandHandler("showCinematicBars", ShowCinematicBars);
        dialogueRunner.AddCommandHandler("hideCinematicBars", HideCinematicBars);
    }
예제 #7
0
    //--------------------------------------------------------------
    // *** CONSTRUCTORS ***

    public void Awake()
    {
        // If the singleton has already been initialized yet
        if (_pInstance != null && _pInstance != this)
        {
            Destroy(this.gameObject);
            return;
        }

        // Set singleton
        _pInstance = this;
    }
예제 #8
0
        private void OnTriggerEnter2D(Collider2D collider)
        {
            if (collider.GetComponent <PickupHealth>() != null)
            {
                // Health item!
                materialTintColor.SetTintColor(Color.green);
                healthSystem.Heal(healthSystem.GetHealthMax());
                Destroy(collider.gameObject);
            }

            if (collider.GetComponent <PickupShotgun>() != null)
            {
                // Shotgun
                materialTintColor.SetTintColor(Color.blue);
                SetCanUseShotgun();
                Destroy(collider.gameObject);
                OnPickedUpWeapon?.Invoke(Weapon.WeaponType.Shotgun, EventArgs.Empty);
            }

            if (collider.GetComponent <PickupRifle>() != null)
            {
                // Shotgun
                materialTintColor.SetTintColor(Color.blue);
                SetCanUseRifle();
                Destroy(collider.gameObject);
                OnPickedUpWeapon?.Invoke(Weapon.WeaponType.Rifle, EventArgs.Empty);
            }

            if (collider.GetComponent <Star>() != null)
            {
                // Star!
                // Game Win!
                collider.gameObject.SetActive(false);
                playerMain.PlayerSwapAimNormal.PlayWinAnimation();
                playerMain.PlayerMovementHandler.Disable();
                //transform.Find("Body").GetComponent<MeshRenderer>().material = GameAssets.i.m_PlayerWinOutline;
                healthBar.Hide();
                CameraFollow.Instance.SetCameraFollowPosition(GetPosition());
                CameraFollow.Instance.SetCameraZoom(35f);
                CinematicBars.Show_Static(150f, .6f);

                transform.Find("AimLight").gameObject.SetActive(false);
            }
        }