Пример #1
0
    //private void OnBecameVisible()
    //{
    //    //GameManager.Instance.enemyPos.Add(this.gameObject);
    //}


    // Use this for initialization
    void Start()
    {
        bossShieldSlider = PublicValueStorage.Instance.GetBossHpBar();
        //bossShieldSlider = GameObject.Find("Boss Shield").gameObject.transform.GetChild(0).gameObject.GetComponent<Slider>();

        bossShieldSlider.gameObject.SetActive(true);
        bossShieldSlider.enabled = true;

        hp = PublicValueStorage.Instance.GetBossHp();


        ColorBlock green = new ColorBlock();

        green.disabledColor     = Color.green;
        bossShieldSlider.colors = green;


        bossShieldSlider.maxValue = hp;
        bossShieldSlider.value    = bossShieldSlider.maxValue;
        SetBossHpBarColor();

        //screenHeight = 2 * Camera.main.orthographicSize;
        //screenWidth = screenHeight * Camera.main.aspect;
        Vector2 screenSize = PublicValueStorage.Instance.GetScreenSize();

        screenWidth  = screenSize.x;
        screenHeight = screenSize.y;

        bossMissileModule.SetScreenSize(screenHeight, screenWidth);
        boss.SetMethodGetDamaged(GetDamaged);
    }
    private void OnEnable()
    {
        GameManager.onDestroyAllObject += OnDestroyAllObject;
        GameManager.onPlayerDie        += OnPlayerDie;
        //GameManager.onDestroyAllEnemy += OnPlayerDie;
        //GameManager.onBossDie += OnBossDie;

        player = PublicValueStorage.Instance.GetPlayerComponent();

        // for debug
        //onBossDie += GameManager.Instance.BossDie;

        enemyState = EnemyState.Spawned;

        bezierStart = this.gameObject.transform.position;

        boss.SetMethodGetDamaged(GetDamaged);

        SoundManager.Instance.BgmSpeaker
            (SoundManager.BGM.Boss,
            SoundManager.State.Play, bgmClip);
    }