Ejemplo n.º 1
0
    // Use this for initialization
    protected override void Start()
    {
        base.Start();

        treated  = false;
        animator = GetComponent <Animator>();
        player   = GameObject.FindObjectOfType <PlayerController>();

        pieSize *= Screen.height;

        timer = new Timer(0.8f, Finish);

        indicatorObject = Entity.Spawn(this.gameObject, indicatorObject);
        indicator       = indicatorObject.GetComponent <TimeIndicator>();
        indicator.transform.position = indicator.transform.position + new Vector3(0, 0.95f, 0);
        indicator.Receiver           = timer.GetProgress;
        //indicator.color = new Color(113f / 255f, 238f / 255f, 244f / 255f);
        indicator.color = new Color(1, 1, 1, 0.8f);

        heart = Object.Instantiate(heart,
                                   new Vector3(transform.position.x + 0.25f, transform.position.y + 0.5f, transform.position.z),
                                   new Quaternion()) as GameObject;
        heart.transform.parent = transform.parent;
        heart.GetComponent <Renderer>().sortingOrder = short.MaxValue;
        heart.SetActive(false);

        ashes          = Entity.Spawn(gameObject, ashes);
        _ashController = ashes.GetComponent <Ashes>();
        ashes.SetActive(false);
    }
Ejemplo n.º 2
0
        void Start()
        {
            _timeIndicator = GetComponent <TimeIndicator>();

            Observable.Timer(System.TimeSpan.FromSeconds(1))
            .Repeat()
            .Subscribe(_ => { _timeIndicator.SetTime(); }).AddTo(_disposables);
        }
Ejemplo n.º 3
0
    protected override void Start()
    {
        base.Start();

        timer    = new Timer(1.6f, Exit);
        animator = GetComponent <Animator>();

        GroupManager.main.group["Level Over"].Add(this, new GroupDelegator(null, LevelOver, null));
        GroupManager.main.group["Dialogue"].Add(this, new GroupDelegator(null, Interrupted, null));

        player  = GameObject.FindObjectOfType <PlayerController>();
        bubbles = GetComponentInChildren <ParticleSystem>();
        bubbles.enableEmission = false;
        bubbles.Play();
        pieSize        *= Screen.height;
        indicatorObject = Entity.Spawn(this.gameObject, indicatorObject);
        indicator       = indicatorObject.GetComponent <TimeIndicator>();
        indicator.transform.position = indicator.transform.position + new Vector3(0, 0.95f, 0);
        indicator.Receiver           = timer.GetProgress;
        indicator.color = new Color(113f / 255f, 238f / 255f, 244f / 255f, 0.8f);
    }
Ejemplo n.º 4
0
        public override void _Ready()
        {
            base._Ready();

            _camera = GetNode <Camera2D>("Camera2D");

            _reloadBar = GetNode <ReloadBar>("ReloadBar");
            _reloadBar.Connect(nameof(ReloadBar.ReloadFinished), this, nameof(OnReloadBarFinished));

            _hitBox.Connect("area_entered", this, nameof(OnHitBoxAreaEntered));

            _timeIndicator = GetNode <TimeIndicator>("TimeIndicator");

            _currentWeapon = GetNode <WeaponBase>("Weapon");

            UpdateHUD();

            AddChild(_dashTimer);

            GameManager.Instance.SceneManager.Connect(nameof(SceneManager.OnLevelChange), this, nameof(OnLevelChange));
        }