Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     characterController = GetComponent <CharacterController>();
     Barrel    = transform.Find("Barrel Rotation Point").gameObject;
     canvas    = GameObject.Find("Result");
     resScript = canvas.GetComponent <ResultScript>();
     //  explosion = Resources.Load<ParticleSystem>("Assets/Prefab/Explosion.prefab");
 }
 void Start()
 {
     base.rigid2D        = GetComponent <Rigidbody2D>();
     ob                  = GameObject.Find("GameDirector");
     ResultManager       = GameObject.Find("ResultManager");
     ResultManagerScript = ResultManager.GetComponent <ResultScript>();
     Effect              = GetComponent <EffectCreaterScript>();
     //base.PlayerSpeed = 200.0f;//仮のプレイヤースピード(一定)
     base.SetPlayerSpeed(Speed);
     base.ExplosionPower = 0.5f;//初期爆発力
 }
Example #3
0
    void Start()
    {
        // Assign the editor values to the static variables
        flags       = objs;
        goalObjs    = goals;
        resText     = resultText;
        timeMin     = gameTime;
        respawnTime = resTime;

        // Begin the game
        Begin();
    }
 void Start()
 {
     g_trouble_Script     = GameObject.Find("TroubleObj").GetComponent <TroubleScr>();
     g_result_Script      = GameObject.Find("Stageinformation").GetComponent <ResultScript>();
     g_clear_Script       = GameObject.Find("Game_Controller").GetComponent <Stage_Clear>();
     g_folder_Script      = GameObject.Find("Stageinformation").GetComponent <Folder_Script>();
     g_information_Script = GameObject.Find("Stageinformation").GetComponent <StageInformation>();
     g_game_con_Script    = GameObject.Find("Game_Controller").GetComponent <Game_Controller>();
     g_player_Script      = GameObject.Find("Player_Controller").GetComponent <Playercontroller>();
     g_player_anim_Script = this.GetComponent <Player_Animation>();
     g_player_obj         = this.gameObject;
 }
Example #5
0
 private void Start()
 {
     g_resultScript           = GameObject.Find("Stageinformation").GetComponent <ResultScript>();
     g_highScoreText          = GameObject.Find("high_move_para");
     g_scoreJsonScript        = GameObject.Find("ScoreInformation").GetComponent <ScoreJsonScript>();
     g_stageInformationScript = GameObject.Find("Stageinformation").GetComponent <StageInformation>();
     //前の残りて数が現在の残りて数よりも少なかった場合
     if (g_scoreJsonScript.g_stageScore.g_stageInfo[g_stageInformationScript.Get_StageNum()].g_trouble < g_resultScript.GetRemaining())
     {
         //ハイスコアを変更させる
         g_highScoreText.GetComponent <TextMeshProUGUI>().text = g_resultScript.GetRemaining().ToString();
     }
 }
Example #6
0
 void Start()
 {
     #region スクリプトの取得
     g_resultScript           = GameObject.Find(g_stageInfoName).GetComponent <ResultScript>();
     g_jsonArrayScript        = GameObject.Find(g_stageInfoName).GetComponent <JsonArray>();
     g_stageInformationScript = GameObject.Find(g_stageInfoName).GetComponent <StageInformation>();
     g_scoreJsonScript        = GameObject.Find("ScoreInformation").GetComponent <ScoreJsonScript>();
     #endregion
     if (g_scoreJsonScript.g_stageScore.g_stageInfo[g_stageInformationScript.Get_StageNum()].g_evaluation < g_resultScript.Trouble())
     {
         //jsonに数値を入れる
         g_scoreJsonScript.ChangeInfo(g_stageInformationScript.Get_StageNum(), g_resultScript.Trouble(), g_resultScript.GetRemaining());
     }
 }
Example #7
0
File: CTFSim.cs Project: RSK11/ctf
 public void UnloadMap()
 {
     loaded = false;
     over   = false;
     paused = false;
     goals  = null;
     rs.EndResult();
     rs = null;
     if (hum)
     {
         nnbrain = players[0].GetComponent <Human>().GenSets(10000);
     }
     scores.Clear();
     players.Clear();
     time      = 0f;
     resetTime = 0f;
     StartCoroutine(LoadScene("Maps/Menu/Menu"));
 }
Example #8
0
    // Use this for initialization
    void Start()
    {
        A         = 0.0f;                // 加速度
        posY      = 0.0f;                // Y座標
        JUMPPOWER = 0.98f * 6.0f / 8.0f; // 加速度
        G         = 0.98f / 12.0f;       // 重力

        B = 0.0f;

        i = 0;

        collider2D        = GetComponent <Collider2D>();
        animator          = GetComponent <Animator>();
        cherryCountScript = GameObject.Find("CherryCount").GetComponent <CherryCountScript>();
        timeScript        = GameObject.Find("TimeCount").GetComponent <TimeScript>();
        mainCamera        = GameObject.FindWithTag("MainCamera");
        resultScript      = GameObject.Find("Text").GetComponent <ResultScript>();

        animator.SetBool("idle", true);
        animator.SetBool("run", false);

        this.rigidbody2D = GetComponent <Rigidbody2D>();
        A = JUMPPOWER;
    }
Example #9
0
    // Use this for initialization
    void Start () {
        _instance = this;
        transform.FindChild("ok_btn").GetComponent<Button>().onClick.AddListener(Close);
		transform.FindChild("login_btn").GetComponent<Button>().onClick.AddListener(Login);
    }
Example #10
0
 private void Start()
 {
     g_resultScript = GameObject.Find("Stageinformation").GetComponent <ResultScript>();
     GameObject.Find("Fade_Image").GetComponent <Fade_In_Out>().GameStart_Fade_In();
     CreateObj();
 }
Example #11
0
 // Start is called before the first frame update
 void Start()
 {
     canvas    = GameObject.Find("Result");
     resScript = canvas.GetComponent <ResultScript>();
 }
Example #12
0
File: CTFSim.cs Project: RSK11/ctf
    public void LoadMap(Map map)
    {
        goals = map.goals;
        scores.Add(0);
        scores.Add(0);
        int i = 0;

        if (hum)
        {
            Vector3 offset    = new Vector3(Mathf.Cos(0f), 0f, Mathf.Sin(0f)) * spawnRadius;
            Human   newPlayer = Instantiate <Human>(humanPrefab, goals[0].transform.position + offset, Quaternion.identity);
            if (nnbrain != null)
            {
                newPlayer.InitBrain(0, blueMaterial, this, nnbrain);
            }
            else
            {
                newPlayer.Init(0, blueMaterial, this);
            }
            ThrdCam tcam = Camera.main.gameObject.AddComponent <ThrdCam>();
            tcam.target = newPlayer.body;
            tcam.transform.SetParent(newPlayer.transform);
            newPlayer.SetCam(tcam);
            players.Add(newPlayer);
            map.hs.SetPlayer(players[0]);
            i++;
        }
        else
        {
            Camera.main.gameObject.AddComponent <FrstCam>();
            Camera.main.transform.position = goals[0].transform.position + Vector3.up * 20f;
        }

        for (; i < PlayersPerTeam; i++)
        {
            float   ang       = Mathf.PI * 2 * (float)i / (float)PlayersPerTeam;
            Vector3 offset    = new Vector3(Mathf.Cos(ang), 0f, Mathf.Sin(ang)) * spawnRadius;
            AI      newPlayer = Instantiate <AI>(playerPrefab, goals[0].transform.position + offset, Quaternion.identity);
            if (nnbrain != null)
            {
                newPlayer.InitBrain(0, blueMaterial, this, nnbrain);
            }
            else
            {
                newPlayer.Init(0, blueMaterial, this);
            }
            players.Add(newPlayer);
        }

        for (int j = 0; j < PlayersPerTeam; j++)
        {
            float   ang       = Mathf.PI * 2 * (float)j / (float)PlayersPerTeam + Mathf.PI;
            Vector3 offset    = new Vector3(Mathf.Cos(ang), 0f, Mathf.Sin(ang)) * spawnRadius;
            AI      newPlayer = Instantiate <AI>(playerPrefab, goals[1].transform.position + offset, Quaternion.identity);
            if (nnbrain != null)
            {
                newPlayer.InitBrain(1, redMaterial, this, nnbrain);
            }
            else
            {
                newPlayer.Init(1, redMaterial, this);
            }
            players.Add(newPlayer);
        }

        loaded    = true;
        over      = false;
        paused    = false;
        time      = 0f;
        resetTime = 0f;
        rs        = map.rs;
    }
 // Use this for initialization
 void Start()
 {
     resultScript = GameObject.Find("Text").GetComponent <ResultScript>();
     playerScript = GameObject.Find("player").GetComponent <PlayerScript>();
 }
 private void Start()
 {
     g_troubleScript    = GameObject.Find("Stageinformation").GetComponent <ResultScript>();
     g_troubleText      = this.GetComponent <TextMeshProUGUI>();
     g_troubleText.text = g_troubleScript.GetRemaining().ToString();
 }