Наследование: MonoBehaviour
Пример #1
0
    void Update()
    {
        if (cameraOptions == null)
        {
            cameraOptions = this;
        }

        if (blackScrn != null)
        {
            fade_timer      = fading ? fade_timer -= Time.deltaTime : fade_timer += Time.deltaTime;
            blackScrn.color = Color.Lerp(Color.black, Color.clear, fade_timer);

            if (fade_timer < 0 || fade_timer > 1)
            {
                fading = false;
            }
        }

        if (target != null)
        {
            if (timeMove < speed)
            {
                timeMove = +Time.deltaTime;
                float s = timeMove / speed;

                transform.position = Vector2.Lerp(transform.position, new Vector2(Mathf.Clamp(target.transform.position.x, minCameraBoundaries.x, maxCameraBoundaries.x), Mathf.Clamp(target.transform.position.y, minCameraBoundaries.y, maxCameraBoundaries.y)), s * 5.5f);
            }
        }

        //= new Vector2(Mathf.Clamp(target.transform.position.x, minCameraBoundaries.x, maxCameraBoundaries.x), Mathf.Clamp(target.transform.position.y, minCameraBoundaries.y, maxCameraBoundaries.y));
    }
Пример #2
0
 void Awake()
 {
     movement 	= pc.GetComponent <CharacterMotor> ();
     message 	= text.GetComponent <uiSystem> ();
     cam 		= holder.GetComponent <cameraScript> ();
     menu 		= holder.GetComponent <menuScript> ();
 }
Пример #3
0
    // Start is called before the first frame update
    void Start()
    {
        rb = Rolling_Panel.GetComponent <Rigidbody>();
        rb.maxAngularVelocity = 100f;

        main_camera  = GameObject.Find("Main Camera");
        cameraScript = main_camera.GetComponent <cameraScript>();
    }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     targets        = GameObject.FindGameObjectsWithTag("blue");
     cam            = GameObject.Find("Main Camera").GetComponent <cameraScript>();
     camZLook       = GameObject.Find("cameraZLook").GetComponent <cameraZLookScript>();
     visualJoyStick = GameObject.Find("visualJoyStick").GetComponent <visualJoyStick>();
     player         = GameObject.Find("player").GetComponent <biology>();
     cam.setTarget(player.transform);
     camZLook.setFollowTarget(player.transform);
 }
Пример #5
0
 void Awake()
 {
     // Variables to hold the scripts on other game objects so that we can manipulate them from this script
     mouse 		= pc.GetComponent <MouseLook> ();
     movement 	= pc.GetComponent <CharacterMotor> ();
     cam 		= Camera.main.GetComponent <MouseLook> ();
     talk 		= pc.GetComponent <playerScript> ();
     menu 		= holder.GetComponent <menuScript> ();
     inventory 	= holder.GetComponent <cameraScript> ();
     message 	= text.GetComponent <uiSystem> ();
 }
Пример #6
0
 // Use this for initialization
 void Start()
 {
     myText   = GameObject.Find("Text").GetComponent <textScript>();
     myCamera = GameObject.Find("Main Camera").GetComponent <cameraScript>();
     blocks   = new GameObject[transform.childCount];
     for (int i = 0; i < transform.childCount; i++)
     {
         blocks[i] = transform.GetChild(i).gameObject;
     }
     blockCount = blocks.Length;
     spawnBlock();
 }
Пример #7
0
    void Awake()
    {
        player 		= PC.GetComponent <playerScript> ();
        inv		 	= holder.GetComponent <cameraScript> ();
        m			= holder.GetComponent <menuScript> ();
        //badge 		= maria.GetComponent <mariaBehavior> ();

        if (Application.loadedLevel == 1)
        {
            key 		= npc.GetComponent <securityBehavior> ();
            badge 		= picture.GetComponent <pictureScript> ();
        }
    }
Пример #8
0
 // Use this for initialization
 void Awake()
 {
     cameraBoundary = 9;
     initPosition   = transform.position;
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Пример #9
0
    void Start()
    {
        PrimeCamera   = Camera.main.gameObject;
        cameraScripti = PrimeCamera.GetComponent <cameraScript>();
        Debug.Log("unit count " + units.Count);
        toimintolista = new int[128, 3];
        SortList();

        foreach (GameObject unit in units)
        {
            targets.Add(unit.transform);
        }
    }
Пример #10
0
    //private pictureScript	pic;
    void Awake()
    {
        // Variables to hold the scripts on other game objects so that we can manipulate them from this script
        mouse 		= pc.GetComponent <MouseLook> ();
        //movement 	= pc.GetComponent <CharacterMotor> ();
        cam 		= Camera.main.GetComponent <MouseLook> ();
        inventory 	= this.GetComponent <cameraScript> ();
        message 	= text.GetComponent <uiSystem> ();
        cursor		= gui.GetComponent <guiSystem> ();
        //pic 		= picture.GetComponent <pictureScript> ();

        if (Application.loadedLevel == 3)
        {
            talk 	= SH.GetComponent <playerScript> ();
        }

        else
        {
            talk 	= pc.GetComponent <playerScript> ();
        }
    }
Пример #11
0
    void Start()
    {
        gameObject.name = objectName;
        camScript       = GetComponent <cameraScript>();
        if (gameObject.name == "Blue_Player")
        {
            attackSide = "Enemy";
            allySide   = "Friendly";
            camScript.cam.cullingMask |= 1 << 9;
        }
        else
        {
            allySide   = "Enemy";
            attackSide = "Friendly";
            camScript.cam.cullingMask |= 1 << 10;
            transform.Rotate(0, 180, 0);
            transform.position = new Vector3(45, transform.position.y, 45);
        }

        foreach (GameObject go in GameObject.FindGameObjectsWithTag(allySide))
        {
            troops.Add(go.GetComponent <TroopClass>());
        }
    }
Пример #12
0
    // OVERLOAD: Applies the command method to every element of the troopList. ONLY for List<TroopClass>
    public static void IterateAll(List <TroopClass> troopList, SelectCommand command, cameraScript cam)
    {
        if (cam == null)
        {
            return;
        }
        Vector3 corner1 = cam.selectedStartPoint;
        Vector3 corner2 = cam.selectedEndPoint;

        for (int i = 0; i < troopList.Count; i++)
        {
            command(troopList[i], corner1, corner2);
        }
    }
Пример #13
0
 void Awake()
 {
     if (cam == null) {
         cam = this;
     }
 }
Пример #14
0
 private void Start()
 {
     en = GetComponent <cameraScript>();
 }
Пример #15
0
 void Start()
 {
     gameManager  = GameObject.FindGameObjectWithTag("Game manager");
     cameraScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <cameraScript>();
 }
Пример #16
0
	void Awake(){
		//player = gameObject.GetComponent<playerC>();
		cameraS = GameObject.Find ("mainCamera").GetComponent<cameraScript> ();
	}
Пример #17
0
	// Use this for initialization
	void Start () {
		if (MainCamera != null) {
			CameraSc = MainCamera.GetComponent<cameraScript> ();
		}
	
	}
Пример #18
0
 void Awake()
 {
     // Variables to hold the scripts on other game objects so that we can manipulate them from this script
     cam 		= holder.GetComponent <cameraScript> ();
     //chosen 		= holder.GetComponent <timeChanger> ();
     menu 		= holder.GetComponent <menuScript> ();
     message 	= text.GetComponent <uiSystem> ();
     mouse 		= pc.GetComponent <MouseLook> ();
     look 		= Camera.main.GetComponent <MouseLook> ();
     movement 	= pc.GetComponent <CharacterMotor> ();
     info 		= this.GetComponent <displayInfo> ();
     talk 		= pc.GetComponent <playerScript> ();
     pic 		= picture.GetComponent <pictureScript> ();
     cursor 		= gui.GetComponent <guiSystem> ();
 }
Пример #19
0
 void Start()
 {
     createPlatform();
     startItem();
     GAME_RUNNING = true;
     cameraScriptInst = (cameraScript)FindObjectOfType(typeof(cameraScript));
     gameGUIinst = (gameGUIManager)FindObjectOfType(typeof(gameGUIManager));
 }
Пример #20
0
 void Awake()
 {
     // Variables to hold the scripts on other game objects so that we can manipulate them from this script
     cam 		= holder.GetComponent <cameraScript> ();
     //chosen 		= holder.GetComponent <timeChanger> ();
     menu 		= holder.GetComponent <menuScript> ();
     message 	= text.GetComponent <uiSystem> ();
     mouse 		= this.GetComponent <MouseLook> ();
     look 		= Camera.main.GetComponent <MouseLook> ();
     movement 	= this.GetComponent <CharacterMotor> ();
     talk 		= this.GetComponent <playerScript> ();
     core 		= Core.GetComponent <displayInfo> ();
     daphne		= Daphne.GetComponent <displayInfo> ();
     ic			= Core.GetComponent <icScript> ();
     scepter		= scepterBroken.GetComponent <displayInfo> ();
     okScepter	= Scepter.GetComponent <displayInfo> ();
     cursor		= gui.GetComponent <guiSystem> ();
 }