コード例 #1
0
    // Use this for initialization
    void Start()
    {
        levelControllerComp = FindObjectOfType <LevelControllerComp>();
        audioSource         = GetComponent <AudioSource>();

        spaceShip          = FindObjectOfType <SpaceShipComp>();
        transform.position = spaceShip.transform.position;

        if (levelControllerComp.Config.soundEffects)
        {
            AudioSource.PlayClipAtPoint(audioSource.clip, transform.position);
        }
        StarShot();
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        //ConfigComp.PrintDebug("LevelControllerComp.Start");

        configComp = FindObjectOfType <ConfigComp>();

        spaceShipComp = FindObjectOfType <SpaceShipComp>();

        goText                    = GameObject.FindGameObjectWithTag("GoText").GetComponent <Text>();
        infoLevelValue            = GameObject.FindGameObjectWithTag("InfoLevelValue").GetComponent <Text>();
        infoAsteroidsValue        = GameObject.FindGameObjectWithTag("InfoAsteroidsValue").GetComponent <Text>();
        infoMaxAsteroidsValue     = GameObject.FindGameObjectWithTag("InfoMaxAsteroidsValue").GetComponent <Text>();
        infoMaxLostAsteroidsValue = GameObject.FindGameObjectWithTag("InfoMaxLostAsteroidsValue").GetComponent <Text>();
        infoShieldValue           = GameObject.FindGameObjectWithTag("InfoShieldValue").GetComponent <Text>();
        infoBonusValue            = GameObject.FindGameObjectWithTag("InfoBonusValue").GetComponent <Text>();

        Initialize();


        numMaxAsteroidPerLevel     = (numAsteroidsType1 + numAsteroidsType2 + numAsteroidsType3);
        InfoMaxAsteroidsValue.text = numMaxAsteroidPerLevel < 0 ? "0" : numMaxAsteroidPerLevel.ToString();

        InfoMaxLostAsteroidsValue.text = numMaxLostAsteroids.ToString();

        InfoLevelValue.text = SceneManager.GetActiveScene().buildIndex.ToString();

        UpdateValueAsteroids();
        UpdateValueLostAsteroids();
        UpdateValueShield();
        UpdateValueBonus();

        ListSpots();

        if (Config.IsShieldActivated())
        {
            if (Config.numTypeShield > 0)
            {
                spaceShipComp.loadShieldSpaceShip();
            }
        }
    }