public void MakeTarget() { if (TargetPoint != null) TargetPoint.UnmakeTarget(); transform.GetComponent<Image>().overrideSprite = targeted; TargetPoint = this; }
void Start() { // reference points GameObject canvas = GameObject.Find("Canvas"); pointScript = canvas.GetComponent <PointScript>(); }
void Start() { pointScript = FindObjectOfType <PointScript>(); soundManager = FindObjectOfType <SoundManagerScript>(); menu = FindObjectOfType <InGameMenu>(); gunScript = FindObjectOfType <GunController>(); }
//Triggerにぶつかったら呼び出される //colはぶつかったものの情報 void OnTriggerEnter2D(Collider2D col) { if (GameManager.Instance.currentMode == Mode.Combat) { if (col.tag == "Goal") //Goalにぶつかったときの処理を書く { FindObject = GameObject.Find("PointObject"); PointScript poi = FindObject.GetComponent <PointScript> (); poi.RankingSort(); SceneManager.LoadScene("Game Clear"); //ゲームクリア画面に移行する } } else if (col.tag == "TreasureChest") { //宝箱にぶつかったときの処理を書く //連打モードにしたい GameManager.Instance.ChangeMode(Mode.Renda); //連打モードに移行する Instantiate(order1, new Vector2(0.3f, 4.47f), Quaternion.identity); /*if(Instantiate (order, new Vector2(5.0f,4.41f),Quaternion.identity)){ * Destroy (order.gameObject, 1.0f); * }*/ //Invoke ("orderdestroy", 1.0f); } if (col.tag == "Key") { Destroy(col.gameObject); } }
// Start is called before the first frame update void Start() { Player = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>(); PointScript = GameObject.FindGameObjectWithTag("Player").GetComponent <PointScript>(); TimerScript = GameObject.FindGameObjectWithTag("Timer").GetComponent <TimerScript>(); Destroy(gameObject, 7); }
// Update is called once per frame void Update() { FindObject = GameObject.Find("PointObject"); PointScript poi = FindObject.GetComponent <PointScript> (); RendaText.text = "Score:" + poi.Point.ToString(); //連打カウントを画面に表示する }
void Start() { m_AudioSource = GetComponent <AudioSource>(); NadeReady.SetActive(true); NadeUnready.SetActive(false); menu = FindObjectOfType <InGameMenu>(); pointScript = FindObjectOfType <PointScript>(); playercontroler = FindObjectOfType <PlayerController>(); }
void Start() { playerController = FindObjectOfType <PlayerController>(); currentHealth = startingHealth; rend = GetComponent <Renderer>(); storedColor = rend.material.GetColor("_Color"); flasher = GetComponentInChildren <DamageFlasher>(); pointScript = FindObjectOfType <PointScript>(); soundManager = FindObjectOfType <SoundManagerScript>(); }
void Start() { currentHealth = health; BodyParts.SetActive(false); EnemyModel.SetActive(true); Controller = gameObject.GetComponent <EnemyController>(); ZombieWavesController = FindObjectOfType <ZombieWaves>(); myRB = GetComponent <Rigidbody>(); pointScript = FindObjectOfType <PointScript>(); }
/*bool rendamode = false; * int count = 0;*/ // Use this for initialization void Start() { FindObject = GameObject.Find("PointObject"); PointScript poi = FindObject.GetComponent <PointScript> (); poi.Point = 0; GameManager.Instance.ChangeMode(Mode.Exploration); }
// Use this for initialization void Start() { FindObject = GameObject.Find("PointObject"); PointScript poi = FindObject.GetComponent <PointScript> (); ScoreText.text = "SCORE:" + poi.Point.ToString(); poi.RankingUIText(); }
void start() { //シーン中のScoreを取得 this.ScoreText = GameObject.Find("ScoreText"); //PointObjectを取得 GameObject.Find("PointObject").GetComponent <PointScript>(); //PointScriptを呼び出す script = GameObject.Find("PointObject").GetComponent <PointScript> (); }
void Start() { GameObject canvas = GameObject.Find("Canvas"); pointScript = canvas.GetComponent <PointScript>(); GameObject player = GameObject.Find("Player"); movement = player.GetComponent <Movement>(); enemyEx = GameObject.Find("EnemyExplosion"); }
void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(this.gameObject); //シーンが変わっても消えない } else { Destroy(this.gameObject); // 2つのGameManagerが存在しないようにする } }
void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(this.gameObject); //シーンが変わっても消えない } else { Destroy(this.gameObject); // 2つのGameManagerが存在しないようにする } PointScript poi1 = PointObject.GetComponent <PointScript> (); poi1.Point = 0; }
public int CountPoints() { int total = 0; foreach (GameObject gobj in school) { PointScript ps = gobj.GetComponent <PointScript> (); if (ps != null) { total += gobj.GetComponent <PointScript> ().fishstickValue; } else { Debug.Log("Missing pointscript"); } } return(total); }
public void Spawn(SpawnData sd, Vector3 spawnerPos) { //init variables this.transform.position = spawnerPos; //spawn fishes float multiplier = fSpawner.spawnMultiplier; int count = Mathf.RoundToInt(sd.fishAmount * multiplier); for (int i = 0; i < count; i++) { Vector3 fishPos = randomPos(); GameObject fish = (GameObject)Instantiate( sd.fishPrefab, fishPos, Quaternion.identity ); fish.transform.parent = this.transform; //set scale fish.transform.localScale *= sd.fishSize; //set random color from colors fish.GetComponentInChildren <Renderer>().material.color = sd.colors[Random.Range(0, sd.colors.Length)]; //set points of the fish PointScript ps = fish.GetComponent <PointScript>(); if (ps == null) { Debug.Log("Fish prefab does not have a point script"); return; } else { ps.fishstickValue = sd.pointsPerFish; } //add to list fishes.Add(fish); } isActive = true; }
private void Start() { player = GameObject.FindWithTag("Player"); movement = player.GetComponent <Movement>(); GameObject lava = GameObject.Find("Lava"); spawner = lava.GetComponent <RandomSpawnerScript>(); GameObject canvas = GameObject.Find("Canvas"); pointScript = canvas.GetComponent <PointScript>(); scoreEx = GameObject.Find("ScoreExplosion"); playerEx = GameObject.Find("PlayerExplosion").GetComponent <AudioSource>(); // find shader shader = GameObject.Find("Shader").GetComponent <PostProcessVolume>(); shader.profile.TryGetSettings(out chromAbe); shader.profile.TryGetSettings(out lens); }
void PointHit(GameObject point) { PointScript pointScript = point.GetComponent <PointScript>(); if (pointScript.GetBoostVal() != 0) { pointJumps.Add(pointScript.GetBoostVal()); animator.SetTrigger("Squidjump"); } collectedPoints.Add(point); controllerScript.AddPoints(pointScript.GetScoreVal(), pointScript.GetMultVal()); if (EggCount != null) // Detect if egg, shrimp or secret { if (point.transform.name.Contains("A Fishy Egg")) { EggCountScript.collectEgg(point); if (soundMan != null) { soundManScript.PlaySound("eggget", false, false, Vector3.zero, 0.3f); } } else if (point.transform.name.Contains("shrimp")) { EggCountScript.collectShrimp(point); if (soundMan != null) { soundManScript.PlaySound("shrimpget", false, false, Vector3.zero, 0.4f); } } else if (point.transform.name.Contains("Pearl")) { if (soundMan != null) { soundManScript.PlaySound("pearlget", false, false, Vector3.zero, 0.2f); } } } point.SetActive(false); }
void Start() { m_list = new List <Result>() { new Result(1, 5, "安全な家だった!"), new Result(2, 10, "おやつをたべた!"), new Result(3, 15, "ご飯をたべた!"), new Result(4, 20, "ゆっくり休憩した!"), new Result(5, 30, "空き巣を逮捕した!"), new Result(6, 50, "爆弾を解除した!"), new Result(7, 0, @"爆発してしまった… GAME OVER") }; //シーン中のScoreTextを取得 this.ScoreText = GameObject.Find("ScoreText"); //シーン中のResultTextを取得 this.ResultText = GameObject.Find("ResultText"); //PointObjectを取得 PointObject = GameObject.Find("PointObject"); //PointScriptを呼び出す script = PointObject.GetComponent <PointScript> (); }
void SpawnPipe() { float y = maxMinOffset * Mathf.Sin(Time.time); holeSize = Random.Range(minHoleSize, maxHoleSize); PipeScript newPipeUp = Instantiate(pipeUp, transform.position, Quaternion.Euler(0, 0, 180)); newPipeUp.transform.position += Vector3.up * (holeSize / 2); newPipeUp.transform.position += Vector3.up * y; newPipeUp.gameObject.SetActive(true); PipeScript newPipeDown = Instantiate(pipeDown, transform.position, Quaternion.identity); newPipeDown.transform.position += Vector3.down * (holeSize / 2); newPipeDown.transform.position += Vector3.up * y; newPipeDown.gameObject.SetActive(true); PointScript newPoint = Instantiate(point, transform.position, Quaternion.identity); newPoint.gameObject.SetActive(true); newPoint.SetSize(Camera.main.orthographicSize * 2); newPoint.transform.position += Vector3.up * y; }
//連打するとカウントが増える public void AddRendaCount() { PointScript poi = PointObject.GetComponent <PointScript> (); poi.Point++; }
//void DoSubmarineMove3() //{ //Debug.Log("Ship fired"); // bf.FillField(); // bf.CheckSubmarineVictory(); // Destroy(move.Instance.handlyDestroybleTarget.gameObject); // bf.SetTurn (false); //} PointScript AlcoholizeMove(PointScript p) { List<PointScript> points = new List<PointScript> (); for (int i = 0; i < moves.Count(); i++) for (int j = 0; j < moves.Count(); j++) { int px = p.x + moves[j]; int py = p.y + moves[i]; if (Battlefield.Instance.CheckMoveAviability(px, py)) { //PointScript pp = BattlefieldScript.Field[px,py]; //points.Add(new PointScript() { x = px, y = py }); points.Add(BattlefieldScript.Field[px,py]); } } return points [UnityEngine.Random.Range (0, points.Count)]; }