Ejemplo n.º 1
0
        protected override void OnCreate()
        {
            base.OnCreate();
            barrier = World.GetOrCreateSystem <EndSimulationEntityCommandBufferSystem>();

            //TODO: inject the dependency with DI framework
            spawner = GameObject.FindObjectOfType <BugSpawner>();
        }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        sr        = GetComponent <SpriteRenderer>();
        sr.sprite = sprites[0];

        timer = MoveTime;

        isAlive = true;

        yRange = Camera.main.orthographicSize;
        xRange = yRange * Screen.width / Screen.height;

        yMin = -yRange;
        yMax = yRange;
        xMin = -xRange;
        xMax = xRange;

        bs = GameObject.FindGameObjectWithTag("BugSpawner").GetComponent <BugSpawner>();
    }
Ejemplo n.º 3
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        uIManager            = GetComponent <UIManager>();
        environmentGenerator = GetComponent <EnvironmentGenerator>();
        bugSpawner           = GetComponent <BugSpawner>();
        touchInputs          = GetComponent <TouchInputs>();

#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL
        pauseButton.transform.SetParent(uIPanel.transform);
        Destroy(touchInputObject);
#endif
#if UNITY_IOS || UNITY_ANDROID
        Destroy(instructions);
#endif
    }
Ejemplo n.º 4
0
 void Start()
 {
     bugSpawner = transform.FindChild("Global").GetComponentInChildren <BugSpawner>();
 }
Ejemplo n.º 5
0
 // instantiates a BugSpawner which will spawn Bugs
 void instantiateBugSpawner()
 {
     bugSpawner      = Instantiate(bugSpawner);
     bugSpawner.name = "BugSpawner";
 }
Ejemplo n.º 6
0
 void Start()
 {
     bugSpawner = transform.FindChild("Global").GetComponentInChildren<BugSpawner>();
 }