Beispiel #1
0
 void Start()
 {
     cs          = GetComponentInParent <ControlSource>();
     rb          = GetComponentInParent <Rigidbody2D>();
     attack      = GetComponent <Attack>();
     attackRange = attack.GetAttackRange();
 }
Beispiel #2
0
 protected virtual void Start()
 {
     sh   = transform.root.GetComponentInChildren <StealthHider>();
     cs   = GetComponentInParent <ControlSource>();
     move = transform.parent.GetComponentInChildren <Movement>();
     SelectFiringSound();
     energy = GetComponent <Energy>();
 }
Beispiel #3
0
 void Start()
 {
     cs = GetComponentInParent <ControlSource>();
     if (cs)
     {
         isAvatarOfLocalPlayer = cs.CheckIfAvatarOfLocalPlayer();
     }
     collider        = GetComponent <CircleCollider2D>();
     collider.radius = 0.001f;
 }
Beispiel #4
0
    protected override void OnCheckedChanged(EventArgs e)
    {
        var handler = CheckedChanged;

        if (handler != null)
        {
            handler(this, new AwareControlEventArgs(controlSource));
        }

        controlSource = ControlSource.Programatic;
    }
    int ownAllegiance; //this is fine to set because combat units don't just change allegiance...

    protected override void Start()
    {
        base.Start();
        ownAllegiance = iff.GetIFFAllegiance();
        attackRange   = attack.GetAttackRange();
        speedSetting  = 2;
        CreateNewOffset(1);
        ss              = GetComponentInChildren <StealthSeeker>();
        factionLeader   = am.factionLeaders[ownAllegiance].gameObject;
        factionLeaderCS = factionLeader.GetComponent <ControlSource>();
    }
Beispiel #6
0
    // Start is called before the first frame update
    void Start()
    {
        srs = transform.root.GetComponentsInChildren <SpriteRenderer>();

        rb               = transform.root.GetComponentInChildren <Rigidbody2D>();
        hiderColl        = GetComponent <CircleCollider2D>();
        hiderColl.radius = hiderRadius_Base;
        cs               = transform.root.GetComponentInChildren <ControlSource>();
        iff              = transform.root.GetComponentInChildren <IFF>();
        am               = FindObjectOfType <AllegianceManager>();
        FadeOrTurnInvisible();
    }
Beispiel #7
0
 // Update is called once per frame
 protected virtual void Update()
 {
     if (!cs)
     {
         cs = GetComponent <ControlSource>();
     }
     if (!rb)
     {
         rb = GetComponent <Rigidbody2D>();
     }
     if (cs.IsRunningOnServer)
     {
         CheckForCommandedMovement();
     }
 }
 public void setPlayer(int i, XKeyboard keyboard)
 {
     inGame           = false;
     readied          = false;
     this.keyboard    = keyboard;
     controlSource    = ControlSource.keyboard;
     connected        = true;
     name             = NameTextBox.Text;
     score            = 0;
     canAnswer        = false;
     lastAnswerResult = AnswerResult.no_answer;
     player           = i;
     setColor();
     readiedSound = new MediaPlayer();
 }
 public void setPlayer(int i, XInputController controller)
 {
     inGame           = false;
     readied          = false;
     this.controller  = controller;
     controlSource    = ControlSource.controller;
     connected        = controller.connected;
     name             = NameTextBox.Text;
     score            = 0;
     canAnswer        = false;
     lastAnswerResult = AnswerResult.no_answer;
     player           = i;
     setColor();
     readiedSound = new MediaPlayer();
 }
Beispiel #10
0
 private void SelectionChangedJaco(string Mode)
 {
     System.Diagnostics.Debug.WriteLine("Jaco arm " + Mode);
     ControlSource.Options      = ControlSource.setOptions(Mode);
     ControlOptions.ItemsSource = null;
     ControlOptions.ItemsSource = ControlSource.Options;
     //foreach (ControlOption option in ControlOptions.ItemsSource)
     //{
     //    System.Diagnostics.Debug.WriteLine(option.buttonVisible[0]);
     //    System.Diagnostics.Debug.WriteLine(option.name);
     //    System.Diagnostics.Debug.WriteLine(option.imageName);
     //    System.Diagnostics.Debug.WriteLine(option.buttonImages);
     //}
     ControlSource.updateUris();
 }
Beispiel #11
0
    // Start is called before the first frame update
    void Start()
    {
        srs              = transform.root.GetComponentsInChildren <SpriteRenderer>();
        rb               = transform.root.GetComponentInChildren <Rigidbody2D>();
        hiderColl        = GetComponent <CircleCollider2D>();
        hiderColl.radius = hiderRadius_Base;
        cs               = transform.root.GetComponentInChildren <ControlSource>();
        //iff = transform.root.GetComponentInChildren<IFF>();
        //am = FindObjectOfType<AllegianceManager>();
        if (!isBuilding)
        {
            isAvatarOfLocalPlayer = cs.CheckIfAvatarOfLocalPlayer();
        }

        if (!isAvatarOfLocalPlayer)
        {
            FadeOrTurnInvisible();
        }
    }
Beispiel #12
0
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = PropMask?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (Name?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Tag?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ Id;
         hashCode = (hashCode * 397) ^ HelpContextId;
         hashCode = (hashCode * 397) ^ (int)BitFlags;
         hashCode = (hashCode * 397) ^ (int)ObjectStreamSize;
         hashCode = (hashCode * 397) ^ TabIndex.GetHashCode();
         hashCode = (hashCode * 397) ^ ClsidCacheIndex.GetHashCode();
         hashCode = (hashCode * 397) ^ GroupId.GetHashCode();
         hashCode = (hashCode * 397) ^ (ControlTipText?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (RuntimeLicKey?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (ControlSource?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (RowSource?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (SitePosition?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
Beispiel #13
0
 public AwareControlEventArgs(ControlSource s)
 {
     Source = s;
 }
Beispiel #14
0
 void AwareCheckbox_MouseDown(object sender, MouseEventArgs e)
 {
     controlSource = ControlSource.ByMouse;
 }
Beispiel #15
0
 void AwareCheckbox_KeyDown(object sender, KeyEventArgs e)
 {
     controlSource = ControlSource.ByKeyboard;
 }
Beispiel #16
0
 protected virtual void Start()
 {
     cs     = GetComponentInParent <ControlSource>();
     attack = transform.parent.GetComponentInChildren <Attack>();
     rb     = GetComponentInParent <Rigidbody2D>();
 }
Beispiel #17
0
 void Start()
 {
     cs = GetComponent <ControlSource>();
 }
Beispiel #18
0
 protected virtual void Start()
 {
     cs = GetComponent <ControlSource>();
     rb = GetComponent <Rigidbody2D>();
 }
Beispiel #19
0
 protected virtual void Start()
 {
     cs = GetComponentInParent <ControlSource>();
 }