Inheritance: MonoBehaviour
 void Start()
 {
     currentlySelected = false;
     ctrl = Camera.main.GetComponent<cameraController>();
     startcolor = GetComponent<Renderer>().material.color;
     factories = GetComponentsInChildren<UIReq>();
 }
Example #2
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
     newPos   = transform.position;
     newRot   = transform.rotation;
     newZoom  = CameraTransform.localPosition;
 }
Example #3
0
    // Use this for initialization
    void Start()
    {
        m_Camera = GameObject.Find("Main Camera").GetComponent <cameraController>();

        m_Collider           = GetComponent <BoxCollider>();
        m_Collider.isTrigger = true;
    }
 // Use this for initialization
 void Start()
 {
     currentSpeed     = 0;
     rigidBody        = GetComponent <Rigidbody>();
     gameController   = GameObject.Find("gameController").GetComponent <gameController>();
     shopMenu         = GameObject.Find("shopMenu").GetComponent <shopMenuController>();
     cameraController = GameObject.Find("Camera").GetComponent <cameraController>();
 }
 // Use this for initialization
 void Start()
 {
     thePlayer = FindObjectOfType <playerController>();
     thePlayer.transform.position = transform.position;
     thePlayer.lastMove           = startDirection;
     theCamera = FindObjectOfType <cameraController>();
     theCamera.transform.position = new Vector3(transform.position.x, transform.position.y, theCamera.transform.position.z);
 }
	// Use this for initialization
	void Start () {
		GameObject camera = GameObject.FindGameObjectWithTag("MainCamera");
		camControl = camera.GetComponent<cameraController> () as cameraController;
		chatterBox = GameObject.FindGameObjectWithTag ("chatterBox").GetComponent<chatter> ();

		GameObject player = GameObject.FindGameObjectWithTag ("Player");
		objectHealth = player.GetComponent <objectHealth> ();
	}
Example #7
0
    private void Start()
    {
        _cameraController = FindObjectOfType <cameraController>();

        piUi       = FindObjectOfType <PiUIManager>();
        normalMenu = piUi.GetPiUIOf("Normal Menu");
        //piUi.ChangeMenuState("Normal Menu", new Vector2(Screen.width / 2f, Screen.height / 2f));
    }
Example #8
0
    void Start()
    {
        instance = this;

        camera = GetComponent ("Camera") as Camera;
        camera.backgroundColor = clearColor;

        horizOffset = player.transform.rotation * new Vector3(0,0,-1);
    }
Example #9
0
 void Start()
 {
     powerSlider      = GameObject.FindGameObjectWithTag("powerSlider").GetComponent <Slider>();
     sliderColor      = GameObject.FindGameObjectWithTag("fillColor").GetComponent <Image>();
     cooldownSlider   = GameObject.FindGameObjectWithTag("cooldownSlider").GetComponent <Slider>();
     cooldownColor    = GameObject.FindGameObjectWithTag("cdfillColor").GetComponent <Image>();
     timer            = Time.time + cooldown;
     cameraController = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <cameraController>();
 }
Example #10
0
    void SetLocation()
    {
        if (player.startingPoint == pointName)
        {
            player.transform.position = transform.position;
            player.lastDirection      = startingDirection;

            playerCamera = FindObjectOfType <cameraController>();
            playerCamera.transform.position = new Vector3(transform.position.x, transform.position.y, playerCamera.transform.position.z);
        }
    }
    // Use this for initialization
    void Start()
    {
        GameObject camera = GameObject.FindGameObjectWithTag("MainCamera");

        camControl = camera.GetComponent <cameraController> () as cameraController;
        chatterBox = GameObject.FindGameObjectWithTag("chatterBox").GetComponent <chatter> ();

        GameObject player = GameObject.FindGameObjectWithTag("Player");

        objectHealth = player.GetComponent <objectHealth> ();
    }
    // Start is called before the first frame update
    void Start()
    {
        cc         = Camera.main.GetComponent <cameraController>();
        roomBounds = GameObject.Find("RoomBounds").GetComponent <BoxCollider2D>();
        col        = GetComponent <BoxCollider2D>();
        minX       = roomBounds.bounds.center.x - roomBounds.bounds.extents.x + col.bounds.extents.x;
        maxX       = roomBounds.bounds.center.x + roomBounds.bounds.extents.x - col.bounds.extents.x;

        minY = roomBounds.bounds.center.y - roomBounds.bounds.extents.y + col.bounds.extents.y;
        maxY = roomBounds.bounds.center.y + roomBounds.bounds.extents.y - col.bounds.extents.y;
    }
Example #13
0
 // Start is called before the first frame update
 void Start()
 {
     charCon      = GetComponent <CharacterController>();
     animator     = GetComponent <Animator>();
     bodyCollider = GetComponent <CapsuleCollider>();
     Application.targetFrameRate = 30;
     QualitySettings.vSyncCount  = 0;
     cam                = (cameraController)FindObjectOfType(typeof(cameraController));
     spawn1             = GameObject.Find("spawn1");
     spawn2             = GameObject.Find("spawn2");
     transform.position = spawn1.transform.position;
     //var dialogue = DialogueManager.Talk();
     //dialogue.AddString("Welcome to video games lol");
 }
Example #14
0
    private void Start()
    {
        BGM = BGMGO.GetComponent <AudioSource>();
        cameraController = cameraControllerGO.GetComponent <cameraController>();
        player           = playerGO.GetComponent <playerCharacter>();
        roomGO           = Instantiate(roomGO);
        room             = roomGO.GetComponent <roomController>();
        BGM.Play();
        alive = true;

        playerGO.transform.localPosition = new Vector3(room.initialPositionX, room.initialPositionY, playerGO.transform.localPosition.z);
        getNotifiables();
        OrderNotifiables();
    }
Example #15
0
    void Start()
    {
        playerScript = player.GetComponent <playerController>();
        cameraScript = camera.GetComponent <cameraController>();
        boxCollider  = castPoint.GetComponent <BoxCollider2D>();
        castPoint.transform.position = new Vector3(player.transform.position.x, player.transform.position.y + 3, player.transform.position.z);
        mousePosition        = Input.mousePosition;
        previousMousePositon = Input.mousePosition;
        screenHeightInUnits  = camera.orthographicSize * 2;
        screenWidthInUnits   = screenHeightInUnits * ((float)Screen.width / (float)Screen.height);
        unitPerPixel         = screenHeightInUnits / Screen.height;

        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = false;
    }
Example #16
0
 public void switchCamera()
 {
     if (currentCamera == cam1.GetComponent <cameraController>())
     {
         cam2.enabled  = true;
         currentCamera = cam2.GetComponent <cameraController>();
         cam1.enabled  = false;
     }
     else
     {
         cam1.enabled  = true;
         currentCamera = cam1.GetComponent <cameraController>();
         cam2.enabled  = false;
     }
 }
Example #17
0
 private void Awake()
 {
     if (mainCamera != null)
     {
         Debug.LogWarning("More than one instance of mainCamera found!");
         return;
     }
     mainCamera = GameObject.Find("Main Camera").GetComponent <Camera>();
     if (instance != null)
     {
         Debug.LogWarning("More than one instance of cameraController found!");
         return;
     }
     instance = this;
 }
Example #18
0
    void Start()
    {
        if (mainCameraController == null && enablePinchToZoom)
        {
            if ((mainCameraController = this.gameObject.GetComponent <cameraController>()) == null)
            {
                Debug.LogError("Unable to find the cameraController to use with the touchController");
                enablePinchToZoom = false;
            }
        }

        if (!Input.multiTouchEnabled)
        {
            enablePinchToZoom     = false;
            enableMultiTouchSwipe = false;
        }
    }
Example #19
0
    // Use this for initialization
    void Start()
    {
        GameObject gCHolder = GameObject.FindGameObjectWithTag("GameController");

        if (gCHolder != null)
        {
            gameCont = gCHolder.GetComponent <gameController> () as gameController;
        }
        GameObject camera = GameObject.FindGameObjectWithTag("MainCamera");

        camControl = camera.GetComponent <cameraController> () as cameraController;

        chatterBox = GameObject.FindGameObjectWithTag("chatterBox").GetComponent <chatter> ();
        GameObject player = GameObject.FindGameObjectWithTag("Player");

        objectHealth = player.GetComponent <objectHealth> ();
    }
Example #20
0
    void Start()
    {
        if (mainCameraController == null && enablePinchToZoom)
        {
            if ((mainCameraController = this.gameObject.GetComponent<cameraController>()) == null)
            {
                Debug.LogError("Unable to find the cameraController to use with the touchController");
                enablePinchToZoom = false;
            }
        }

        if (!Input.multiTouchEnabled)
        {
            enablePinchToZoom = false;
            enableMultiTouchSwipe = false;
        }
    }
Example #21
0
    // Use this for initialization
    void Start()
    {
        camera  = GameObject.Find("Camera1").GetComponent <Camera>();
        cameraS = camera.GetComponent <cameraController>();
        server  = GameObject.FindObjectOfType <Server>();
        home    = null;
        g       = FindObjectOfType <gameState>();

        label        = gameObject.AddComponent <PieceLabel>() as PieceLabel;
        label.target = this;

        /*
         * if (transform.parent.parent.gameObject.name == "pirateBoard")
         *  server = GameObject.Find("PirateServer").GetComponent<Server>();
         * else
         *  server = GameObject.Find("ShipServer").GetComponent<Server>();
         */
    }
Example #22
0
    // Start is called before the first frame update
    void Start()
    {
        carScript       = carScript.GetComponent <CarController>();
        boosterScript   = boosterScript.GetComponent <ParticleSystemBehavior>();
        cameraScript    = cameraScript.GetComponent <cameraController>();
        playerScript    = playerScript.GetComponent <RigidbodyFirstPersonController>();
        playerCamScript = playerCamScript.GetComponent <HeadBob>();


        playerCamScript.enabled = true;
        carScript.enabled       = false;
        boosterScript.enabled   = false;
        boosterScript2.enabled  = false;
        cameraScript.enabled    = false;
        playerScript.enabled    = true;
        carCam2.enabled         = false;
        Player.SetActive(true);
    }
    void simulateCamera()
    {
        if (camController == null)
        {
            camController = FindObjectOfType <cameraController>();
        }
        if (camIndex >= camController.cameraPos.Length - 1 || camIndex < 0)
        {
            camIndex = 0;
        }
        else
        {
            camIndex++;
        }

        mainCam.transform.position = camFocus.transform.position - (camFocus.transform.forward * camController.cameraPos[camIndex].x) + (camFocus.transform.up * camController.cameraPos[camIndex].y);
        mainCam.transform.LookAt(camFocus.transform);
    }
Example #24
0
    // Start is called before the first frame update
    void Start()
    {
        if (!singleton)
        {
            DontDestroyOnLoad(gameObject);
            singleton = this;
        }
        else
        {
            Destroy(gameObject);
        }

        if (DataBank.GetCurrScene() == Scene.TITLE)
        {
            //PrefabGenerator.CreateChild(gameObject, "Prefab/UI/title_logoPrefab", new Vector3(0,10,0), 0, "Title_Logo");

            PrefabGenerator.CreateChild(gameObject, "Prefab/UI/sky_bgPrefab", new Vector3(0, 10, 0), 0, "sky_bg");

            PrefabGenerator.CreateChild(gameObject, "Prefab/Event/TitleEnd/TitleEndPrefab", "TitleEnd");
        }
    }
Example #25
0
    IEnumerator collectStar()
    {
        float            time   = 3.0f;
        GameObject       player = GameObject.FindGameObjectWithTag("Player");
        playerController pc     = player.GetComponent <playerController>();

        pc.pauseAnimator();
        pc.cutScenePrep();


        GetComponent <SpriteRenderer>().enabled = false;
        transform.position = player.transform.position + Vector3.up * 1.0f;
        yield return(new WaitForSeconds(0.25f));

        GetComponent <SpriteRenderer>().enabled = true;

        cameraController cc = Camera.main.GetComponent <cameraController>();

        cc.StartShake(0.1f, time);

        float startTime   = Time.time;
        float elapsedTime = 0.0f;

        while (elapsedTime < time)
        {
            transform.GetComponentInChildren <ParticleSystem>().Play();
            elapsedTime        = Time.time - startTime;
            transform.position = player.transform.position + Vector3.up * (1.0f + elapsedTime / 4.0f);
            yield return(new WaitForEndOfFrame());
        }

        GetComponent <ParticleSystem>().Play();
        Destroy(gameObject, 1.0f);
        yield return(1.0);

        GetComponent <persistance>().MarkRemoved();
        gameManager.numberOfStarts++;
        pc.returnToMovement();
    }
Example #26
0
    // Use this for initialization
    void Start()
    {
        cam1          = GameObject.Find("Camera1").GetComponent <Camera>();
        cam2          = GameObject.Find("Camera2").GetComponent <Camera>();
        currentCamera = cam1.GetComponent <cameraController>();
        cam2.enabled  = false;
        server        = GameObject.FindObjectOfType <Server>();
        canvas        = GameObject.Find("TextCanvas");
        readyButton   = GameObject.Find("readyButton").GetComponent <Button>();
        phaseText     = GameObject.Find("phaseText").GetComponent <Text>();

        pirateText = GameObject.Find("pirateText").GetComponent <Text>();
        shipText   = GameObject.Find("shipText").GetComponent <Text>();

        //switchCamera();
        phase = 1;

        readyButton.onClick.AddListener(() => { ready(true); });
        exitButton = GameObject.Find("exitButton").GetComponent <Button>();
        exitButton.onClick.AddListener(() => { exit(); });
        cameraButton = GameObject.Find("cameraButton").GetComponent <Button>();
        cameraButton.onClick.AddListener(() => { switchCamera(); });
    }
Example #27
0
    // Use this for initialization
    void Start()
    {
//		data = GameObject.FindGameObjectWithTag("data").GetComponent<dataContainer>();
        masterList        = GetComponentInChildren <masterListController>();
        timeController    = GameObject.Find("TimeController").GetComponent <timeController>();
        weatherController = GetComponent <weatherController>();
        cameraController  = GameObject.Find("Camera").GetComponent <cameraController>();
        mapController     = GetComponent <mapController>();
        battleController  = GetComponent <battleController>();
        currentParty      = new GameObject[maxPartySize];
        loadCharas();
//		playerController = GameObject.FindGameObjectWithTag("Player").GetComponent<playerController>();
//		inventoryController = GetComponent<inventoryController>();
//		loadInventory();
//
//		objectController = GameObject.Find("objectController").GetComponent<objectController>();
//		itemController = GameObject.Find("itemController").GetComponent<itemController>();
//		enemyController = GameObject.Find("enemyController").GetComponent<enemyController>();

        menu.SetActive(false);
        playerController.isControllable = true;
        cameraController.isControllable = true;
    }
Example #28
0
    private void Update()
    {
        if (collected)
        {
            if (canCollect)
            {
                canCollect = false;

                collectiblesUIController controller = uiElement.transform.parent.GetComponent <collectiblesUIController>();
                controller.addOne();
            }

            cameraController cc          = Camera.main.GetComponent <cameraController>();
            Vector3          screenPoint = new Vector3(0, 1, 0);
            Vector3          worldPos    = Camera.main.ViewportToWorldPoint(screenPoint) + uiElement.transform.position / 128.0f;
            transform.position = Vector3.MoveTowards(transform.position, worldPos, moveSpeed);

            if (Vector3.Magnitude(transform.position - worldPos) < 1f)
            {
                Destroy(gameObject);
            }
        }
    }
 void Start()
 {
     cc = cameraPos.GetComponent <cameraController>();
 }
 // Start is called before the first frame update
 void Start()
 {
     script = mainCamera.GetComponent <cameraController>();
 }
Example #31
0
//    public CinemachineBrain theCMBrain;

    private void Awake()
    {
        instance = this;
    }
Example #32
0
 // Start is called before the first frame update
 void Start()
 {
     camera = Camera.main.GetComponent <cameraController>();
 }
    void checkComponents()
    {
        //check Scripts  ->
        if (VehicleObject.GetComponent <controller>() == null)
        {
            VehicleObject.AddComponent <controller>();
            setUpController();
        }

        if (rigidbody != null)
        {
            rigidbody.mass = 1500;
        }

        //check objecs

        foreach (Transform item in VehicleObject.transform)
        {
            if (item.transform.name == "focus")
            {
                camFocus = item.transform.gameObject;
            }
            if (item.transform.name == "centerOfMas")
            {
                centerOfMas = item.transform.gameObject;
            }
            if (item.transform.name == bodyCollidersString)
            {
                bodyColliders = item.gameObject;
            }
            if (item.transform.name == "driver")
            {
                driverPos = item.gameObject;
            }
        }
        if (bodyColliders == null)
        {
            bodyColliders = new GameObject();
            bodyColliders.transform.name = bodyCollidersString;
            bodyColliders.AddComponent <BoxCollider>();
            bodyColliders.transform.parent = VehicleObject.transform;
        }

        if (camFocus == null)
        {
            camFocus = new GameObject();
            camFocus.transform.name   = "focus";
            camFocus.transform.parent = VehicleObject.transform;
        }
        if (driverPos == null)
        {
            driverPos = new GameObject();
            driverPos.transform.name   = "driver";
            driverPos.transform.parent = VehicleObject.transform;
        }

        if (centerOfMas == null)
        {
            centerOfMas = new GameObject();
            centerOfMas.transform.name   = "centerOfMas";
            centerOfMas.transform.parent = VehicleObject.transform;
        }

        try{
            mainCam = FindObjectOfType <Camera>();
            if (mainCam.GetComponent <cameraController>() != null)
            {
                camController = mainCam.GetComponent <cameraController>();
                if (camController.cameraPos.Length == 0)
                {
                    camController.cameraPos = new Vector2[2];
                }
            }
        }catch {
            mainCam      = new GameObject().AddComponent <Camera>();
            mainCam.name = "MainCamera";
            if (mainCam.GetComponent <cameraController>() != null)
            {
                camController = mainCam.GetComponent <cameraController>();
                if (camController.cameraPos.Length == 0)
                {
                    camController.cameraPos = new Vector2[2];
                }
            }
        }

        setInstances();
    }
Example #34
0
 void Awake()
 {
     cameraController = cameraObject.GetComponent <cameraController>();
     level0           = levelDummie.GetComponent <level0>();
 }