// Update is called once per frame void Update() { if (health.IsDead()) { ConfigurationObjectScript.getInstance().DoGameOver(); } }
private void AITick() { elapseTime = maxAIThinkTime; foreach (MyAIBehaviours behaviour in behaviours) { if (this.currentState == behaviour.myState()) { behaviour.tick(ConfigurationObjectScript.getInstance().getPlayer()); } } }
// Update is called once per frame void Update() { PlayerScript playerScript = ConfigurationObjectScript.getInstance().getPlayer(); if (Vector2.Distance(playerScript.transform.position, this.transform.position) < radiousToGive) { if (Input.GetKeyDown(PlayerController.pINTERACTKEYCODE)) { playerScript.GetComponent <Health>().increaseHealth(15); Destroy(transform.parent.gameObject); } } }
public void initializeFileTextBox() { GetComponent <PlayableDirector>().playableGraph.GetRootPlayable(0).SetSpeed(0); GetComponent <PlayableDirector>().Pause(); currentline = 0; ConfigurationObjectScript conf = ConfigurationObjectScript.getInstance(); Debug.Log("Resources/" + conf.Language + "/" + conf.LevelName + "/" + cutsceneName + "/" + conf.diagName + diagCount.ToString("00") + ".txt"); TextAsset sr = Resources.Load(conf.Language + "/" + conf.LevelName + "/" + cutsceneName + "/" + conf.diagName + diagCount.ToString("00")) as TextAsset; // Debug.Log(Encoding.ASCII.GetString(sr.bytes)); lines = Encoding.ASCII.GetString(sr.bytes).Split("\n"[0]); MyTextBox.text = lines[currentline++]; isInCutScene = true; }
// Update is called once per frame void Update() { PlayerScript playerScript = ConfigurationObjectScript.getInstance().getPlayer(); if (Vector2.Distance(playerScript.transform.position, this.transform.position) < radiousToGive && itemToGive != null) { if (Input.GetKeyDown(PlayerController.pINTERACTKEYCODE)) { itemToGive.transform.parent = playerScript.transform; itemToGive.transform.localPosition = new Vector2(-0.13f, -0.2f); itemToGive.transform.localScale = Vector3.one; playerScript.GetComponent <Fighter>().UpdateWeaponInventory(); } } }
// Start is called before the first frame update void Update() { PlayerScript playerScript = ConfigurationObjectScript.getInstance().getPlayer(); if (playerScript) { Fighter fighter = playerScript.GetComponent <Fighter>(); foreach (Weapon w in fighter.getInventoryWeapons()) { if (w is UltimateWeapon) { boostBoss(); break; } } } Destroy(this); }
// Start is called before the first frame update void Start() { string v = ConfigurationObjectScript.getInstance().getLatestYesNo(); if (v == null || v.Length <= 0) { return; } PlayerScript playerScript = ConfigurationObjectScript.getInstance().getPlayer(); if (v.Equals("Yes")) { playerScript.GetComponent <Fighter>().ClearWeaponInventory(); GameObject gambelersSword = Instantiate(gambelerSwordPrefab, transform.position, gambelerSwordPrefab.transform.rotation); } else if (v.Equals("No")) { //Do nothing } }
public void VotedNo() { ConfigurationObjectScript.getInstance().setLatestYesNo("No"); continueTimeline(); }
// Start is called before the first frame update void Start() { myimage = GetComponent <Image>(); imageOriginalColor = myimage.color; player = ConfigurationObjectScript.getInstance().getPlayer().GetComponent <Fighter>(); }
// Start is called before the first frame update void Start() { this.healthBarHeight = GetComponent <RectTransform>().sizeDelta.y; this.health = ConfigurationObjectScript.getInstance().getPlayer().GetComponent <Health>(); }