// Use this for initialization public void Starta(GameObject plane, GameObject swamps, float nodeSize) { fixedDeadCollider = false; poi = Vector3.zero; health = 100.0f; seesPlayer = false; seesDeadPeople = false; hearsSomething = false; disturbed = false; reachGoal = GetComponent <ReachGoal> (); wander = GetComponent <Wander> (); standstill = GetComponent <StandStill> (); patrol = GetComponent <Patrol> (); gc = player.GetComponent <GoalControl> (); reachGoal.plane = plane; reachGoal.swamps = swamps; reachGoal.nodeSize = nodeSize; reachGoal.goalPos = poi; reachGoal.Starta(); wander.Starta(); patrol.Starta(); standstill.Starta(); anim = GetComponent <Animation> (); anim.CrossFade(idle); walkingSpeed = 10.0f; gunShot = this.GetComponents <AudioSource> ()[0]; lr = this.GetComponentInParent <LineRenderer> (); seenTime = 0f; // Debug.Log (transform.name); }
public void Update() { HomeStackpanel.Children.Clear(); foreach (Goal goal in mainWindow.Goals) { GoalControl goalControl = new GoalControl(this, goal); HomeStackpanel.Children.Add(goalControl); } }
void Awake() { if (SceneInstance == null) { SceneInstance = this; } else { Destroy(this); } }
private void OnAddGoalClicked(object sender, RoutedEventArgs e) { string title = "Neues Ziel"; int i = 1; while (Goals.Exists(x => x.Title == title)) { title = title.Split(' ')[0] + " " + title.Split(' ')[1] + " " + (++i); } Goal goal = new Goal(title); GoalControl goalControl = new GoalControl(this, goal); HomeStackpanel.Children.Add(goalControl); Goals.Add(goal); goalControl.NameLabel.BeginEditing(); HomeScrollViewer.ScrollToBottom(); }
// Use this for initialization public void Starta(GameObject plane, GameObject swamps, float nodeSize) { fixedDeadCollider = false; poi = Vector3.zero; health = 100.0f; seesPlayer = false; seesDeadPeople = false; hearsSomething = false; disturbed = false; reachGoal = GetComponent<ReachGoal> (); wander = GetComponent<Wander> (); standstill = GetComponent<StandStill> (); patrol = GetComponent<Patrol> (); gc = player.GetComponent<GoalControl> (); reachGoal.plane = plane; reachGoal.swamps = swamps; reachGoal.nodeSize = nodeSize; reachGoal.goalPos = poi; reachGoal.Starta (); wander.Starta (); patrol.Starta (); standstill.Starta (); anim = GetComponent<Animation> (); anim.CrossFade (idle); walkingSpeed = 10.0f; gunShot = this.GetComponents<AudioSource> ()[0]; lr = this.GetComponentInParent<LineRenderer> (); seenTime = 0f; // Debug.Log (transform.name); }
// Use this for initialization public void Starta(GameObject plane, float nodeSize, Vector3 sP) { fixedDeadCollider = false; poi = Vector3.zero; health = 100.0f; seesPlayer = false; lastSeen = Vector3.zero; lastSeenForward = Vector3.zero; seesDeadPeople = false; hearsSomething = false; disturbed = false; isDead = false; addToDeadSet = false; takingCover = false; coverSpot = Vector3.zero; reachedCover = false; sniperPosKnown = false; sniperPos = sP; isGoaling = false; isGoingToSeenPlayerPos = false; isGoingToCover = false; dirSearchCountDown = 0.0f; reachGoal = GetComponent<ReachGoal> (); wander = GetComponent<Wander> (); standstill = GetComponent<StandStill> (); patrol = GetComponent<Patrol> (); gc = player.GetComponent<GoalControl> (); reachGoal.plane = plane; reachGoal.nodeSize = nodeSize; reachGoal.goalPos = poi; reachGoal.sniperPos = sniperPos; reachGoal.Starta (); wander.Starta (); patrol.Starta (); standstill.Starta (); takeCover = new TakeCover (reachGoal.state.sGrid.hiddenSpaceCost, reachGoal.state.sGrid.grid, reachGoal.state.sGrid.spaceCostScalars); anim = GetComponent<Animation> (); anim.CrossFade (idle); walkingSpeed = 10.0f; gunShot = this.GetComponents<AudioSource> ()[0]; lr = this.GetComponentInParent<LineRenderer> (); seenTime = 0f; alertLevel = 0; maxAlertLevel = 3; needsToRaiseAlertLevel = false; isReloading = false; isShooting = false; ammoCount = 0; // Debug.Log (transform.name); }