// Use this for initialization void Start() { ps = gameObject.GetComponent<PlayerStats> (); sc = gameObject.GetComponent<StateController> (); tpb = gameObject.GetComponent<TestPlayerBehaviour> (); buffSetup (); }
void Start() { _stateCont = StateController.Instance; // Set the select controller to selection initially _stateCont.ControllerState = ControllerState.Selection; // and set the select type to mob _stateCont.GetController<SelectController>().ControllerSelectType = SelectController.SelectState.Mob; for (int i = 0; i < BuildingList.Instance.buildings.Length; i++) { Transform t = Instantiate(buildingGridPrefab) as Transform; t.parent = buildingGrid.transform; t.localScale = new Vector3(1, 1, 1); t.localPosition = Vector3.zero; t.GetComponent<UILabel>().text = BuildingList.Instance.buildings[i].GetComponent<BuildingInfo>().BuildingName; Building _prefabRef = BuildingList.Instance.buildings[i]; Transform _previewRef = BuildingList.Instance.BuildingMeshPreviewPrefabs[i]; EventDelegate.Add(t.GetComponent<UIButton>().onClick, () => { _stateCont.ControllerState = ControllerState.Building; // Set the building prefab _stateCont.GetController<BuildingPlaceController>().BuildingPrefab = _prefabRef.transform; // Set the building display _stateCont.GetController<BuildingPlaceController>().BuildingPreview = _previewRef; }); } buildingGrid.Reposition(); }
void Start() { Player = GameObject.Find ("Controller"); End = GameObject.Find ("End"); state = GameObject.Find("StateController").GetComponent<StateController>(); }
// Use this for initialization void Start() { StateController stateController = new StateController(); stateController.InitializeGameState(); Debug.Log("The game state is: " + stateController.GetGameState().ToString()); }
void Start() { GameObject control = GameObject.Find ("Controller"); startPos = control.transform.position; startRot = control.transform.rotation; keyStartPos = GameObject.Find ("Key").transform.position; state = GameObject.Find("StateController").GetComponent<StateController>(); }
void Start() { state = GameObject.Find("StateController").GetComponent<StateController>(); positions = new ArrayList (); rotations = new ArrayList (); End = GameObject.Find ("End"); maxHealth = health; }
// Use this for initialization void Start() { Debug.Log("starting resume button"); state = GameObject.Find("StateController").GetComponent<StateController>(); button = transform.GetComponent<Button>(); button.onClick.AddListener(() => { state.pause();}); }
void Awake() { if (instance != null && this != instance) { Destroy(transform.gameObject); return; } DontDestroyOnLoad(transform.gameObject); instance = this; }
void OnTriggerStay(Collider coll) { IEnumerator entities = BoltNetwork.entities.GetEnumerator (); if (coll.gameObject.tag == "grass") { if (Input.GetKeyDown (tpb.tailSlapKey)) { TailSlapUsedInHidingGrass = true; } } if (coll.gameObject.tag == "player") { sc = gameObject.GetComponentInParent<StateController> (); ps = gameObject.GetComponentInParent<PlayerStats> (); if (Input.GetKeyDown (tpb.tailSlapKey) && ! sc.isStunned && sc.canMove && !sc.isChanneling && !sc.isDead) { GameObject go = GameObject.Find ("Canvas"); HUDScript hs = go.GetComponentInChildren<HUDScript> (); hs.announcementText.text = "Miss"; while (entities.MoveNext()) { if (entities.Current.GetType ().IsInstanceOfType (new BoltEntity ())) { BoltEntity be = (BoltEntity)entities.Current as BoltEntity; // Create Event and use the be, if it is the one that is colliding. if (be.gameObject == coll.gameObject) { // Check for enemy, deal full damage if (available) { Debug.Log ("SLAPPING DA TAIL"); if (coll.gameObject.GetComponent<PlayerStats> ().teamNumber != this.gameObject.GetComponentInParent<PlayerStats> ().teamNumber) { // deal full damage!!! var evnt = TailSlapEvent.Create(Bolt.GlobalTargets.Everyone); hs.announcementText.text = "" + this.gameObject.GetComponentInParent<PlayerStats>().tailSlapDamage; evnt.TargEnt = be; evnt.Damage = this.gameObject.GetComponentInParent<PlayerStats>().tailSlapDamage; evnt.Send(); } else if (!be.isOwner) { //Do nothing. } else { // check for friendly player, deal 50% dmg. // deal half damage!!! var evnt = TailSlapEvent.Create(Bolt.GlobalTargets.Everyone); hs.announcementText.text = "" + this.gameObject.GetComponentInParent<PlayerStats>().tailSlapDamage / 2; evnt.TargEnt = be; evnt.Damage = this.gameObject.GetComponentInParent<PlayerStats>().tailSlapDamage / 2; evnt.Send(); } available = false; lastUsed = Time.time; } // Debug.Log("BoltEntity.gameObject matches coll.gameObject"); } } } } } }
public MainEngine(MainSystemTray form) { //Fetch the list of commands commandList = SettingsSingleton.Instance().Commands; // Create the speech recognition engine speechRecognizer = createSpeechRecogntionEngine(form); stateController = new StateController(); //Register to the event that provides the fixations EventSingleton.Instance().fixationEvent += sharedData_fixationEvent; //Register to the event that fires when keyboard keys are pressed EventSingleton.Instance().systemHook.KeyDown += sharedData_keyboardEvent; speechRecognizer.SpeechRecognized += SpeechRecognised; }
void start() { sc = this.gameObject.GetComponentInParent<StateController> (); ps = this.gameObject.GetComponentInParent<PlayerStats> (); tpb = this.gameObject.GetComponentInParent<TestPlayerBehaviour> (); }
// Use this for initialization void Start() { sc = GameObject.Find("StateController").GetComponent<StateController>(); }
// The decide function, called on Update() (State controller - current state - transition - decision). public override bool Decide(StateController controller) { return(controller.variables.feelAlert); }
public override void Act(StateController controller) { Patrol(controller); }
private void exit(StateController controller) { controller.resetSkill(); }
private void Send(string message,StateController.State state = StateController.State.Game) { string sendedIp = _state.GetIp(state); if (sendedIp == null) throw new NullReferenceException(); _worker.SendMessage(message,sendedIp); }
public override bool Decide(StateController controller) { return(Breakfree(controller)); }
public override bool Decide(StateController controller) { bool chaseTargetIsActive = controller.chaseTarget.gameObject.activeSelf; return(chaseTargetIsActive); }
// 用于敌人 AI 在前往房子的过程中做决策 public override bool Decide(StateController controller) { bool encounter = Walk(controller); return(encounter); }
public override bool Decide(StateController controller) { bool noEnemyInSight = Search(controller); return(noEnemyInSight); }
public override bool Test(StateController p_controller) { return(p_controller.CheckCountdown(m_time)); }
public override void Act(StateController controller) { controller.boid.Flock(); }
public override void OnExit(StateController controller) { exit(controller); }
public override bool Decide(StateController controller) { return(InRangeSphere(controller)); }
void Awake() { sc = GameObject.Find("StateController").GetComponent<StateController>(); playerInfo = GameObject.Find("GameContent").GetComponent<PlayerInformation>(); }
public void Change_State(StateController <PlayerUnder> State) { UnderStateChange.Change_State(State); }
private bool Scan(StateController controller) { controller.navMeshAgent.isStopped = true; controller.transform.Rotate(0, controller.enemyStats.searchingTurnSpeed * Time.deltaTime, 0); return(controller.CheckIfCountDownElapsed(controller.enemyStats.searchDuration)); }
public override bool Decide(StateController controller) { return(CheckToyStatus(controller)); }
public AppState(Scene scene, StateController controller, Core.State state) { this.scene = scene; this.controller = controller; this.state = state; this.name = state.name; }
public void UpdateState(StateController controller) { DoActions(controller); CheckTransitions(controller); }
public override bool Test(StateController p_controller) { bool finished = p_controller.m_patrolFinished; return finished; }
float overTime = 1.2f; // 連続攻撃の受付終了時間(秒) //MonoBehaviourでのStart()メソッドと同じ //新しいステートに移り変わった時に実行 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { //プレイヤーのステートコントローラーの取得 state = GameObject.Find("Player").GetComponent <StateController>(); deltaTime = 0f; }
void Start() { ct = new Controller(); ct.EnableGesture(Gesture.GestureType.TYPESWIPE); ct.EnableGesture(Gesture.GestureType.TYPECIRCLE); ct.EnableGesture(Gesture.GestureType.TYPESCREENTAP); ct.Config.Save(); descriptions = new List<string>(new string[] { sinoDesc, discoDesc }); sc = new StateController(controlPanel, optionsPanel, successPanel, congratzPanel, soundIcon, successSound, descriptionText, previewImages, leapMotionObject, discoCamera); sc.addLabObject(sino, descriptions[0]); sc.addLabObject(discodelezenne, descriptions[1]); }
private void Chase(StateController controller) { controller._navMeshAgent.destination = controller.chaseTarget.position; controller._navMeshAgent.isStopped = false; }
void Awake() { bi = this.GetComponent<BuildingInformation>(); sc = GameObject.Find("StateController").GetComponent<StateController>(); }
public override void Act(StateController controller) { Chase(controller); }
public override bool Decide(StateController controller) { return(controller.isIdle); }
public override bool Decide(StateController controller) { bool targetVisible = Look(controller); return(targetVisible); }
void Update() { tpb = this.gameObject.GetComponentInParent<TestPlayerBehaviour> (); sc = this.gameObject.GetComponentInParent<StateController> (); if ((Time.time - lastUsed) >= gameObject.GetComponentInParent<PlayerStats> ().tailSlapCooldown) { available = true; } if (Input.GetKeyDown (tpb.tailSlapKey) && !sc.isStunned && !sc.isChanneling && !sc.isDead) { var evnt = TailAnimEvent.Create(Bolt.GlobalTargets.Everyone); evnt.TargEnt = GetComponentInParent<TestPlayerBehaviour>().entity; evnt.Send(); // GetComponentInParent<TestPlayerBehaviour> ().animation.Play ("M_TS"); } }
public abstract void OnStart(StateController controller);
// Use this for initialization void Start() { //coconut = BoltNetwork.Attach (BoltPrefabs.Coconut_1) as GameObject; //GameObject.Find ("Coconut 1(Clone)"); //coconut = GameObject.Find ("Coconut 1(Clone)"); //nut = coconut.GetComponent<Coconut> (); //Debug.Log ("Coconut: " + coconut + ", nutScript: " + nut); sc = this.gameObject.GetComponent<StateController> (); ps = this.gameObject.GetComponent<PlayerStats> (); nutId = (GameObject.FindWithTag ("nut")as GameObject).GetInstanceID (); coconut = GameObject.FindWithTag ("nut") as GameObject; }
private void Jump(StateController controller, float jumpPower) { Debug.Log("Jumping!"); controller.rb.velocity += new Vector2(10f, jumpPower); //rb.AddForce(Vector2.up * jumpPower, ForceMode2D.Impulse); }
// Use this for initialization void Start() { player = this.gameObject; timeSinceLastBoom = Time.time; wasd = gameObject.GetComponent<WASD> (); sc = gameObject.GetComponent<StateController> (); ps = gameObject.GetComponent<PlayerStats> (); sound = gameObject.GetComponent<SoundController> (); coconut = GameObject.FindGameObjectWithTag ("nut"); //ANIMATIONS animation = this.gameObject.GetComponent<Animation> (); animation.wrapMode = WrapMode.Loop; walk = animation ["M_Walk"]; death = animation ["M_Death"]; buffAnim = animation ["M_Buff"]; jump1 = animation ["M_Jump1"]; jump2 = animation ["M_Jump2"]; tail = animation ["M_TS"]; boom = animation ["M_BM"]; puke_start = animation ["M_BP_Start"]; puke_end = animation ["M_BP_End"]; fish = animation ["M_FS"]; // AnimationClip ac = animation.GetClip("M_Death"); // Debug.Log(ac.name); //animation.CrossFade("M_Death",0.25f); //idle = animation["M_Death"]; //animation.Play("M_Death"); animation ["M_Walk"].speed = 4; animation ["M_Walk"].layer = 0; animation ["M_Death"].wrapMode = WrapMode.Once; animation ["M_Death"].layer = 1; animation ["M_Jump1"].wrapMode = WrapMode.Once; animation ["M_Jump1"].speed = 2; animation ["M_Jump1"].layer = 1; animation ["M_Jump2"].wrapMode = WrapMode.Once; animation ["M_Jump2"].speed = 2; animation ["M_Jump2"].layer = 1; animation ["M_TS"].wrapMode = WrapMode.Once; animation ["M_TS"].speed = 2; animation ["M_TS"].layer = 1; animation ["M_BM"].wrapMode = WrapMode.Once; animation ["M_BM"].speed = 3; animation ["M_BM"].layer = 1; animation ["M_FS"].wrapMode = WrapMode.Once; animation ["M_FS"].speed = 1; animation ["M_FS"].layer = 1; animation ["M_BP_Start"].wrapMode = WrapMode.Once; animation ["M_BP_Start"].speed = 1; animation ["M_BP_Start"].layer = 1; animation ["M_BP_End"].wrapMode = WrapMode.Once; animation ["M_BP_End"].speed = 1; animation ["M_BP_End"].layer = 1; KeyCode[] bindings = MenuScript.KeyBindings; tailSlapKey = bindings [0]; boomNanaKey = bindings [1]; aoeKey = bindings [2]; ccKey = bindings [3]; cprKey = bindings [4]; }
// Use this for initialization void Start() { sc = game.GetComponent<StateController>(); }
public override bool Decide(StateController controller) { bool noEnemyInsight = Scan(controller); return(noEnemyInsight); }
// Use this for initialization void Start() { sc = GameObject.Find("StateController").GetComponent<StateController>(); mainBuilding = GameObject.FindGameObjectWithTag("MainBuilding"); }
public static StateController Fixture() { StateController controller = new StateController(new StateRepository(), "", new LoginView()); return controller; }
public override void Act(StateController controller) { Attack(controller); }
// Use this for initialization void Start() { bi = GetComponent<BuildingInformation>(); stateControl = GameObject.Find("StateController").GetComponent<StateController>(); }
public override void Act(StateController controller) { Dash(controller); }
public abstract void Act(StateController controller);
private void Patrol(StateController controller) { jumpTimer += Time.deltaTime; //forward raycast RaycastHit2D hit; if (controller.faceRight) { lineCastPosition = controller.transform.position + controller.transform.right * controller.width; //lineCastPosition = controller.transform.position; hit = Physics2D.Raycast(lineCastPosition, Vector2.right); //Debug.DrawRay(lineCastPosition, Vector2.right, Color.red); } else { lineCastPosition = controller.transform.position + controller.transform.right * controller.width; //lineCastPosition = controller.transform.position; hit = Physics2D.Raycast(lineCastPosition, -Vector2.right); //Debug.DrawRay(lineCastPosition, -Vector2.right, Color.red); } //checks if enemy is grounded grounded = isGrounded(lineCastPosition); //Debug.Log(grounded); //Debug.Log(controller.rb.velocity.magnitude); //Debug.Log(hit.collider.name + ", " + Mathf.Abs(Vector2.Distance(controller.transform.position, hit.collider.transform.position))); float distanceFromHit = Mathf.Abs(Vector2.Distance(controller.transform.position, hit.collider.transform.position)); if (hit.collider.tag == "Obstacle" && grounded && jumpTimer > jump && distanceFromHit < 1.5f) { jumpTimer = 0f; //Debug.Log("Raycast hit an obstacle"); Jump(controller, 6f); } else if (hit.collider.name == "TallObstacle" && grounded && jumpTimer > jump && distanceFromHit < 1.5f) { jumpTimer = 0f; Jump(controller, 10f); } else if (hit.collider.name.Contains("RightWall") && distanceFromHit < controller.distanceFromWall) { //controller.transform.localRotation = Quaternion.Euler(0, 180, 0); controller.faceRight = false; controller.Flip(controller.faceRight); } else if (hit.collider.name.Contains("LeftWall") && distanceFromHit < controller.distanceFromWall) { //controller.transform.localRotation = Quaternion.Euler(0, 0, 0); controller.faceRight = true; controller.Flip(controller.faceRight); } Move(controller); Stuck(controller); }
// Use this for initialization void Start() { sc = this.gameObject.GetComponentInParent<StateController> (); ps = this.gameObject.GetComponentInParent<PlayerStats> (); tickTimer = sc.globalCooldownTime; }
public abstract void OnExit(StateController controller);
void Attack(StateController controller) { Debug.Log("I am attacking"); }
public Player(int x) { _multiplayerController = GameObject.Find("Board").GetComponent<StateController>(); PlayerId = x; MoneyAmount = 500; }