예제 #1
0
 void Start()
 {
     _reloadInterface = FindObjectOfType <ReloadBar>();
     _granadeCount    = 3;
     _poolHolder      = new GameObject("GranedePool");
     gun = GetComponentInChildren <GunClass>();
 }
 public virtual void Start()
 {
     source        = GetComponent <AudioSource>();
     curAmmo       = ammoAmount;
     reloadBar     = this.GetComponentInParent <ReloadBar>();
     currentPlayer = this.transform.parent.parent.gameObject;
 }
예제 #3
0
 protected virtual void Start()
 {
     _rb              = GetComponent <Rigidbody2D>();
     _source          = GetComponent <AudioSource>();
     _anim            = GetComponent <Animator>();
     _gun             = GetComponentInChildren <GunClass>();
     _reloadInterface = FindObjectOfType <ReloadBar>();
 }
예제 #4
0
 virtual protected void Start()
 {
     _camera              = FindObjectOfType <Camera>();
     _reloadInterface     = FindObjectOfType <ReloadBar>();
     _sprite              = GetComponent <SpriteRenderer>();
     _playerSprite        = FindObjectOfType <PlayerClass>().GetComponent <SpriteRenderer>();
     _animator            = GetComponent <Animator>();
     _playerRb            = _playerSprite.GetComponent <Rigidbody2D>();
     _playerAnimator      = _playerSprite.GetComponent <Animator>();
     _source              = GetComponent <AudioSource>();
     _delay               = _shootDelay;
     _bulletSpawnPosition = transform.GetChild(0).transform;
     _canShoot            = true;
 }
예제 #5
0
        public CodeEditor(Form parentForm, ILogger logger)
        {
            // The InitializeComponent() call is required for Windows Forms designer support.
            InitializeComponent();

            FParentForm = parentForm;
            Logger      = logger;

            TextEditorProperties.MouseWheelTextZoom     = false;
            TextEditorProperties.LineViewerStyle        = SD.LineViewerStyle.FullRow;
            TextEditorProperties.ShowMatchingBracket    = true;
            TextEditorProperties.AutoInsertCurlyBracket = true;

            // Backup some defaults
            FDefaultFormattingStrategy = Document.FormattingStrategy;

            // Setup bars
            FSearchBar = new SearchBar(this);
            Controls.Add(FSearchBar);
            FReloadBar      = new ReloadBar(this);
            FReloadBar.Dock = DockStyle.Top;
            Controls.Add(FReloadBar);

            // Setup selection highlighting
            ActiveTextAreaControl.SelectionManager.SelectionChanged += FTextEditorControl_ActiveTextAreaControl_SelectionManager_SelectionChanged;

            ActiveTextAreaControl.TextArea.Resize += FTextEditorControl_ActiveTextAreaControl_TextArea_Resize;
            TextChanged += TextEditorControlTextChangedCB;

            // Start parsing after 500ms have passed after last key stroke.
            FTimer          = new System.Windows.Forms.Timer();
            FTimer.Interval = 500;
            FTimer.Tick    += TimerTickCB;

            // Setup actions
            var redo = editactions[Keys.Control | Keys.Y];

            editactions[Keys.Control | Keys.Shift | Keys.Z] = redo;
            editactions.Remove(Keys.Control | Keys.Y);

            var indentSelectionAction = new IndentSelectionAction();

            indentSelectionAction.Keys = new Keys[] { Keys.Control | Keys.I };
            editactions[indentSelectionAction.Keys[0]] = indentSelectionAction;
        }
예제 #6
0
파일: Player.cs 프로젝트: Trider12/Ludum48
        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));
        }
예제 #7
0
        protected override void Dispose(bool disposing)
        {
            if (!IsDisposed)
            {
                if (disposing)
                {
                    CloseCodeCompletionWindow(this, EventArgs.Empty);
                    CloseInsightWindow(this, EventArgs.Empty);

                    if (FTimer != null)
                    {
                        FTimer.Tick -= TimerTickCB;
                        FTimer.Dispose();
                        FTimer = null;
                    }

                    if (FSearchBar != null)
                    {
                        FSearchBar.Dispose();
                        FSearchBar = null;
                    }

                    if (FReloadBar != null)
                    {
                        FReloadBar.Dispose();
                        FReloadBar = null;
                    }

                    TextChanged -= TextEditorControlTextChangedCB;
                    ActiveTextAreaControl.TextArea.Resize -= FTextEditorControl_ActiveTextAreaControl_TextArea_Resize;
                    ActiveTextAreaControl.SelectionManager.SelectionChanged -= FTextEditorControl_ActiveTextAreaControl_SelectionManager_SelectionChanged;
                    TextDocument = null;
                }
            }

            base.Dispose(disposing);
        }