Beispiel #1
0
    void Start()
    {
        //ゲームマネージャー取得
        gamemanager = GameObject.Find("GameManager");
        Game_M      = gamemanager.GetComponent <GameManager_M>();
        //ライフマネージャー取得
        canbas = GameObject.Find("Canvas");
        Life_M = canbas.GetComponent <LifeManager_M>();

        tama       = GameObject.Find("TAMA");
        playerMove = tama.GetComponent <PlayerMove_M>();
    }
Beispiel #2
0
    void Start()
    {
        //ゲームマネージャー取得


        gamemanager = GameObject.Find("GameManager");
        Game_M      = gamemanager.GetComponent <GameManager_M>();
        player      = Game_M.player;
        player_mesh = Game_M.player_mesh;
        HP          = 10;
        //currentLife = HP;//最初の体力はmax

        mutekiTime = 2.0f;

        pMove = player.GetComponent <PlayerMove_M>();

        lifesObj = new GameObject[HP];

        currentLife = LifeManager_scr_K.currentLife;

        for (int i = 0; i < HP; i++)
        {
            lifesObj[i] = new GameObject("cat" + i);
            lifesObj[i].transform.parent = gameObject.transform;
            lifesObj[i].AddComponent <RectTransform>().anchoredPosition = new Vector2(-348 + (80.333f * i), -180);
            lifesObj[i].GetComponent <RectTransform>().localScale       = new Vector3(0.05f, 0.05f, 0.05f);
            lifesObj[i].AddComponent <Image>().sprite         = Resources.Load <Sprite>("Images_M/cat_icon");
            lifesObj[i].GetComponent <Image>().preserveAspect = true;
            lifesObj[i].GetComponent <Image>().SetNativeSize();
        }
        for (int i = 0; i < HP; i++)
        {
            if (i < currentLife)
            {
                lifesObj[i].GetComponent <Image>().enabled = true;
            }
            else
            {
                lifesObj[i].GetComponent <Image>().enabled = false;
            }
        }
        time = 0;
    }
Beispiel #3
0
 void Start()
 {
     performState     = 0;
     missiles         = new GameObject[8];
     MissileManager   = GetComponent <MissileManager_M>();
     PlayerMove       = player.GetComponent <PlayerMove_M> ();
     PlayerMove.BP    = false;
     PlayerMove.FinBP = false;
     PerformanceCam   = transform.GetChild(0).gameObject;
     PerformanceCam.GetComponent <Camera>().enabled   = false;
     Performancecam1.GetComponent <Camera>().enabled  = false;
     Performancecam2R.GetComponent <Camera>().enabled = false;
     Performancecam2L.GetComponent <Camera>().enabled = false;
     Performancecam3.GetComponent <Camera>().enabled  = false;
     BossCamera.GetComponent <Camera>().enabled       = false;
     LightR      = SearchLightR.transform.GetChild(0).gameObject;
     LightL      = SearchLightL.transform.GetChild(0).gameObject;
     audioSource = GetComponent <AudioSource>();
 }