Exemplo n.º 1
0
	// Use this for initialization
	void Start () {
		objPlayer = (GameObject) GameObject.FindWithTag ("Player");
		objCamera = (GameObject) GameObject.FindWithTag ("MainCamera");
		if (gameObject.tag == "Player") { thisIsPlayer = true; }
		ptrScriptVariable = (VariableScript) objCamera.GetComponent( typeof(VariableScript) );
		ptrGameScript = (gameScript)objCamera.GetComponent( typeof(gameScript) );
	}
Exemplo n.º 2
0
 void OnMouseDown()
 {
     VariableScript.SetTopBar(0);
     VariableScript.METABOLIZER_ID = VariableScript.ULTRARAPID_METABOLIZER;
     VariableScript.ShowGraphLegend(0);
     VariableScript.SetYAxis(0);
 }
 // Use this for initialization
 void Start()
 {
     randomTime = Random.Range(0.0f, 14.0f);
     objNest = (GameObject)GameObject.FindWithTag("Nest");
     prtScriptVariable = (VariableScript)objNest.GetComponent(typeof(VariableScript));
     nestEnemyTime += randomTime;
 }
Exemplo n.º 4
0
 void OnMouseDown()
 {
     VariableScript.SetTopBar(3);
     VariableScript.METABOLIZER_ID = VariableScript.POOR_METABOLIZER;
     VariableScript.ShowGraphLegend(3);
     VariableScript.SetYAxis(3);
 }
Exemplo n.º 5
0
 void OnMouseDown()
 {
     VariableScript.SetTopBar(2);
     VariableScript.METABOLIZER_ID = VariableScript.INTERMEDIATE_METABOLIZER;
     VariableScript.ShowGraphLegend(2);
     VariableScript.SetYAxis(2);
 }
	// Use this for initialization
	void Start () {
		ANGLE.eulerAngles = new Vector3(0,45,0);
		objPlayer = (GameObject) GameObject.FindWithTag ("Player");
		objCamera = (GameObject) GameObject.FindWithTag ("MainCamera");
		ptrGameScript = (gameScript)objCamera.GetComponent( typeof(gameScript) );
		ptrScriptVariable = (VariableScript) objCamera.GetComponent( typeof(VariableScript) );
	}
Exemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     script   = GameObject.Find("ScriptContainer").GetComponent <VariableScript>();
     gameBall = GameObject.Find("GameBall");
     script.addRow(this.gameObject);
     objectPosition = this.gameObject.transform.position.z;
 }
Exemplo n.º 8
0
 void OnMouseDown()
 {
     VariableScript.SetTopBar(1);
     VariableScript.METABOLIZER_ID = VariableScript.EXTENSIVE_METABOLIZER;
     VariableScript.ShowGraphLegend(1);
     VariableScript.SetYAxis(1);
 }
	// Use this for initialization
	void Start () {
		objPlayer = (GameObject) GameObject.FindWithTag ("Player");
		objCamera = (GameObject) GameObject.FindWithTag ("MainCamera");
		ptrScriptVariable = (VariableScript) objCamera.GetComponent( typeof(VariableScript) );
		ptrGameScript = (gameScript)objCamera.GetComponent( typeof(gameScript) );
		inputMovement = new Vector3(-1,0,0);
	}
Exemplo n.º 10
0
	// Use this for initialization
	void Start () {
		objPlayer = (GameObject) GameObject.FindWithTag ("Player");
		objCamera = (GameObject) GameObject.FindWithTag("MainCamera");
		GameScript = (gameScript) objCamera.GetComponent( typeof(gameScript) );
		son1Script=(NcCurveAnimation)son1.GetComponent( typeof(NcCurveAnimation) );
		son4Script=(NcCurveAnimation)son4.GetComponent( typeof(NcCurveAnimation) );
		ptrScriptVariable = (VariableScript) objCamera.GetComponent( typeof(VariableScript) );
	}
Exemplo n.º 11
0
	void Start () {	
		objPlayer = (GameObject) GameObject.FindWithTag ("Player");
		objCamera = (GameObject) GameObject.FindWithTag ("MainCamera");
		ptrScriptVariable = (VariableScript) objCamera.GetComponent( typeof(VariableScript) );
		objAIScriptAI  = (AIscript) objPlayer.GetComponent( typeof(AIscript) );
		pause = true;
		musicOn();
	}
Exemplo n.º 12
0
	// Use this for initialization
	void Start () {
		objPlayer = (GameObject) GameObject.FindWithTag ("Player");
		objCamera = (GameObject) GameObject.FindWithTag ("MainCamera");
		ptrScriptVariable = (VariableScript) objCamera.GetComponent( typeof(VariableScript) );
		ptrGameScript = (gameScript)objCamera.GetComponent( typeof(gameScript) );
		angleDelta = 0;
		inputRotation = transform.forward;
	}
Exemplo n.º 13
0
    void Start()
    {
        player = (GameObject) GameObject.FindWithTag ("Player");
        playerHealth = (HealthScript) player.GetComponent(typeof(HealthScript));
        router = (GameObject) GameObject.FindWithTag("Router");
        variableScript = (VariableScript) router.GetComponent( typeof(VariableScript) );

        tgtm = (ThinkGearTestManager) router.GetComponent( typeof(ThinkGearTestManager) );
    }
Exemplo n.º 14
0
    void Start()
    {
        objPlayer         = (GameObject)GameObject.FindWithTag("Player");
        ptrScriptVariable = (VariableScript)objPlayer.GetComponent(typeof(VariableScript));

        parBulletTrail = (GameObject)Instantiate(ptrScriptVariable.parBulletTrail, transform.position, Quaternion.identity);

        this.transform.position = new Vector3(transform.position.x, transform.position.y, 1.0f);
    }
Exemplo n.º 15
0
 void Start()
 {
     player = (GameObject) GameObject.FindWithTag ("Player");
     router = (GameObject) GameObject.FindWithTag("Router");
     variableScript = (VariableScript) router.GetComponent( typeof(VariableScript) );
     //fireSnd = Resources.Load("Bullets/Airshot2") as AudioClip;
     //audio.PlayOneShot(fireSnd);
     //audio.Play();
 }
Exemplo n.º 16
0
    void Start()
    {
        objPlayer = (GameObject) GameObject.FindWithTag("Player");
        ptrScriptVariable = (VariableScript)objPlayer.GetComponent(typeof(VariableScript));

        parBulletTrail = (GameObject)Instantiate(ptrScriptVariable.parBulletTrail, transform.position, Quaternion.identity);

        this.transform.position = new Vector3(transform.position.x, transform.position.y, 1.0f);
    }
Exemplo n.º 17
0
    void OnMouseUp()
    {
        // When we release the mouse, duplicate of the selected item disappears.
        tempObject.SetActive(false);

        bIsOnDrag = false;

        // If no metabolizer is selected, error message is displayed.
        if (VariableScript.METABOLIZER_ID == -1)
        {
            VariableScript.ShowMessageBox(2);
            return;
        }

        Vector3 mousePosition = Input.mousePosition;

        mousePosition.z = 6.6f;

        Vector3 mouseWorldPosition = Camera.main.ScreenToWorldPoint(mousePosition);

        mouseWorldPosition.z = 0;

        // If drug is drag & dropped correctly to the human body.
        if (avatar.collider2D.bounds.Contains(mouseWorldPosition))
        {
            for (int i = 0; i < 12; i++)
            {
                if (gameObject.Equals(VariableScript.LeftBar_Object[i]))
                {
                    // If 2 inhibitors are already selected, error message is displayed.
                    if (VariableScript.HERBAL_DRUG_COUNT == 2)
                    {
                        VariableScript.ShowMessageBox(0);
                    }
                    else
                    {
                        // If inihibitor is already selected, error message is displayed.
                        if (VariableScript.HERBAL_DRUG_COUNT == 1 && VariableScript.HERBAL_DRUGS[0] == i)
                        {
                            VariableScript.ShowMessageBox(1);
                            return;
                        }

                        // Selected inhibitor is highlighted as selected state.
                        VariableScript.HERBAL_DRUGS[VariableScript.HERBAL_DRUG_COUNT++] = i;
                        VariableScript.LeftBar_Inactive[i].SetActive(false);
                        VariableScript.LeftBar_InactiveText[i].SetActive(false);
                        VariableScript.LeftBar_Active[i].SetActive(true);
                        VariableScript.LeftBar_ActiveText[i].SetActive(true);
                    }
                    break;
                }
            }
        }
    }
Exemplo n.º 18
0
    void Start()
    {
        objCamera = (tk2dCamera)GameObject.FindWithTag("MainCamera").GetComponent <tk2dCamera>();

        objPlayer         = (GameObject)GameObject.FindWithTag("Player");
        objScriptVariable = (VariableScript)objPlayer.GetComponent(typeof(VariableScript));
        objSprite         = GetComponent <tk2dSprite>();

        objBarrel     = GameObjectUtilts.FindChild(gameObject.name, "Barrel");
        missileOrigin = objBarrel.transform.Find("BulletOrigin");

        health = maxHealth;
    }
Exemplo n.º 19
0
	// Use this for initialization
	void Start () {
		objPlayer = (GameObject) GameObject.FindWithTag ("Player");
		objCamera = (GameObject) GameObject.FindWithTag ("MainCamera");
		ptrGameScript = (gameScript) objCamera.GetComponent( typeof(gameScript) );
		ptrScriptVariable = (VariableScript) objCamera.GetComponent( typeof(VariableScript) );
		if(nowObj!=player)
			inputMovement = Vector3.zero;
		else
		{
			objPlayer.transform.position = new Vector3(0,0,-5);
			inputMovement =new Vector3(-1,0,1);
		}
	}
Exemplo n.º 20
0
    void Start()
    {
        objCamera         = (tk2dCamera)GameObject.FindWithTag("MainCamera").GetComponent <tk2dCamera>();
        objPlayer         = (GameObject)GameObject.FindWithTag("Player");
        ptrScriptVariable = (VariableScript)objPlayer.GetComponent(typeof(VariableScript));
        objGameInfo       = GameObject.FindGameObjectWithTag("GameInformation").GetComponent <GameInformation>();

        // Get turret GameObjects
        turrets = GameObject.FindGameObjectsWithTag("Turret");
        //Debug.Log("PlayerController:Start - turrets.Count = " +turrets.Length);

        enemySpawner = GameObject.FindGameObjectWithTag("EnemySpawner");
    }
Exemplo n.º 21
0
    // Use this for initialization
    void Start()
    {
        health = maxHealth;
        GameObject camera = GameObject.Find("Main Camera");
        lighter = (MainLightScript) camera.GetComponentInChildren(typeof(MainLightScript));

        //playerScript = (PlayerScript) GameObject.Find("Player").GetComponent(typeof(PlayerScript));
        //if (type.Equals("enemy"))
        //	enemyScript = (EnemyScript) GetComponent(typeof(EnemyScript));
        GameObject router = GameObject.Find("Router");
        variableScript = (VariableScript) router.GetComponent(typeof(VariableScript));
        tgtm = (ThinkGearTestManager) router.GetComponent(typeof(ThinkGearTestManager));
    }
Exemplo n.º 22
0
	// Use this for initialization
	void Start () {
		objPlayer = (GameObject) GameObject.FindGameObjectWithTag("Player");
		inputRotation = transform.forward;
		if (!rotateDirection)
			ANGLE.eulerAngles = new Vector3(0,rotateSpeed*Time.deltaTime,0);
		else ANGLE.eulerAngles = new Vector3(0,-rotateSpeed*Time.deltaTime,0);
		ANGLEFORENEMY5.eulerAngles = new Vector3(0,45,0);
		moveDistance = 0;
		movePlus = true;
		rotateAngle = 0;
		rotateCenterx = transform.position.x;
		rotateCenterz = transform.position.z;
		objCamera = (GameObject) GameObject.FindWithTag ("MainCamera");
		ptrGameScript = (gameScript)objCamera.GetComponent( typeof(gameScript) );
		ptrScriptVariable = (VariableScript) objCamera.GetComponent( typeof(VariableScript) );
	}
Exemplo n.º 23
0
    void OnMouseUp()
    {
        //When we release reset button, Button style is changed to inactive.
        VariableScript.Background_Released.SetActive(true);
        VariableScript.Text_Released.SetActive(true);
        VariableScript.Background_Pressed.SetActive(false);
        VariableScript.Text_Pressed.SetActive(false);

        //When we release reset button, graph is reset.
        VariableScript.METABOLIZER_ID    = -1;
        VariableScript.HERBAL_DRUG_COUNT = 0;

        VariableScript.SetTopBar(-1);
        VariableScript.ResetLeftBar();
        VariableScript.ShowGraphLegend(-1);
        GraphScript.RemoveAllGraph();
    }
Exemplo n.º 24
0
	// Use this for initialization
	void Start () {
		objCamera = (GameObject) GameObject.FindWithTag ("MainCamera");
		ptrGameScript = (gameScript)objCamera.GetComponent( typeof(gameScript) );
		ptrScriptVariable = (VariableScript) objCamera.GetComponent( typeof(VariableScript) );
		angle.eulerAngles = new Vector3(0, 100*Time.deltaTime, 0);
		upPo = transform.position+new Vector3(0,0,3.2f);
		downPo = transform.position+new Vector3(3.2f,0,0);
		leftPo = transform.position+new Vector3(0,0,-3.2f);
		rightPo = transform.position+new Vector3(-3.2f,0,0);
		up = (GameObject) Instantiate(ptrScriptVariable.Boss2Single,upPo,Quaternion.identity);
		up.transform.Rotate(new Vector3(0,180,0));
		down = (GameObject) Instantiate(ptrScriptVariable.Boss2Single,downPo,Quaternion.identity);
		down.transform.Rotate(new Vector3(0,180,0));
		left = (GameObject) Instantiate(ptrScriptVariable.Boss2Single,leftPo,Quaternion.identity);
		left.transform.Rotate(new Vector3(0,180,0));
		right = (GameObject) Instantiate(ptrScriptVariable.Boss2Single,rightPo,Quaternion.identity);
		right.transform.Rotate(new Vector3(0,180,0));
	}
Exemplo n.º 25
0
    /// <summary>
    /// Initialization.
    /// </summary>
    void Start()
    {
        objPlayer = (GameObject)GameObject.FindWithTag("Player");
        objCamera = (GameObject)GameObject.FindWithTag("MainCamera");
        ptrScriptVariable = (VariableScript)objPlayer.GetComponent(typeof(VariableScript));

        stoneAgeTexture = (Texture2D)Resources.Load("PlayerSpriteSheet-OMA_2");
        knightTexture = (Texture2D)Resources.Load("PlayerSpriteSheet-Ritari");
        //SwitchToKnight();
    }
Exemplo n.º 26
0
    void Start()
    {
        objCamera = (tk2dCamera) GameObject.FindWithTag("MainCamera").GetComponent<tk2dCamera>();
        objPlayer = (GameObject)GameObject.FindWithTag("Player");
        ptrScriptVariable = (VariableScript)objPlayer.GetComponent(typeof(VariableScript));
        objGameInfo = GameObject.FindGameObjectWithTag("GameInformation").GetComponent<GameInformation>();

        // Get turret GameObjects
        turrets = GameObject.FindGameObjectsWithTag("Turret");
        //Debug.Log("PlayerController:Start - turrets.Count = " +turrets.Length);

        enemySpawner = GameObject.FindGameObjectWithTag("EnemySpawner");
    }
Exemplo n.º 27
0
 // Use this for initialization
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     router = GameObject.FindWithTag("Router");
     variableScript = (VariableScript) router.GetComponent( typeof(VariableScript) );
 }
Exemplo n.º 28
0
 // Use this for initialization
 void Start()
 {
     variableScript = (VariableScript) GameObject.Find("Router").GetComponent("VariableScript");
     gunfire = (AudioSource) GetComponent(typeof(AudioSource));
 }
Exemplo n.º 29
0
 // Use this for initialization
 void Start()
 {
     variableScript = (VariableScript) GameObject.Find("Room").GetComponentInChildren(typeof(VariableScript));
 }
Exemplo n.º 30
0
    public void Start()
    {
        variableScript = (VariableScript) GameObject.Find("Router").GetComponent(typeof(VariableScript));
        room = GameObject.Find("Room");
        player = GameObject.FindGameObjectWithTag("Player");

        spawned = false;

        shooterCount = DifficultyScaler.shooterCount;
        followerCount = DifficultyScaler.followerCount;
        type3Count = DifficultyScaler.type3Count;
        bruiserCount = DifficultyScaler.bruiserCount;
    }
Exemplo n.º 31
0
 void Start()
 {
     timeAccumulator = 0;
     router = (GameObject) GameObject.FindWithTag("Router");
     variableScript = (VariableScript) router.GetComponent( typeof(VariableScript) );
 }
Exemplo n.º 32
0
 // Use this for initialization
 protected override void Initialize()
 {
     // Find the gos.
     _ptrScriptVariable = (VariableScript) Registry.Instance.CurrentPlayer.GetComponent( typeof(VariableScript) );
     _actionState = ActionState.Stand;
 }
Exemplo n.º 33
0
 // Use this for initialization
 void Start()
 {
     objPlayer = (GameObject) GameObject.FindWithTag ("Player");
     prtScriptVariable = (VariableScript)objPlayer.GetComponent(typeof(VariableScript));
     moveSpeed += Random.Range(-5.0f, 5.0f);
 }
Exemplo n.º 34
0
    // Use this for initialization
    void Start()
    {
        camera = (GameObject) GameObject.FindWithTag("MainCamera");
        variableScript = (VariableScript) GetComponent( typeof(VariableScript));

        //		_thinkGearWrapper = new ThinkGearWrapper();
        //		_thinkGearWrapper.Connect("COM4", 57600, true);
        //
        //		fileWriter = new StreamWriter("D:/Computer Science/Thesis/HelloUnityCSV.csv");
    }
Exemplo n.º 35
0
    // Use this for initialization
    void Start()
    {
        objPlayer = (GameObject)GameObject.FindWithTag(playerTag);
        objTarget = (GameObject)GameObject.FindWithTag(targetTag);
        ptrScriptVariable = (VariableScript)objPlayer.GetComponent(typeof(VariableScript));
        randomTarget = GetRandomTarget();

        enemyTexture = (Texture2D)Resources.Load("WolfSpriteSheet");
    }
Exemplo n.º 36
0
    void Start()
    {
        objCamera = (tk2dCamera) GameObject.FindWithTag("MainCamera").GetComponent<tk2dCamera>();

        objPlayer = (GameObject) GameObject.FindWithTag("Player");
        objScriptVariable = (VariableScript)objPlayer.GetComponent(typeof(VariableScript));
        objSprite = GetComponent<tk2dSprite>();

        objBarrel = GameObjectUtilts.FindChild(gameObject.name, "Barrel");
        missileOrigin = objBarrel.transform.Find("BulletOrigin");

        health = maxHealth;
    }
Exemplo n.º 37
0
 void OnMouseUp()
 {
     VariableScript.HideMessageBox();
 }
 // Test variables
 // Use this for initialization
 void Start()
 {
     objPlayer = (GameObject)GameObject.FindWithTag(playerTag);
     // Head towards the center for now.
     ptrScriptVariable = (VariableScript)objPlayer.GetComponent(typeof(VariableScript));
 }
Exemplo n.º 39
0
 // Use this for initialization
 void Start()
 {
     variableScript = (VariableScript) GameObject.Find("Router").GetComponent(typeof(VariableScript));
     room = GameObject.Find("Room");
 }
	// Use this for initialization
	void Start () {
		objPlayer = (GameObject) GameObject.FindWithTag ("Player");
		objCamera = (GameObject) GameObject.FindWithTag ("MainCamera");
		ptrScriptVariable = (VariableScript) objCamera.GetComponent( typeof(VariableScript) );
	}
Exemplo n.º 41
0
    // Use this for initialization
    void Start()
    {
        player = (GameObject) GameObject.FindGameObjectWithTag("Player");
        playerHealth = (HealthScript) player.GetComponent(typeof(HealthScript));
        router = (GameObject) GameObject.FindWithTag("Router");
        variableScript = (VariableScript) router.GetComponent( typeof(VariableScript) );
        healthScript = (HealthScript) GetComponent(typeof(HealthScript));
        switch(type){
            case "follower":
                    //health = DifficultyScaler.followerHealth;
                    //healthScript.maxHealth = 70;
                    onDestroySFX = (GameObject)Instantiate(variableScript.EnemyNormalDestroySFX );
                break;
            case "shooter":
                    //health = DifficultyScaler.shooterHealth;
                    //healthScript.maxHealth = 40;
                    fireSFX	 = (GameObject)Instantiate(variableScript.EnemyShooterFireSFX );
                    onDestroySFX = (GameObject)Instantiate(variableScript.EnemyShooterDestroySFX );
                break;

        }
        variableScript.Enemies.Add(gameObject);

        tgtm = (ThinkGearTestManager) router.GetComponent(typeof(ThinkGearTestManager));
    }