// Use this for initialization void Start() { this.runnerRigidBody = this.GetComponent <Rigidbody>(); this.runnerGameObject = this.gameObject; this.controller = new RunnerController(this.gameObject); Debug.Log("GameObject: " + this.gameObject.name); }
void Start() { m_pInput = m_target.GetComponent <RunnerInput>(); m_runnerController = m_target.GetComponent <RunnerController>(); m_targetPos = m_target.transform.position; m_playerNum = m_runnerController.m_playerNum; }
// TODO Prompt for choosing another rabbit hole public override void effect() { Debug.Log("Rabbit Hole"); Runner runner = findRunner(); RunnerController rc = findRC(); if (runner.credits >= cost) { runner.mem++; runner.credits -= cost; } // Prompt for choice to get another bool choose = false; if (choose) { for (int i = 0; i < rc.deck.Count; i++) { if (rc.deck[i].name == "Rabbit Hole") { rc.deck[i].effect(); return; } } } else { timer(1); } // Option given to look for another rabbit hole // if yes // Remove Rabbit Hole // install cost for second rabbit hole removed // shuffle stack }
void Update() { foreach (var item in GameObject.FindGameObjectsWithTag("Runner")) { RunnerController rc = item.GetComponent <RunnerController> (); rc.maxDistance = this.maxDistance; rc.speed = this.speed_runner; rc.targetLayer = this.targetLayer; } if (spawnCounter >= spawnRate) { Spawn(); spawnCounter = 0f; } spawnCounter += Time.deltaTime; foreach (var item in GameObject.FindGameObjectsWithTag("Ways")) { if (item.transform.position.y <= destroyPosition.transform.position.y) { Destroy(item); } } if (GameObject.FindGameObjectsWithTag("Runner").Length == 0) { Clear(); Start(); } generationValue.text = generation.ToString(); fitnessValue.text = highestFitness.ToString(); }
void Start() { rotation = transform.rotation; position = transform.parent.position - transform.position; RC = GetComponentInParent <RunnerController>(); particleSystem = GetComponentInChildren <ParticleSystem>(); }
private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.CompareTag(TargetTag)) { ; } { Debug.Log(collision.gameObject); RunnerController rc = collision.gameObject.GetComponent <RunnerController>(); if (rc != null) { rc.TakeDamage(DamageValue); Vector2 direction; if (transform.position.x < rc.transform.position.x) { direction = Vector2.right + Vector2.up; } else { direction = Vector2.left + Vector2.up; } Vector2 forceVector = direction * KnockbackForce; rc.IsKnockBack(forceVector); } } }
private void Start() { player = LevelController.Instance.Player; position = new Stack <Vector3>(); rotation = new Stack <float>(); velocity = new Stack <Vector3>(); angularVelocity = new Stack <float>(); }
void Awake() { m_runnerController = GetComponent <RunnerController>(); m_runnerInput = GetComponent <RunnerInput>(); m_status = GetComponent <RunnerStatus>(); m_runnerSkill = GetComponent <RunnerSkill>(); m_animatorManeger = new AnimatorManager(GetComponentsInChildren <Animator>(true)); }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag.Equals("Runner")) { RunnerController rc = other.GetComponent <RunnerController> (); rc.Destroy(); } }
public void Start () { if ( PowerType == null ) Debug.LogError ( "PowerFactory without PowerType" ); owner = GetComponentInParent<RunnerController> (); if ( owner == null ) Debug.LogError ( "PowerFactory requires RunnerController" ); }
void SpawnRunner(int index) { GameObject go = Instantiate(runner, new Vector3(0f, -(index * 0.5f), 0f), Quaternion.Euler(0f, 0f, 0f)); RunnerController rc = go.GetComponent <RunnerController> (); rc.speed = this.speed_runner; rc.network = new NeuralNetwork(layers); rc.gameController = transform.GetComponent <GameController> (); }
private void Awake () { controller = GetComponent<RunnerController> (); powerFactory = GetComponent<PowerFactory> (); if ( controller == null ) throw new MissingReferenceException ( "A RunnerController is required" ); if ( powerFactory == null ) Debug.LogError ( "A PowerFactory is required in the runner" ); }
void Start() { m_runnerStatus = GetComponent <RunnerStatus>(); m_runnerInput = GetComponent <RunnerInput>(); m_runnerMove = GetComponent <RunnerMove>(); m_runnerController = GetComponent <RunnerController>(); m_uIController = GameObject.Find("UIController").GetComponent <UIController>();; m_runnerAnimator = GetComponent <PlayerAnimator>(); m_playerNum = m_runnerController.m_playerNum; }
void Awake() { instace = this; currentState = State.beforeRunner; arcade = MenuAlfa.instance != null ? MenuAlfa.instance.isArcade : arcade; if (MenuAlfa.instance != null) { Destroy(MenuAlfa.instance.gameObject); } }
public void Start() { if (PowerType == null) { Debug.LogError("PowerFactory without PowerType"); } owner = GetComponentInParent <RunnerController> (); if (owner == null) { Debug.LogError("PowerFactory requires RunnerController"); } }
public override void onInstall() { RunnerController rc = findRC(); rc.cursorHidden = false; var names = new List <string>(); names.Add("+ Str"); names.Add("Break Subroutine"); icePopup.SetAmounts(2, names); icePopup.buttons[0].onClick.AddListener(() => plusStr((int)icePopup.amounts[0].value)); }
private void Awake() { controller = GetComponent <RunnerController> (); powerFactory = GetComponent <PowerFactory> (); if (controller == null) { throw new MissingReferenceException("A RunnerController is required"); } if (powerFactory == null) { Debug.LogError("A PowerFactory is required in the runner"); } }
public override void Activate() { GameObject player = GameObject.FindGameObjectWithTag("Player"); if (player) { RunnerController rc = player.GetComponent <RunnerController>(); if (rc) { rc.ChangeJumpPower(_interval, _jumpPower); } } }
private void OnTriggerEnter2D(Collider2D collision) { if (disabled) { return; } if (collision.tag == "Player") { disabled = true; currentPlayer = collision.gameObject.GetComponent <RunnerController>(); TransformPlayer(); CameraController.Instance.nextState(); } }
public override void effect() { Debug.Log("Diesel: You need to figure out how to handle this."); Runner runner = findRunner(); RunnerController rc = findRC(); if (runner.credits >= cost) { runner.credits -= cost; for (int i = 0; i < 3; i++) { rc.draw(ref runner.deck); } } timer(1); }
public override bool executeSort(RunnerController player, float timeElapsed) { if (startTime.ContainsKey(player)) { startTime[player] -= timeElapsed; player.getLight().intensity = intensityLight - (intensityLight) * (totalTime - startTime[player]) / totalTime; if (startTime[player] <= 0) { player.getLight().intensity = 1; startTime.Remove(player); //print("fin sort"); return false; } } return true; }
public override bool executeSort(RunnerController player, float timeElapsed) { float degat = degatPerSec * timeElapsed; if (degat > 0) { player.removePV(degat); } if (startTime.ContainsKey(player)) { startTime[player] -= timeElapsed; if (startTime[player] <= 0) { startTime.Remove(player); return false; } } return true; }
public void Test_ExceptionOnStart() { var helper = new RunnerController(); var runner = new Mock<IRunner>(MockBehavior.Strict); runner.Setup(x => x.Run(It.IsAny<CancellationTokenSource>())).Throws(new Exception("Test_ExceptionOnStart")); helper.Run(new[] { runner.Object }); try { helper.StopAndWait(TimeSpan.FromMinutes(1)); } catch (AggregateException e) { e.InnerExceptions.Count.ShouldBeEquivalentTo(1); e.InnerException.Message.ShouldBeEquivalentTo("Test_ExceptionOnStart"); throw; } }
void OnTriggerEnter(Collider other) { if (owner == null || other.gameObject != owner.gameObject) { Debug.Log("Touched other tag " + other.tag); if (other.tag.Contains("Player")) { RunnerController runner = other.GetComponent <RunnerController> (); if (runner != null) { Strike(runner); } else { Debug.LogError("PowerController - Controller not found"); } Destroy(gameObject); } } }
public virtual void PoseObject(Vector3 pos,int runnerInd) { objectRenderer.enabled = true; effectActive = true; myCollider.gameObject.transform.position = new Vector3(pos.x, myCollider.gameObject.transform.position.y,pos.z); myCollider.gameObject.SetActive(true); if (objectRenderer != null) objectRenderer.material = normal; myCollider.enabled = true; runnerController = runnerList.getRunner(runnerInd); //pos = Vector3.right * (pos.x - runnerController.getLevel().getFloor().transform.position.x) + Vector3.up * pos.y + Vector3.forward * pos.z; if(takePlace) runnerController.getLevel().setPositionOccuped(pos,false); }
public void RemoveRunner(RunnerController runner) { m_RunnerControllers.Remove(runner); }
private void Start() { m_EnableInput = true; // get the transform of the main camera if (Camera.main != null) { m_Cam = Camera.main.transform; } else { Debug.LogWarning( "Warning: no main camera found. Third person character needs a Camera tagged \"MainCamera\", for camera-relative controls."); // we use self-relative controls in this case, which probably isn't what the user wants, but hey, we warned them! } // get the third person character ( this should never be null due to require component ) m_Character = GetComponent<ThirdPersonCharacter>(); m_Runner = GetComponent<RunnerController>(); }
public abstract bool executeSort(RunnerController player, float timeElapsed);
void Update() { if (rcReady == false) { runnerController = GameObject.FindObjectOfType <RunnerController>() as RunnerController; runner = GameObject.FindObjectOfType <Runner>() as Runner; if (runnerController != null && runner != null) { rcReady = true; //print("RCREADY!!! " + runnerController); highlightButton(buttons[active]); describe(active); } } if (rcReady && runnerController.cursorHidden) { if (Input.GetButtonDown("Jump")) { // Am I gonna have a jump??? if (rcReady) { runner.credits++; } } if (Input.GetButtonDown("Fire1") && runnerController.cursorHidden == true) { if (rcReady == false) { return; } if (runner.credits >= runnerController.hand[active].cost) { runner.credits -= runnerController.hand[active].cost; install(runnerController.hand[active], progNumb, hardNumb, resNumb); runnerController.hand.RemoveAt(active); active = 0; highlightButton(buttons[active]); describe(active); } else { // run a popup with 1 arg and name "OK" and text saying something about being too poor print("You can't afford that card right now"); } } // These are the quickbar handlers if (Input.GetAxisRaw("Mouse ScrollWheel") > 0f) { if (runnerController.hand.Count != 0) { active = (active + 1) % (runnerController.hand.Count); highlightButton(buttons[active]); describe(active); } } if (Input.GetAxisRaw("Mouse ScrollWheel") < 0f) { if (runnerController.hand.Count != 0) { if ((active - 1) < 0) { active = runnerController.hand.Count - 1; highlightButton(buttons[active]); describe(active); } else { active--; highlightButton(buttons[active]); describe(active); } } } if (Input.GetButtonDown("QuickBar 1")) { active = 0; highlightButton(buttons[active]); describe(active); } if (Input.GetButtonDown("QuickBar 2")) { active = 1; highlightButton(buttons[active]); describe(active); } if (Input.GetButtonDown("QuickBar 3")) { active = 2; highlightButton(buttons[active]); describe(active); } if (Input.GetButtonDown("QuickBar 4")) { active = 3; highlightButton(buttons[active]); describe(active); } } }
void DisableButton() { EnabledSprite.color = Color.white; isActive = false; runner = null; }
/** * Usado cuando el poder alcanza a otro jugador * */ protected override void Strike (RunnerController runner) { }
// Use this for initialization void Start() { strTitle = "CoinRunner"; string strTouchStart = "Touch To Start!"; waitTime = 5.0f; currentStageTimeoutTime = 25.0f; showResultTimer = 5.0f; runningLengthForClear = 200.0f; GUIContent content; GUIStyle styleTextCharacterName; int sw = Screen.width; int sh = Screen.height; styleTextCharacterName = skin.GetStyle ("Start_Title"); content = new GUIContent (strTitle); strTitleSize = styleTextCharacterName.CalcSize (content); // *여기서 해당 문자열이 지정된 폰트로 styleTextCharacterName = skin.GetStyle ("Start_TouchStart"); content = new GUIContent (strTouchStart); strTouchStartSize = styleTextCharacterName.CalcSize (content); // *여기서 해당 문자열이 지정된 폰트로 // set buff icon setting Buff buff; float baseX = 0.0f; buff = new Buff_SpeedBoost (); buff.iconRect = new Rect (baseX, sh - buff.IconTexture.height, buff.IconTexture.width, buff.IconTexture.height); allBuffs.Add (buff); baseX += buff.IconTexture.width + 10; buff = new Buff_HighJump (); buff.iconRect = new Rect (baseX, sh - buff.IconTexture.height, buff.IconTexture.width, buff.IconTexture.height); allBuffs.Add (buff); baseX += buff.IconTexture.width + 10; buff = new Buff_RunningSpeedUp_001 (); buff.iconRect = new Rect (baseX, sh - buff.IconTexture.height, buff.IconTexture.width, buff.IconTexture.height); allBuffs.Add (buff); baseX += buff.IconTexture.width + 10; GameObject runner = GameObject.FindWithTag ("Player"); runnerController = (RunnerController)runner.GetComponent ("RunnerController"); recordController = (RecordController)(GameObject.FindWithTag ("RecordController").GetComponent ("RecordController")); updateLevelCondition (); }
/** * Usado cuando el poder alcanza a otro jugador * */ protected abstract void Strike (RunnerController runner);
/** * Usado cuando el poder alcanza a otro jugador * */ protected abstract void Strike(RunnerController runner);
/** * Usado cuando el poder alcanza a otro jugador * */ protected override void Strike(RunnerController runner) { Debug.Log("Slugger Touched another"); runner.SlowDown(-1); }
/** * Usado cuando el poder alcanza a otro jugador * */ protected override void Strike(RunnerController runner) { }
void Start() { controller = GameObject.Find("Controller").GetComponent <RunnerController>(); player = GameObject.FindWithTag("Player").GetComponent <Transform>(); target = player.position; }
private void SyncRunnerColor( RunnerController rc ) { if (runner != null && runner == rc) { buttonColor = rc.CurrentColor; EnabledSprite.color = C.GetRealColor(buttonColor); } }
void Awake() { instance = this; startPoint = this.transform.position; }
void Update() { if (rcReady == false) { runnerController = GameObject.FindObjectOfType<RunnerController>() as RunnerController; runner = GameObject.FindObjectOfType<Runner>() as Runner; if (runnerController != null && runner != null) { rcReady = true; //print("RCREADY!!! " + runnerController); highlightButton(buttons[active]); describe (active); } } if (rcReady && runnerController.cursorHidden) { if (Input.GetButtonDown ("Jump")) { // Am I gonna have a jump??? if (rcReady) { runner.credits++; } } if (Input.GetButtonDown("Fire1") && runnerController.cursorHidden == true) { if (rcReady == false) { return; } if (runner.credits >= runnerController.hand[active].cost) { runner.credits -= runnerController.hand[active].cost; install(runnerController.hand[active], progNumb, hardNumb, resNumb); runnerController.hand.RemoveAt(active); active = 0; highlightButton(buttons[active]); describe(active); } else { // run a popup with 1 arg and name "OK" and text saying something about being too poor print("You can't afford that card right now"); } } // These are the quickbar handlers if (Input.GetAxisRaw("Mouse ScrollWheel") > 0f) { if (runnerController.hand.Count != 0) { active = (active + 1) % (runnerController.hand.Count); highlightButton(buttons[active]); describe (active); } } if (Input.GetAxisRaw("Mouse ScrollWheel") < 0f) { if (runnerController.hand.Count != 0) { if ((active - 1) < 0) { active = runnerController.hand.Count - 1; highlightButton(buttons[active]); describe (active); } else { active --; highlightButton(buttons[active]); describe (active); } } } if (Input.GetButtonDown ("QuickBar 1")) { active = 0; highlightButton(buttons[active]); describe (active); } if (Input.GetButtonDown ("QuickBar 2")) { active = 1; highlightButton(buttons[active]); describe (active); } if (Input.GetButtonDown ("QuickBar 3")) { active = 2; highlightButton(buttons[active]); describe (active); } if (Input.GetButtonDown ("QuickBar 4")) { active = 3; highlightButton(buttons[active]); describe (active); } } }
// Use this for initialization public override void OnStartLocalPlayer() { base.OnStartLocalPlayer(); if (Camera.main && Camera.main.gameObject) { Camera.main.gameObject.SetActive(false); } masterCamera.gameObject.SetActive(true); masterLigth.gameObject.SetActive(true); alignementGauche = getAlignGauche(); mana = manaOnStart; InvokeRepeating("IncomeMana", 0, 1); int i = 0; runnerView = runnerListScript.getRunner(i).getView().transform; runnerId = i; runnerController = runnerListScript.getRunner(i); floor = runnerListScript.getRunner(i).getLevel().getFloor(); masterView.localPosition = Vector3.right * floor.position.x + Vector3.up * masterView.localPosition.y + Vector3.forward * masterView.localPosition.z; masterUI.setRunnerFocused(i); }
// Use this for initialization void Start() { runnerController = runner.GetComponent<RunnerController>(); leftController = leftLane.GetComponent<LaneController>() as LaneController; middleController = middleLane.GetComponent<LaneController>() as LaneController; rightController = rightLane.GetComponent<LaneController>() as LaneController; leftController.SetUpLane(leftLane.GetComponent<Renderer>().material.GetColor("_EmissionColor"), flashingColor, cycleTime); middleController.SetUpLane(middleLane.GetComponent<Renderer>().material.GetColor("_EmissionColor"), flashingColor, cycleTime); rightController.SetUpLane(rightLane.GetComponent<Renderer>().material.GetColor("_EmissionColor"), flashingColor, cycleTime); laneColor = leftLane.GetComponent<Renderer>().material.GetColor("_EmissionColor"); runnerController.SetShotNoise(TheNoise()); }
public void changeRunnerFocused() { if(menuManager.getNumberOfPlayer()==3) { int i = runnerListScript.getRunnerIdByView(runnerView.gameObject); if (i == 0) i = 1; else i = 0; runnerView = runnerListScript.getRunner(i).getView().transform; runnerId = i; if(objectSelected!=null) { runnerController.getLevel().setAllObstacleTransparent(false); runnerController = runnerListScript.getRunner(i); runnerController.getLevel().setAllObstacleTransparent(true); } else { runnerController = runnerListScript.getRunner(i); } floor = runnerListScript.getRunner(i).getLevel().getFloor(); masterView.localPosition = Vector3.right * floor.position.x + Vector3.up* masterView.localPosition.y+Vector3.forward* masterView.localPosition.z; masterUI.setRunnerFocused(i); } }
/*Enleve le runner de la liste des runner sur lequel le sort est actif*/ public void removePlayer(RunnerController player) { if(startTime.ContainsKey(player)) startTime.Remove(player); }
private void RunnerBorrowed( RunnerController runnerController ) { borrowedPlayers.Add(runnerController); Debug.Log("borrowed "+runnerController.name); }
public void AddRunner(RunnerController runner) { m_RunnerControllers.Add(runner); }
private void RunnerDeath(RunnerController rc) { runners.Remove(rc); Debug.Log("death"+rc.name); }
private void Start() { controller = GameObject.Find("Controller").GetComponent <RunnerController>(); rigidbody = GetComponent <Rigidbody>(); }
/** * Usado cuando el poder alcanza a otro jugador * */ protected override void Strike (RunnerController runner) { Debug.Log ( "Slugger Touched another" ); runner.SlowDown ( -1 ); }
public static void RegisterRunner(RunnerController runner) { CurrentRunners++; runner.IamDead += ManDied; }
public void setRunnerController(RunnerController ctrl) { runnerController = ctrl; }
// Use this for initialization void Start() { nextStagePositionVector = new Vector3 (0, 0, 400.0f); GameObject runner = GameObject.FindWithTag ("Player"); runnerController = (RunnerController)runner.GetComponent ("RunnerController"); }