コード例 #1
1
ファイル: PointScript.cs プロジェクト: vit2005/seaBattletest1
    public void MakeTarget()
    {
        if (TargetPoint != null)
            TargetPoint.UnmakeTarget();

        transform.GetComponent<Image>().overrideSprite = targeted;

        TargetPoint = this;
    }
コード例 #2
0
    void Start()
    {
        // reference points
        GameObject canvas = GameObject.Find("Canvas");

        pointScript = canvas.GetComponent <PointScript>();
    }
コード例 #3
0
 void Start()
 {
     pointScript  = FindObjectOfType <PointScript>();
     soundManager = FindObjectOfType <SoundManagerScript>();
     menu         = FindObjectOfType <InGameMenu>();
     gunScript    = FindObjectOfType <GunController>();
 }
コード例 #4
0
    //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);
        }
    }
コード例 #5
0
    // 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);
    }
コード例 #6
0
    // Update is called once per frame
    void Update()
    {
        FindObject = GameObject.Find("PointObject");

        PointScript poi = FindObject.GetComponent <PointScript> ();

        RendaText.text = "Score:" + poi.Point.ToString();          //連打カウントを画面に表示する
    }
コード例 #7
0
 void Start()
 {
     m_AudioSource = GetComponent <AudioSource>();
     NadeReady.SetActive(true);
     NadeUnready.SetActive(false);
     menu            = FindObjectOfType <InGameMenu>();
     pointScript     = FindObjectOfType <PointScript>();
     playercontroler = FindObjectOfType <PlayerController>();
 }
コード例 #8
0
 void Start()
 {
     playerController = FindObjectOfType <PlayerController>();
     currentHealth    = startingHealth;
     rend             = GetComponent <Renderer>();
     storedColor      = rend.material.GetColor("_Color");
     flasher          = GetComponentInChildren <DamageFlasher>();
     pointScript      = FindObjectOfType <PointScript>();
     soundManager     = FindObjectOfType <SoundManagerScript>();
 }
コード例 #9
0
 void Start()
 {
     currentHealth = health;
     BodyParts.SetActive(false);
     EnemyModel.SetActive(true);
     Controller            = gameObject.GetComponent <EnemyController>();
     ZombieWavesController = FindObjectOfType <ZombieWaves>();
     myRB        = GetComponent <Rigidbody>();
     pointScript = FindObjectOfType <PointScript>();
 }
コード例 #10
0
    /*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);
    }
コード例 #11
0
    // Use this for initialization
    void Start()
    {
        FindObject = GameObject.Find("PointObject");

        PointScript poi = FindObject.GetComponent <PointScript> ();

        ScoreText.text = "SCORE:" + poi.Point.ToString();

        poi.RankingUIText();
    }
コード例 #12
0
    void start()
    {
        //シーン中のScoreを取得
        this.ScoreText = GameObject.Find("ScoreText");


        //PointObjectを取得
        GameObject.Find("PointObject").GetComponent <PointScript>();
        //PointScriptを呼び出す
        script = GameObject.Find("PointObject").GetComponent <PointScript> ();
    }
コード例 #13
0
ファイル: CollisionEnemy.cs プロジェクト: alexsikorski/bounce
    void Start()
    {
        GameObject canvas = GameObject.Find("Canvas");

        pointScript = canvas.GetComponent <PointScript>();

        GameObject player = GameObject.Find("Player");

        movement = player.GetComponent <Movement>();

        enemyEx = GameObject.Find("EnemyExplosion");
    }
コード例 #14
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(this.gameObject);
         //シーンが変わっても消えない
     }
     else
     {
         Destroy(this.gameObject);
         // 2つのGameManagerが存在しないようにする
     }
 }
コード例 #15
0
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(this.gameObject);
            //シーンが変わっても消えない
        }
        else
        {
            Destroy(this.gameObject);
            // 2つのGameManagerが存在しないようにする
        }

        PointScript poi1 = PointObject.GetComponent <PointScript> ();

        poi1.Point = 0;
    }
コード例 #16
0
ファイル: BoidController.cs プロジェクト: JipBoesenkool/GPT3
    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);
    }
コード例 #17
0
ファイル: FlockManager.cs プロジェクト: JipBoesenkool/GPT3
    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;
    }
コード例 #18
0
ファイル: SquareColl.cs プロジェクト: alexsikorski/bounce
    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);
    }
コード例 #19
0
ファイル: Player.cs プロジェクト: NikShaw/Octocation
    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);
    }
コード例 #20
0
    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> ();
    }
コード例 #21
0
    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;
    }
コード例 #22
0
    //連打するとカウントが増える
    public void AddRendaCount()
    {
        PointScript poi = PointObject.GetComponent <PointScript> ();

        poi.Point++;
    }
コード例 #23
0
ファイル: Mission11.cs プロジェクト: vit2005/seaBattletest1
	//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)];
	}