Example #1
0
 // Start is called before the first frame update
 protected virtual void Start()
 {
     enemySpawner = GameObject.Find("enemySpawner");
     sc           = FindObjectOfType <sceneController>();
     enemySpawner.GetComponent <enemySpawner>().add1EnemyCount();
     getdirection();
 }
 void Awake()
 {
     boxCollider     = GetComponent <BoxCollider2D>();
     sprite          = GetComponent <SpriteRenderer>();
     sceneController = GameObject.FindWithTag("GameController").GetComponent <sceneController>();
     active(sceneController.currentColor == sceneController.SceneColor.red && isRed || sceneController.currentColor == sceneController.SceneColor.blue && !isRed);
 }
Example #3
0
 void Start()
 {
     startPos         = transform.position;
     gameC            = FindObjectOfType(typeof(GameController)) as GameController;
     sceneC           = FindObjectOfType(typeof(sceneController)) as sceneController;
     ScreenController = FindObjectOfType(typeof(screenController)) as screenController;
 }
Example #4
0
 void Awake()
 {
     animator        = GetComponent <Animator>();
     edgeCollider    = GetComponent <EdgeCollider2D>();
     sceneController = GameObject.FindWithTag("GameController").GetComponent <sceneController>();
     active(sceneController.currentColor == sceneController.SceneColor.red && isRed || sceneController.currentColor == sceneController.SceneColor.blue && !isRed);
 }
Example #5
0
 void Start()
 {
     gameC         = FindObjectOfType(typeof(GameController)) as GameController;
     playerC       = FindObjectOfType(typeof(playerController)) as playerController;
     achievementsC = FindObjectOfType(typeof(AchievementsAnalysisController)) as AchievementsAnalysisController;
     sceneC        = FindObjectOfType(typeof(sceneController)) as sceneController;
 }
Example #6
0
    // Start is called before the first frame update
    void Start()
    {
        scene = sceneGO.GetComponent <sceneController>();
        EdgeCollider2D edgeCollider;

        edgeCollider     = GetComponent <EdgeCollider2D>();
        possibleXYvalues = new Vector2(Mathf.Abs(edgeCollider.points[0].x), Mathf.Abs(edgeCollider.points[0].y));
    }
Example #7
0
 // Use this for initialization
 void Start()
 {
     controller = GameObject.Find("ScriptsController").GetComponent<sceneController>();
     if(!name.Equals("door"))
     {
         renderer.enabled = false;
     }
 }
Example #8
0
    public IEnumerator StartArcade()
    {
        Animator        title = GameObject.Find("Canvas/Menus/GameTitle").GetComponent <Animator>();
        sceneController sc    = GameObject.Find("SceneManager").GetComponent <sceneController>();

        title.Play("Break", 0, 0);
        yield return(new WaitForSecondsRealtime(.5f));

        //SceneManager.LoadScene("ArcadeMode");
        StartCoroutine(sc.PrepareAndLoadNextScene(true));
    }
Example #9
0
 // Use this for initialization
 void Start()
 {
     rigidBody       = GetComponent <Rigidbody2D> ();
     animator        = GetComponent <Animator> ();
     jumpController  = GetComponent <Jump> ();
     rend            = GetComponent <Renderer>();
     sceneController = GameObject.FindWithTag("GameController").GetComponent <sceneController>();
     blueChar        = rend.material.shader;
     redChar         = Shader.Find("Sprites/Default");
     emitRipple      = GetComponent <EmitRipple>();
     facingRight     = true;
 }
Example #10
0
    public IEnumerator MyCor()  //Can this be renamed to describe what it does? - CC
    {
        Animator title = GameObject.Find("Canvas/Menus/GameTitle").GetComponent <Animator>();

        title.Play("Crumble", 0, 0);
        yield return(new WaitForSecondsRealtime(2.5f));

        sceneController sc = GameObject.Find("SceneManager").GetComponent <sceneController>();

        StartCoroutine(sc.PrepareAndLoadNextScene(false));
        //.PrepareFirstLevelAsynch();
        //sc.TryLoadPreparedScene();
    }
Example #11
0
 void Awake()
 {
     // creates a singleton manager that persists between scenes
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Example #12
0
    // Use this for initialization
    void Start()
    {
        controller = GameObject.Find("ScriptsController").GetComponent<sceneController>();
        if(ActualState == state.Open)
        {
            OpenDoor(false);
        }
        else
        {
            CloseDoor(false);
        }

        playSound = true;
    }
Example #13
0
    void Start()
    {
        sceneCtrl = this;

        start     = SceneManager.GetSceneByName("game_start");
        scene_2   = SceneManager.GetSceneByName("scene_2");
        river     = SceneManager.GetSceneByName("river");
        scene_3fr = SceneManager.GetSceneByName("scene_3_fr");
        scene_3mt = SceneManager.GetSceneByName("scene_3_mt");
        caves     = SceneManager.GetSceneByName("caves");
        monster   = SceneManager.GetSceneByName("monster");
        end       = SceneManager.GetSceneByName("end");
        end2      = SceneManager.GetSceneByName("end2");
    }
Example #14
0
    void Start()
    {
        isAni  = true;
        gameC  = FindObjectOfType(typeof(GameController)) as GameController;
        sceneC = FindObjectOfType(typeof(sceneController)) as sceneController;

        for (int i = 0; i < maxQtdMoney; i++)
        {
            GameObject tempM = Instantiate(moneyPrefab) as GameObject;
            moneys.Add(tempM);
            tempM.SetActive(false);
        }

        UseShip = PlayerPrefs.GetInt("ptc_UseShip");
        clearShipAndUse();
    }
Example #15
0
    void Start()
    {
        gameC  = FindObjectOfType(typeof(GameController)) as GameController;
        sceneC = FindObjectOfType(typeof(sceneController)) as sceneController;
        timeToTryToSpawnArm = timeToTryToSpawn;
        nRaven      = 0;
        currentTime = 0;

        for (int i = 0; i < maxSpawnBirds; i++)
        {
            GameObject tempB = Instantiate(birdPrefab) as GameObject;
            birds.Add(tempB);
            tempB.SetActive(false);
        }
        for (int i = 0; i < maxSpawnNyans; i++)
        {
            GameObject tempN = Instantiate(nyanPrefab) as GameObject;
            nyans.Add(tempN);
            tempN.SetActive(false);
        }
    }
Example #16
0
    // Use this for initialization
    void Start()
    {
        controller = GameObject.Find("ScriptsController").GetComponent<sceneController>();
        transform.position.Set(initX, initY, initZ);
        actualState = state.droped;
        dot = GameObject.Find("dot").transform;
        actualPosition = new Vector3(dot.position.x, dot.position.y, cachedZ);

        if(GameObject.Find ("GameController").GetComponent<gameControllerScripts>().miniGameResolved)
        {
            SetPlaced();
        }
    }
Example #17
0
 // Use this for initialization
 void Start()
 {
     controller = GameObject.Find("ScriptsController").GetComponent<sceneController>();
     if (rigidbody) rigidbody.freezeRotation = true;
 }
Example #18
0
 void Start()
 {
     levelInt = 0;
     sceneC   = FindObjectOfType(typeof(sceneController)) as sceneController;
     isOn     = false;
 }
Example #19
0
 // Use this for initialization
 void Start()
 {
     instance = this;
 }